diff --git a/.codecov.yml b/.codecov.yml index 62fc306ec3b..52e4b38d9ce 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,7 +1,19 @@ coverage: precision: 2 round: nearest - range: 60...100 + range: 60...90 + status: + project: + llnl: + paths: + - lib/spack/llnl + commands: + paths: + - lib/spack/spack/cmd + core: + paths: + - "!lib/spack/llnl" + - "!lib/spack/spack/cmd" ignore: - lib/spack/spack/test/.* diff --git a/lib/spack/spack/cmd/dependents.py b/lib/spack/spack/cmd/dependents.py index 8c533561e3e..42181b55024 100644 --- a/lib/spack/spack/cmd/dependents.py +++ b/lib/spack/spack/cmd/dependents.py @@ -45,7 +45,7 @@ def dependents(parser, args): tty.die("spack dependents takes only one spec.") spec = spack.cmd.disambiguate_spec(specs[0]) - tty.msg("Dependents of %s" % spec.format('$_$@$%@$#', color=True)) + tty.msg("Dependents of %s" % spec.format('$_$@$%@$/', color=True)) deps = spack.store.db.installed_dependents(spec) if deps: spack.cmd.display_specs(deps) diff --git a/lib/spack/spack/cmd/uninstall.py b/lib/spack/spack/cmd/uninstall.py index f8b5408ba14..fb9094f1b4f 100644 --- a/lib/spack/spack/cmd/uninstall.py +++ b/lib/spack/spack/cmd/uninstall.py @@ -177,7 +177,7 @@ def get_uninstall_list(args): if dependent_list and not args.dependents and not args.force: for spec, lst in dependent_list.items(): tty.error("Will not uninstall %s" % - spec.format("$_$@$%@$#", color=True)) + spec.format("$_$@$%@$/", color=True)) print('') print("The following packages depend on it:") spack.cmd.display_specs(lst, **display_args) diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py index ff552233515..01d545de6d1 100644 --- a/lib/spack/spack/database.py +++ b/lib/spack/spack/database.py @@ -239,7 +239,7 @@ def _assign_dependencies(self, hash_key, installs, data): if dhash not in data: tty.warn("Missing dependency not in database: ", "%s needs %s-%s" % ( - spec.format('$_$#'), dname, dhash[:7])) + spec.format('$_$/'), dname, dhash[:7])) continue child = data[dhash].spec @@ -340,6 +340,7 @@ def invalid_record(hash_key, error): # cached prematurely. for hash_key, rec in data.items(): rec.spec._mark_concrete() + rec.spec.package.spec._mark_concrete() self._data = data diff --git a/lib/spack/spack/graph.py b/lib/spack/spack/graph.py index 7cc2046b9dc..91230263f15 100644 --- a/lib/spack/spack/graph.py +++ b/lib/spack/spack/graph.py @@ -571,7 +571,7 @@ def label(key, label): else: def key_label(s): - return s.dag_hash(), "%s-%s" % (s.name, s.dag_hash(7)) + return s.dag_hash(), "%s/%s" % (s.name, s.dag_hash(7)) for s in spec.traverse(deptype=deptype): skey, slabel = key_label(s) diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py index 5e2a840e14c..885f2197eff 100644 --- a/lib/spack/spack/modules.py +++ b/lib/spack/spack/modules.py @@ -327,6 +327,10 @@ def blacklisted(self): blacklist_matches = [x for x in configuration.get('blacklist', []) if self.spec.satisfies(x)] + blacklist_implicits = configuration.get('blacklist_implicits') + installed_implicitly = not self.spec._installed_explicitly() + blacklisted_as_implicit = blacklist_implicits and installed_implicitly + if whitelist_matches: message = '\tWHITELIST : %s [matches : ' % self.spec.cshort_spec for rule in whitelist_matches: @@ -341,7 +345,13 @@ def blacklisted(self): message += ' ]' tty.debug(message) - if not whitelist_matches and blacklist_matches: + if blacklisted_as_implicit: + message = '\tBLACKLISTED_AS_IMPLICIT : %s' % \ + self.spec.cshort_spec + tty.debug(message) + + is_blacklisted = blacklist_matches or blacklisted_as_implicit + if not whitelist_matches and is_blacklisted: return True return False @@ -428,13 +438,20 @@ def header(self): def module_specific_content(self, configuration): return tuple() + # Subclasses can return a fragment of module code that prints out + # a warning that modules are being autoloaded. + def autoload_warner(self): + return '' + def autoload(self, spec): if not isinstance(spec, str): m = type(self)(spec) module_file = m.use_name else: module_file = spec - return self.autoload_format.format(module_file=module_file) + return self.autoload_format.format( + module_file=module_file, + warner=self.autoload_warner().format(module_file=module_file)) def prerequisite(self, spec): m = type(self)(spec) @@ -476,6 +493,10 @@ def remove(self): # removedirs throws OSError on first non-empty directory found pass + def verbose_autoload(self): + configuration = _module_config.get(self.name, {}) + return configuration.get('verbose_autoload', True) + class Dotkit(EnvModule): name = 'dotkit' @@ -527,8 +548,13 @@ class TclModule(EnvModule): path = canonicalize_path( _roots.get(name, join_path(spack.share_path, 'modules'))) + def autoload_warner(self): + if self.verbose_autoload(): + return 'puts stderr "Autoloading {module_file}"\n' + return '' + autoload_format = ('if ![ is-loaded {module_file} ] {{\n' - ' puts stderr "Autoloading {module_file}"\n' + ' {warner}' ' module load {module_file}\n' '}}\n\n') @@ -655,8 +681,13 @@ class LmodModule(EnvModule): UnsetEnv: 'unsetenv("{name}")\n' } + def autoload_warner(self): + if self.verbose_autoload(): + return 'LmodMessage("Autoloading {module_file}")\n' + return '' + autoload_format = ('if not isloaded("{module_file}") then\n' - ' LmodMessage("Autoloading {module_file}")\n' + ' {warner}' ' load("{module_file}")\n' 'end\n\n') diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 07e3221ed7a..0df0ff71ea5 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -1145,13 +1145,13 @@ def return_val(dspec): def short_spec(self): """Returns a version of the spec with the dependencies hashed instead of completely enumerated.""" - return self.format('$_$@$%@$+$=$#') + return self.format('$_$@$%@$+$=$/') @property def cshort_spec(self): """Returns a version of the spec with the dependencies hashed instead of completely enumerated.""" - return self.format('$_$@$%@$+$=$#', color=True) + return self.format('$_$@$%@$+$=$/', color=True) @property def prefix(self): @@ -2374,7 +2374,7 @@ def format(self, format_string='$_$@$%@+$+$=', **kwargs): prefixes as above $+ Options $= Architecture prefixed by 'arch=' - $# 7-char prefix of DAG hash with '-' prefix + $/ 7-char prefix of DAG hash with '-' prefix $$ $ You can also use full-string versions, which elide the prefixes:: @@ -2408,7 +2408,7 @@ def format(self, format_string='$_$@$%@+$+$=', **kwargs): of the package, but no dependencies, arch, or compiler. TODO: allow, e.g., ``$6#`` to customize short hash length - TODO: allow, e.g., ``$##`` for full hash. + TODO: allow, e.g., ``$//`` for full hash. """ color = kwargs.get('color', False) length = len(format_string) @@ -2455,8 +2455,8 @@ def write(s, c): if self.architecture and str(self.architecture): a_str = ' arch' + c + str(self.architecture) + ' ' write(fmt % (a_str), c) - elif c == '#': - out.write('-' + fmt % (self.dag_hash(7))) + elif c == '/': + out.write('/' + fmt % (self.dag_hash(7))) elif c == '$': if fmt != '%s': raise ValueError("Can't use format width with $$.") @@ -2529,7 +2529,7 @@ def write(s, c): hashlen = int(hashlen) else: hashlen = None - out.write(fmt % (self.dag_hash(hashlen))) + out.write('/' + fmt % (self.dag_hash(hashlen))) named = False @@ -2596,6 +2596,16 @@ def _install_status(self): except KeyError: return None + def _installed_explicitly(self): + """Helper for tree to print DB install status.""" + if not self.concrete: + return None + try: + record = spack.store.db.get_record(self) + return record.explicit + except KeyError: + return None + def tree(self, **kwargs): """Prints out this spec and its dependencies, tree-formatted with indentation.""" @@ -3151,7 +3161,7 @@ def __init__(self, provided, required): class AmbiguousHashError(SpecError): def __init__(self, msg, *specs): - specs_str = '\n ' + '\n '.join(spec.format('$.$@$%@+$+$=$#') + specs_str = '\n ' + '\n '.join(spec.format('$.$@$%@+$+$=$/') for spec in specs) super(AmbiguousHashError, self).__init__(msg + specs_str) diff --git a/lib/spack/spack/test/graph.py b/lib/spack/spack/test/graph.py index 09dbcd05486..ce7b07ed866 100644 --- a/lib/spack/spack/test/graph.py +++ b/lib/spack/spack/test/graph.py @@ -84,16 +84,16 @@ def test_dynamic_dot_graph_mpileaks(builtin_mock): dot = stream.getvalue() - mpileaks_hash, mpileaks_lbl = s.dag_hash(), s.format('$_$#') - mpi_hash, mpi_lbl = s['mpi'].dag_hash(), s['mpi'].format('$_$#') + mpileaks_hash, mpileaks_lbl = s.dag_hash(), s.format('$_$/') + mpi_hash, mpi_lbl = s['mpi'].dag_hash(), s['mpi'].format('$_$/') callpath_hash, callpath_lbl = ( - s['callpath'].dag_hash(), s['callpath'].format('$_$#')) + s['callpath'].dag_hash(), s['callpath'].format('$_$/')) dyninst_hash, dyninst_lbl = ( - s['dyninst'].dag_hash(), s['dyninst'].format('$_$#')) + s['dyninst'].dag_hash(), s['dyninst'].format('$_$/')) libdwarf_hash, libdwarf_lbl = ( - s['libdwarf'].dag_hash(), s['libdwarf'].format('$_$#')) + s['libdwarf'].dag_hash(), s['libdwarf'].format('$_$/')) libelf_hash, libelf_lbl = ( - s['libelf'].dag_hash(), s['libelf'].format('$_$#')) + s['libelf'].dag_hash(), s['libelf'].format('$_$/')) assert ' "%s" [label="%s"]\n' % (mpileaks_hash, mpileaks_lbl) in dot assert ' "%s" [label="%s"]\n' % (callpath_hash, callpath_lbl) in dot diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh index 24ab3dae6f4..a67ae04b245 100755 --- a/share/spack/setup-env.sh +++ b/share/spack/setup-env.sh @@ -198,3 +198,10 @@ _sp_dotkit_root=$(spack-python -c "print(spack.util.path.canonicalize_path(spack _sp_tcl_root=$(spack-python -c "print(spack.util.path.canonicalize_path(spack.config.get_config('config').get('module_roots', {}).get('tcl')))") _spack_pathadd DK_NODE "${_sp_dotkit_root%/}/$_sp_sys_type" _spack_pathadd MODULEPATH "${_sp_tcl_root%/}/$_sp_sys_type" + +# +# Add programmable tab completion for Bash +# +if [ -n "${BASH_VERSION:-}" ]; then + source $_sp_share_dir/spack-completion.bash +fi diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash new file mode 100755 index 00000000000..dde1a5280f7 --- /dev/null +++ b/share/spack/spack-completion.bash @@ -0,0 +1,932 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## + +# The following global variables are used/set by Bash programmable completion +# COMP_CWORD: An index into ${COMP_WORDS} of the word containing the +# current cursor position +# COMP_LINE: The current command line +# COMP_WORDS: an array containing individual command arguments typed so far +# COMPREPLY: an array containing possible completions as a result of your +# function + +# Bash programmable completion for Spack +function _bash_completion_spack { + # In all following examples, let the cursor be denoted by brackets, i.e. [] + + # For our purposes, flags should not affect tab completion. For instance, + # `spack install []` and `spack -d install --jobs 8 []` should both give the same + # possible completions. Therefore, we need to ignore any flags in COMP_WORDS. + local COMP_WORDS_NO_FLAGS=() + local index=0 + while [[ "$index" -lt "$COMP_CWORD" ]] + do + if [[ "${COMP_WORDS[$index]}" == [a-z]* ]] + then + COMP_WORDS_NO_FLAGS+=("${COMP_WORDS[$index]}") + fi + let index++ + done + + # Options will be listed by a subfunction named after non-flag arguments. + # For example, `spack -d install []` will call _spack_install + # and `spack compiler add []` will call _spack_compiler_add + local subfunction=$(IFS='_'; echo "_${COMP_WORDS_NO_FLAGS[*]}") + + # However, the word containing the current cursor position needs to be + # added regardless of whether or not it is a flag. This allows us to + # complete something like `spack install --keep-st[]` + COMP_WORDS_NO_FLAGS+=("${COMP_WORDS[$COMP_CWORD]}") + + # Since we have removed all words after COMP_CWORD, we can safely assume + # that COMP_CWORD_NO_FLAGS is simply the index of the last element + local COMP_CWORD_NO_FLAGS=$(( ${#COMP_WORDS_NO_FLAGS[@]} - 1 )) + + # There is no guarantee that the cursor is at the end of the command line + # when tab completion is envoked. For example, in the following situation: + # `spack -d [] install` + # if the user presses the TAB key, a list of valid flags should be listed. + # Note that we cannot simply ignore everything after the cursor. In the + # previous scenario, the user should expect to see a list of flags, but + # not of other subcommands. Obviously, `spack -d list install` would be + # invalid syntax. To accomplish this, we use the variable list_options + # which is true if the current word starts with '-' or if the cursor is + # not at the end of the line. + local list_options=false + if [[ "${COMP_WORDS[$COMP_CWORD]}" == -* || \ + "$COMP_CWORD" -ne "${#COMP_WORDS[@]}-1" ]] + then + list_options=true + fi + + # In general, when envoking tab completion, the user is not expecting to + # see optional flags mixed in with subcommands or package names. Tab + # completion is used by those who are either lazy or just bad at spelling. + # If someone doesn't remember what flag to use, seeing single letter flags + # in their results won't help them, and they should instead consult the + # documentation. However, if the user explicitly declares that they are + # looking for a flag, we can certainly help them out. + # `spack install -[]` + # and + # `spack install --[]` + # should list all flags and long flags, respectively. Furthermore, if a + # subcommand has no non-flag completions, such as `spack arch []`, it + # should list flag completions. + + local cur=${COMP_WORDS_NO_FLAGS[$COMP_CWORD_NO_FLAGS]} + local prev=${COMP_WORDS_NO_FLAGS[$COMP_CWORD_NO_FLAGS-1]} + + #_test_vars + + # Make sure function exists before calling it + if [[ "$(type -t $subfunction)" == "function" ]] + then + COMPREPLY=($($subfunction)) + fi +} + +# Spack commands + +function _spack { + if $list_options + then + compgen -W "-h --help -d --debug -D --pdb -k --insecure -m --mock -p + --profile -v --verbose -s --stacktrace -V --version" -- "$cur" + else + compgen -W "$(_subcommands)" -- "$cur" + fi +} + +function _spack_activate { + if $list_options + then + compgen -W "-h --help -f --force" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_arch { + compgen -W "-h --help -p --platform" -- "$cur" +} + +function _spack_bootstrap { + # FIXME: What does this command even do? + if $list_options + then + compgen -W "-h --help -r --remote" -- "$cur" + else + compgen -o dirnames -- "$cur" + fi +} + +function _spack_build { + if $list_options + then + compgen -W "-h --help -v --verbose" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_cd { + if $list_options + then + compgen -W "-h --help -m --module-dir -r --spack-root -i --install-dir + -p --package-dir -P --packages -s --stage-dir -S --stages + -b --build-dir" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_checksum { + if $list_options + then + compgen -W "-h --help --keep-stage" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_clean { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_compiler { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "find add remove rm list info" -- "$cur" + fi +} + +function _spack_compiler_add { + if $list_options + then + compgen -W "-h --help --scope" -- "$cur" + else + compgen -o dirnames -- "$cur" + fi +} + +function _spack_compiler_find { + # Alias to `spack compiler add` + _spack_compiler_add +} + +function _spack_compiler_info { + if $list_options + then + compgen -W "-h --help --scope" -- "$cur" + else + compgen -W "$(_installed_compilers)" -- "$cur" + fi +} + +function _spack_compiler_list { + compgen -W "-h --help --scope" -- "$cur" +} + +function _spack_compiler_remove { + if $list_options + then + compgen -W "-h --help -a --all --scope" -- "$cur" + else + compgen -W "$(_installed_compilers)" -- "$cur" + fi +} + +function _spack_compiler_rm { + # Alias to `spack compiler remove` + _spack_compiler_remove +} + +function _spack_compilers { + compgen -W "-h --help --scope" -- "$cur" +} + +function _spack_config { + if $list_options + then + compgen -W "-h --help --scope" -- "$cur" + else + compgen -W "edit get" -- "$cur" + fi +} + +function _spack_config_edit { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "mirrors repos modules packages config compilers" -- "$cur" + fi +} + +function _spack_config_get { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "mirrors repos modules packages config compilers" -- "$cur" + fi +} + +function _spack_configure { + if $list_options + then + compgen -W "-h --help -v --verbose" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_create { + compgen -W "-h --help --keep-stage -n --name -t --template -r --repo + -N --namespace -f --force" -- "$cur" +} + +function _spack_deactivate { + if $list_options + then + compgen -W "-h --help -f --force -a --all" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_debug { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "create-db-tarball" -- "$cur" + fi +} + +function _spack_create-db-tarball { + compgen -W "-h --help" -- "$cur" +} + +function _spack_dependents { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_diy { + if $list_options + then + compgen -W "-h --help -i --ignore-dependencies --keep-prefix + --skip-patch -q --quiet --clean --dirty" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_doc { + # FIXME: What does this command even do? + compgen -W "-h --help" -- "$cur" +} + +function _spack_edit { + if $list_options + then + compgen -W "-h --help -b --build-system -c --command -t --test -m --module + -r --repo -N --namespace" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_env { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_extensions { + if $list_options + then + compgen -W "-h --help -l --long -p --paths -d --deps" -- "$cur" + else + compgen -W "go-bootstrap go lua octave python r ruby rust" -- "$cur" + fi +} + +function _spack_fetch { + if $list_options + then + compgen -W "-h --help -n --no-checksum -m --missing + -D --dependencies" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_find { + if $list_options + then + compgen -W "-h --help -s --short -p --paths -d --deps -l --long + -L --very-long -f --show-flags -e --explicit + -E --implicit -u --unknown -m --missing -v --variants + -M --only-missing -N --namespace" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_flake8 { + if $list_options + then + compgen -W "-h --help -k --keep-temp -o --output + -r --root-relative -U --no-untracked" -- "$cur" + else + compgen -o filenames -- "$cur" + fi +} + +function _spack_graph { + if $list_options + then + compgen -W "-h --help -a --ascii -d --dot -n --normalize -s --static + -i --installed -t --deptype" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_help { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "$(_subcommands)" -- "$cur" + fi +} + +function _spack_info { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_install { + if $list_options + then + compgen -W "-h --help --only -j --jobs --keep-prefix --keep-stage + -n --no-checksum -v --verbose --fake --clean --dirty + --run-tests --log-format --log-file" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_list { + if $list_options + then + compgen -W "-h --help -d --search-description --format" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_load { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_location { + if $list_options + then + compgen -W "-h --help -m --module-dir -r --spack-root -i --install-dir + -p --package-dir -P --packages -s --stage-dir -S --stages + -b --build-dir" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_md5 { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -o filenames -- "$cur" + fi +} + +function _spack_mirror { + if $list_options + then + compgen -W "-h --help -n --no-checksum" -- "$cur" + else + compgen -W "add create list remove rm" -- "$cur" + fi +} + +function _spack_mirror_add { + if $list_options + then + compgen -W "-h --help --scope" -- "$cur" + else + compgen -o dirnames -- "$cur" + fi +} + +function _spack_mirror_create { + if $list_options + then + compgen -W "-h --help -d --directory -f --file + -D --dependencies -o --one-version-per-spec" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_mirror_list { + compgen -W "-h --help --scope" -- "$cur" +} + +function _spack_mirror_remove { + if $list_options + then + compgen -W "-h --help --scope" -- "$cur" + else + compgen -W "$(_mirrors)" -- "$cur" + fi +} + +function _spack_module { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "find loads refresh rm" -- "$cur" + fi +} + +function _spack_module_find { + if $list_options + then + compgen -W "-h --help -m --module-type" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_module_loads { + if $list_options + then + compgen -W "-h --help --input-only -p --prefix -x --exclude + -m --module-type -r --dependencies" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi + +} + +function _spack_module_refresh { + if $list_options + then + compgen -W "-h --help --delete-tree -m --module-type + -y --yes-to-all" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_module_rm { + if $list_options + then + compgen -W "-h --help -m --module-type -y --yes-to-all" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_patch { + if $list_options + then + compgen -W "-h --help -n --no-checksum" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_pkg { + # FIXME: What does this subcommand even do? + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "add added diff list removed" -- "$cur" + fi +} + +function _spack_pkg_add { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_pkg_added { + # FIXME: How to list git revisions? + compgen -W "-h --help" -- "$cur" +} + +function _spack_pkg_diff { + # FIXME: How to list git revisions? + compgen -W "-h --help" -- "$cur" +} + +function _spack_pkg_list { + # FIXME: How to list git revisions? + compgen -W "-h --help" -- "$cur" +} + +function _spack_pkg_removed { + # FIXME: How to list git revisions? + compgen -W "-h --help" -- "$cur" +} + +function _spack_providers { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "blas daal elf golang ipp lapack mkl + mpe mpi pil scalapack" -- "$cur" + fi +} + +function _spack_purge { + compgen -W "-h --help -s --stage -d --downloads + -m --misc-cache -a --all" -- "$cur" +} + +function _spack_python { + if $list_options + then + compgen -W "-h --help -c" -- "$cur" + else + compgen -o filenames -- "$cur" + fi +} + +function _spack_reindex { + compgen -W "-h --help" -- "$cur" +} + +function _spack_repo { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "add create list remove rm" -- "$cur" + fi +} + +function _spack_repo_add { + if $list_options + then + compgen -W "-h --help --scope" -- "$cur" + else + compgen -o dirnames -- "$cur" + fi +} + +function _spack_repo_create { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -o dirnames -- "$cur" + fi +} + +function _spack_repo_list { + compgen -W "-h --help --scope" -- "$cur" +} + +function _spack_repo_remove { + if $list_options + then + compgen -W "-h --help --scope" -- "$cur" + else + compgen -W "$(_repos)" -- "$cur" + fi +} + +function _spack_repo_rm { + # Alias to `spack repo remove` + _spack_repo_remove +} + +function _spack_restage { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_setup { + if $list_options + then + compgen -W "-h --help -i --ignore-dependencies -v --verbose + --clean --dirty" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_spec { + if $list_options + then + compgen -W "-h --help -l --long -L --very-long -y --yaml -c --cover + -N --namespaces -I --install-status -t --types" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_stage { + if $list_options + then + compgen -W "-h --help -n --no-checksum -p --path" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_test { + if $list_options + then + compgen -W "-h --help -H --pytest-help -l --list + -L --long-list" -- "$cur" + else + compgen -W "$(_tests)" -- "$cur" + fi +} + +function _spack_uninstall { + if $list_options + then + compgen -W "-h --help -f --force -a --all -d --dependents + -y --yes-to-all" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_unload { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "$(_installed_packages)" + fi +} + +function _spack_unuse { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "$(_installed_packages)" + fi +} + +function _spack_url { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "list parse test" -- "$cur" + fi +} + +function _spack_url_list { + compgen -W "-h --help -c --color -e --extrapolation -n --incorrect-name + -v --incorrect-version" -- "$cur" +} + +function _spack_url_parse { + compgen -W "-h --help -s --spider" -- "$cur" +} + +function _spack_url_test { + compgen -W "-h --help" -- "$cur" +} + +function _spack_use { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "$(_installed_packages)" -- "$cur" + fi +} + +function _spack_versions { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -W "$(_all_packages)" -- "$cur" + fi +} + +function _spack_view { + if $list_options + then + compgen -W "-h --help -v --verbose -e --exclude + -d --dependencies" -- "$cur" + else + compgen -W "add check hard hardlink remove rm soft + statlink status symlink" -- "$cur" + fi +} + +function _spack_view_add { + # Alias for `spack view symlink` + _spack_view_symlink +} + +function _spack_view_check { + # Alias for `spack view statlink` + _spack_view_statlink +} + +function _spack_view_hard { + # Alias for `spack view hardlink` + _spack_view_hardlink +} + +function _spack_view_hardlink { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -o dirnames -- "$cur" + fi +} + +function _spack_view_remove { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -o dirnames -- "$cur" + fi +} + +function _spack_view_rm { + # Alias for `spack view remove` + _spack_view_remove +} + +function _spack_view_soft { + # Alias for `spack view symlink` + _spack_view_symlink +} + +function _spack_view_statlink { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -o dirnames -- "$cur" + fi +} + +function _spack_view_status { + # Alias for `spack view statlink` + _spack_view_statlink +} + +function _spack_view_symlink { + if $list_options + then + compgen -W "-h --help" -- "$cur" + else + compgen -o dirnames -- "$cur" + fi +} + +# Helper functions for subcommands + +function _subcommands { + spack help | grep "^ [a-z]" | awk '{print $1}' +} + +function _all_packages { + spack list +} + +function _installed_packages { + # Perl one-liner used to strip out color codes + spack find | grep -v "^--" | perl -pe 's/\e\[?.*?[\@-~]//g' +} + +function _installed_compilers { + spack compilers | egrep -v "^(-|=)" +} + +function _mirrors { + spack mirror list | awk '{print $1}' +} + +function _repos { + spack repo list | awk '{print $1}' +} + +function _tests { + spack test -l +} + +# Testing functions + +function _test_vars { + echo "-----------------------------------------------------" >> temp + echo "Full line: '$COMP_LINE'" >> temp + echo >> temp + echo "Word list w/ flags: $(_pretty_print COMP_WORDS[@])" >> temp + echo "# words w/ flags: '${#COMP_WORDS[@]}'" >> temp + echo "Cursor index w/ flags: '$COMP_CWORD'" >> temp + echo >> temp + echo "Word list w/out flags: $(_pretty_print COMP_WORDS_NO_FLAGS[@])" >> temp + echo "# words w/out flags: '${#COMP_WORDS_NO_FLAGS[@]}'" >> temp + echo "Cursor index w/out flags: '$COMP_CWORD_NO_FLAGS'" >> temp + echo >> temp + echo "Subfunction: '$subfunction'" >> temp + if $list_options + then + echo "List options: 'True'" >> temp + else + echo "List options: 'False'" >> temp + fi + echo "Current word: '$cur'" >> temp + echo "Previous word: '$prev'" >> temp +} + +# Pretty-prints one or more arrays +# Syntax: _pretty_print array1[@] ... +function _pretty_print { + for arg in $@ + do + local array=("${!arg}") + echo -n "$arg: [" + printf "'%s'" "${array[0]}" + printf ", '%s'" "${array[@]:1}" + echo "]" + done +} + +complete -F _bash_completion_spack spack diff --git a/var/spack/repos/builtin/packages/ant/package.py b/var/spack/repos/builtin/packages/ant/package.py index 81a0e089e5b..19f03e1e536 100644 --- a/var/spack/repos/builtin/packages/ant/package.py +++ b/var/spack/repos/builtin/packages/ant/package.py @@ -32,9 +32,12 @@ class Ant(Package): """ homepage = "http://ant.apache.org/" - url = "http://apache.claz.org/ant/source/apache-ant-1.9.7-src.tar.gz" + url = "https://archive.apache.org/dist/ant/source/apache-ant-1.9.7-src.tar.gz" - version('1.9.7', 'a2fd9458c76700b7be51ef12f07d4bb1') + # 1.10.0 requires newer Java, not yet tested.... + # version('1.10.0', '2260301bb7734e34d8b96f1a5fd7979c') + version('1.9.8', '16253d516d5c33c4af9ef8fafcf1004b') + version('1.9.7', 'a2fd9458c76700b7be51ef12f07d4bb1') depends_on('jdk') diff --git a/var/spack/repos/builtin/packages/archer/package.py b/var/spack/repos/builtin/packages/archer/package.py new file mode 100644 index 00000000000..31a1d498daf --- /dev/null +++ b/var/spack/repos/builtin/packages/archer/package.py @@ -0,0 +1,56 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## + +from spack import * + + +class Archer(Package): + """ARCHER, a data race detection tool for large OpenMP applications.""" + + homepage = "https://github.com/PRUNERS/ARCHER" + + version('1.0.0b', git='https://github.com/PRUNERS/ARCHER.git', + commit='2cf7ead36358842871d5bd9c33d499f62bf8dd38') + + depends_on('cmake', type='build') + depends_on('llvm+clang~gold') + depends_on('ninja', type='build') + depends_on('llvm-openmp-ompt') + + def install(self, spec, prefix): + + with working_dir('spack-build', create=True): + cmake_args = std_cmake_args[:] + cmake_args.extend([ + '-G', 'Ninja', + '-DCMAKE_C_COMPILER=clang', + '-DCMAKE_CXX_COMPILER=clang++', + '-DOMP_PREFIX:PATH=%s' % spec['llvm-openmp-ompt'].prefix, + ]) + + cmake('..', *cmake_args) + ninja = Executable('ninja') + ninja() + ninja('install') diff --git a/var/spack/repos/builtin/packages/astyle/package.py b/var/spack/repos/builtin/packages/astyle/package.py index 851952be660..5598373b44d 100644 --- a/var/spack/repos/builtin/packages/astyle/package.py +++ b/var/spack/repos/builtin/packages/astyle/package.py @@ -44,7 +44,7 @@ def build_directory(self): return join_path(self.stage.source_path, 'build', self.compiler.name) def edit(self, spec, prefix): - makefile = join_path(self.build_directory(), 'Makefile') + makefile = join_path(self.build_directory, 'Makefile') filter_file(r'^CXX\s*=.*', 'CXX=%s' % spack_cxx, makefile) # strangely enough install -o $(USER) -g $(USER) stoped working on OSX if sys.platform == 'darwin': diff --git a/var/spack/repos/builtin/packages/catch/package.py b/var/spack/repos/builtin/packages/catch/package.py index 8d2b0a1b243..880d0f88b57 100644 --- a/var/spack/repos/builtin/packages/catch/package.py +++ b/var/spack/repos/builtin/packages/catch/package.py @@ -31,6 +31,13 @@ class Catch(Package): homepage = "https://github.com/philsquared/Catch" url = "https://github.com/philsquared/Catch/archive/v1.3.0.tar.gz" + version('1.7.0', 'fe39f5b3eb07a5dd0e3f84a1335ceca7de8982e6') + version('1.6.1', '7d46961a3131655b986123f8a1f439a04a0af623') + version('1.6.0', '890a3b21085d796e13c3bfaf4b6c6f1d06e4a52e') + version('1.5.9', '8bc32146a5a2789cd3d3ce2893772e32f412f1b1') + version('1.5.0', 'c87397846ea5126febd39f513b413e32f9ed552b') + version('1.4.0', 'c165406968fbfb46949885da571cd528c62c4d9a') + version('1.3.5', '31553ba6e4bd0cc61e0507d6754847e354699284') version('1.3.0', 'e13694aaff72817d02af8ed27d077cd261b6e857') def install(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index 276db137ad9..4ff9615016b 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -63,7 +63,8 @@ class Cmake(Package): depends_on('qt', when='+qt') depends_on('python@2.7.11:', when='+doc', type='build') depends_on('py-sphinx', when='+doc', type='build') - depends_on('openssl', when='+openssl') + depends_on("openssl", when='+openssl') + depends_on("openssl@:1.0.99", when='@:3.6.9+openssl') depends_on('ncurses', when='+ncurses') # Cannot build with Intel, should be fixed in 3.6.2 diff --git a/var/spack/repos/builtin/packages/cuda/package.py b/var/spack/repos/builtin/packages/cuda/package.py index ed8518f98fe..f01cf9c7302 100644 --- a/var/spack/repos/builtin/packages/cuda/package.py +++ b/var/spack/repos/builtin/packages/cuda/package.py @@ -51,14 +51,14 @@ class Cuda(Package): homepage = "http://www.nvidia.com/object/cuda_home_new.html" version('8.0.44', '6dca912f9b7e2b7569b0074a41713640', expand=False, - url="file://%s/cuda_8.0.44_linux.run" % os.getcwd()) + url="https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda_8.0.44_linux-run") version('7.5.18', '4b3bcecf0dfc35928a0898793cf3e4c6', expand=False, - url="file://%s/cuda_7.5.18_linux.run" % os.getcwd()) + url="http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run") version('6.5.14', '90b1b8f77313600cc294d9271741f4da', expand=False, - url="file://%s/cuda_6.5.14_linux_64.run" % os.getcwd()) + url="http://developer.download.nvidia.com/compute/cuda/6_5/rel/installers/cuda_6.5.14_linux_64.run") def install(self, spec, prefix): - runfile = glob(os.path.join(self.stage.path, 'cuda*.run'))[0] + runfile = glob(os.path.join(self.stage.path, 'cuda*run'))[0] chmod = which('chmod') chmod('+x', runfile) runfile = which(runfile) diff --git a/var/spack/repos/builtin/packages/elemental/package.py b/var/spack/repos/builtin/packages/elemental/package.py new file mode 100644 index 00000000000..625f0a1e3eb --- /dev/null +++ b/var/spack/repos/builtin/packages/elemental/package.py @@ -0,0 +1,136 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class Elemental(CMakePackage): + """Elemental: Distributed-memory dense and sparse-direct linear algebra + and optimization library.""" + + homepage = "http://libelemental.org" + url = "https://github.com/elemental/Elemental/archive/v0.87.6.tar.gz" + + version('0.87.6', '9fd29783d45b0a0e27c0df85f548abe9') + + variant('debug', default=False, + description='Builds a debug version of the libraries') + variant('shared', default=True, + description='Enables the build of shared libraries') + variant('hybrid', default=True, + description='Make use of OpenMP within MPI packing/unpacking') + variant('openmp_blas', default=False, + description='Use OpenMP for threading in the BLAS library') + variant('c', default=False, + description='Build C interface') + variant('python', default=False, + description='Install Python interface') + variant('parmetis', default=False, + description='Enable ParMETIS') + variant('quad', default=False, + description='Enable quad precision') + variant('int64', default=False, + description='Use 64bit integers') + # When this variant is set remove the normal dependencies since + # Elemental has to build BLAS and ScaLAPACK internally + variant('int64_blas', default=False, + description='Use 64bit integers for BLAS.' + ' Requires local build of BLAS library.') + variant('scalapack', default=False, + description='Build with ScaLAPACK library') + + depends_on('cmake', type='build') + # Note that this forces us to use OpenBLAS until #1712 is fixed + depends_on('blas', when='~openmp_blas ~int64_blas') + # Hack to forward variant to openblas package + # Allow Elemental to build internally when using 8-byte ints + depends_on('openblas +openmp', when='+openmp_blas ~int64_blas') + # Note that this forces us to use OpenBLAS until #1712 is fixed + depends_on('lapack', when='~openmp_blas') + depends_on('metis') + depends_on('metis +int64', when='+int64') + depends_on('mpi') + # Allow Elemental to build internally when using 8-byte ints + depends_on('scalapack', when='+scalapack ~int64_blas') + extends('python', when='+python') + depends_on('python@:2.8', when='+python') + + @property + def elemental_libs(self): + shared = True if '+shared' in self.spec else False + return find_libraries( + ['libEl'], root=self.prefix, shared=shared, recurse=True + ) + + def build_type(self): + """Returns the correct value for the ``CMAKE_BUILD_TYPE`` variable + :return: value for ``CMAKE_BUILD_TYPE`` + """ + if '+debug' in self.spec: + return 'Debug' + else: + return 'Release' + + def cmake_args(self): + spec = self.spec + args = [ + '-DCMAKE_INSTALL_MESSAGE:STRING=LAZY', + '-DEL_PREFER_OPENBLAS:BOOL=TRUE', + '-DEL_DISABLE_SCALAPACK:BOOL=%s' % ('~scalapack' in spec), + '-DGFORTRAN_LIB=libgfortran.so', + '-DBUILD_SHARED_LIBS:BOOL=%s' % ('+shared' in spec), + '-DEL_HYBRID:BOOL=%s' % ('+hybrid' in spec), + '-DEL_C_INTERFACE:BOOL=%s' % ('+c' in spec), + '-DINSTALL_PYTHON_PACKAGE:BOOL=%s' % ('+python' in spec), + '-DEL_DISABLE_PARMETIS:BOOL=%s' % ('~parmetis' in spec), + '-DEL_DISABLE_QUAD:BOOL=%s' % ('~quad' in spec), + '-DEL_USE_64BIT_INTS:BOOL=%s' % ('+int64' in spec), + '-DEL_USE_64BIT_BLAS_INTS:BOOL=%s' % ('+int64_blas' in spec)] + + # If using 64bit int BLAS libraries, elemental has to build + # them internally + if '+int64_blas' in spec: + args.extend(['-DEL_BLAS_SUFFIX:STRING={0}'.format(( + '_64_' if '+int64_blas' in spec else '_')), + '-DCUSTOM_BLAS_SUFFIX:BOOL=TRUE']), + if '+scalapack' in spec: + args.extend(['-DEL_LAPACK_SUFFIX:STRING={0}'.format(( + '_64_' if '+int64_blas' in spec else '_')), + '-DCUSTOM_LAPACK_SUFFIX:BOOL=TRUE']), + else: + math_libs = (spec['lapack'].lapack_libs + + spec['blas'].blas_libs) + + if '+scalapack' in spec: + math_libs = spec['scalapack'].scalapack_libs + math_libs + + args.extend([ + '-DMATH_LIBS:STRING={0}'.format(math_libs.search_flags), + '-DMATH_LIBS:STRING={0}'.format(math_libs.link_flags)]) + + if '+python' in spec: + args.extend([ + '-DPYTHON_SITE_PACKAGES:STRING={0}'.format(site_packages_dir)]) + + return args diff --git a/var/spack/repos/builtin/packages/es/package.py b/var/spack/repos/builtin/packages/es/package.py new file mode 100644 index 00000000000..80891b66006 --- /dev/null +++ b/var/spack/repos/builtin/packages/es/package.py @@ -0,0 +1,39 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class Es(AutotoolsPackage): + + """Es is an extensible shell. The language was derived from the Plan 9 + shell, rc, and was influenced by functional programming languages, + such as Scheme, and the Tcl embeddable programming language. This + implementation is derived from Byron Rakitzis's public domain + implementation of rc.""" + + homepage = "http://wryun.github.io/es-shell/" + url = "https://github.com/wryun/es-shell/releases/download/v0.9.1/es-0.9.1.tar.gz" + + version('0.9.1', 'bf4db55b47bcc99892468b2e0aec0c9e') diff --git a/var/spack/repos/builtin/packages/espressopp/package.py b/var/spack/repos/builtin/packages/espressopp/package.py index 2903a02f7de..06974a38d84 100644 --- a/var/spack/repos/builtin/packages/espressopp/package.py +++ b/var/spack/repos/builtin/packages/espressopp/package.py @@ -72,7 +72,7 @@ def cmake_args(self): return ['-DEXTERNAL_MPI4PY=ON', '-DEXTERNAL_BOOST=ON'] def build(self, spec, prefix): - with working_dir(self.build_directory()): + with working_dir(self.build_directory): make() if '+ug' in spec: make("ug", parallel=False) diff --git a/var/spack/repos/builtin/packages/fftw/package.py b/var/spack/repos/builtin/packages/fftw/package.py index 9b40d10fe0e..e35a1c92c33 100644 --- a/var/spack/repos/builtin/packages/fftw/package.py +++ b/var/spack/repos/builtin/packages/fftw/package.py @@ -38,6 +38,7 @@ class Fftw(Package): version('3.3.5', '6cc08a3b9c7ee06fdd5b9eb02e06f569') version('3.3.4', '2edab8c06b24feeb3b82bbb3ebf3e7b3') + version('2.1.5', '8d16a84f3ca02a785ef9eb36249ba433') patch('pfft-3.3.5.patch', when="@3.3.5+pfft_patches", level=0) patch('pfft-3.3.4.patch', when="@3.3.4+pfft_patches", level=0) @@ -62,17 +63,19 @@ class Fftw(Package): depends_on('automake', type='build', when='+pfft_patches') depends_on('autoconf', type='build', when='+pfft_patches') - # TODO : add support for architecture specific optimizations as soon as - # targets are supported - def install(self, spec, prefix): + # Base options options = [ '--prefix={0}'.format(prefix), '--enable-shared', '--enable-threads' ] + if not self.compiler.f77 or not self.compiler.fc: + options.append("--disable-fortran") + if spec.satisfies('@:2'): + options.append('--enable-type-prefix') - # Add support for OpenMP + # Variants that affect every precision if '+openmp' in spec: # Note: Apple's Clang does not support OpenMP. if spec.satisfies('%clang'): @@ -80,40 +83,45 @@ def install(self, spec, prefix): if ver.endswith('-apple'): raise InstallError("Apple's clang does not support OpenMP") options.append('--enable-openmp') - if not self.compiler.f77 or not self.compiler.fc: - options.append("--disable-fortran") + if spec.satisfies('@:2'): + # TODO: libtool strips CFLAGS, so 2.x libxfftw_threads + # isn't linked to the openmp library. Patch Makefile? + options.insert(0, 'CFLAGS=' + self.compiler.openmp_flag) if '+mpi' in spec: options.append('--enable-mpi') - if '+pfft_patches' in spec: autoreconf = which('autoreconf') autoreconf('-ifv') + # SIMD support + # TODO: add support for more architectures float_options = [] double_options = [] - if 'x86_64' in spec.architecture: + if 'x86_64' in spec.architecture and spec.satisfies('@3:'): float_options.append('--enable-sse2') double_options.append('--enable-sse2') + # Build double precision configure(*(options + double_options)) make() if self.run_tests: make("check") make("install") + # Build float/long double/quad variants if '+float' in spec: configure('--enable-float', *(options + float_options)) make() if self.run_tests: make("check") make("install") - if '+long_double' in spec: + if spec.satisfies('@3:+long_double'): configure('--enable-long-double', *options) make() if self.run_tests: make("check") make("install") - if '+quad' in spec: + if spec.satisfies('@3:+quad'): configure('--enable-quad-precision', *options) make() if self.run_tests: diff --git a/var/spack/repos/builtin/packages/flex/package.py b/var/spack/repos/builtin/packages/flex/package.py index 0314950140f..8f0c46bc56e 100644 --- a/var/spack/repos/builtin/packages/flex/package.py +++ b/var/spack/repos/builtin/packages/flex/package.py @@ -44,7 +44,7 @@ class Flex(AutotoolsPackage): depends_on('help2man', type='build') # Older tarballs don't come with a configure script - depends_on('m4', type='build', when='@:2.6.0') + depends_on('m4', type='build') depends_on('autoconf', type='build', when='@:2.6.0') depends_on('automake', type='build', when='@:2.6.0') depends_on('libtool', type='build', when='@:2.6.0') diff --git a/var/spack/repos/builtin/packages/git/package.py b/var/spack/repos/builtin/packages/git/package.py index c7b239ef122..a0a0879382e 100644 --- a/var/spack/repos/builtin/packages/git/package.py +++ b/var/spack/repos/builtin/packages/git/package.py @@ -33,6 +33,7 @@ class Git(Package): homepage = "http://git-scm.com" url = "https://github.com/git/git/tarball/v2.7.1" + version('2.11.1', '2cf960f19e56f27248816809ae896794') version('2.11.0', 'c63fb83b86431af96f8e9722ebb3ca01') version('2.9.3', 'b0edfc0f3cb046aec7ed68a4b7282a75') version('2.9.2', '3ff8a9b30fd5c99a02e6d6585ab543fc') diff --git a/var/spack/repos/builtin/packages/glib/package.py b/var/spack/repos/builtin/packages/glib/package.py index e2eb984876c..cede9ae0ae8 100644 --- a/var/spack/repos/builtin/packages/glib/package.py +++ b/var/spack/repos/builtin/packages/glib/package.py @@ -41,6 +41,7 @@ class Glib(AutotoolsPackage): depends_on('autoconf', type='build') depends_on('automake', type='build') depends_on('libtool', type='build') + depends_on('m4', type='build') depends_on('pkg-config+internal_glib', type='build') depends_on('libffi') depends_on('zlib') diff --git a/var/spack/repos/builtin/packages/go/package.py b/var/spack/repos/builtin/packages/go/package.py index ad1436c0c37..8d7596eee40 100644 --- a/var/spack/repos/builtin/packages/go/package.py +++ b/var/spack/repos/builtin/packages/go/package.py @@ -42,6 +42,11 @@ # # - on CentOS 7 systems (and possibly others) you need to have the # glibc package installed or various static cgo tests fail. +# +# - When building on a *large* machine (144 cores, 1.5TB RAM) I need +# to run `ulimit -u 8192` to bump up the max number of user processes. +# Failure to do so results in an explosion in one of the tests and an +# epic stack trace.... class Go(Package): @@ -51,6 +56,7 @@ class Go(Package): extendable = True + version('1.7.5', '506de2d870409e9003e1440bcfeb3a65') version('1.7.4', '49c1076428a5d3b5ad7ac65233fcca2f') version('1.6.4', 'b023240be707b34059d2c114d3465c92') @@ -67,7 +73,8 @@ class Go(Package): patch('time_test.patch', when='@1.6.4:1.7.4') # https://github.com/golang/go/issues/17986 - patch('misc-cgo-testcshared.patch', level=0, when='@1.6.4:1.7.4') + # The fix for this issue has been merged into the 1.8 tree. + patch('misc-cgo-testcshared.patch', level=0, when='@1.6.4:1.7.5') # NOTE: Older versions of Go attempt to download external files that have # since been moved while running the test suite. This patch modifies the diff --git a/var/spack/repos/builtin/packages/hunspell/package.py b/var/spack/repos/builtin/packages/hunspell/package.py new file mode 100644 index 00000000000..4e4cdce9487 --- /dev/null +++ b/var/spack/repos/builtin/packages/hunspell/package.py @@ -0,0 +1,39 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class Hunspell(AutotoolsPackage): + """The most popular spellchecking library (sez the author...).""" + + homepage = "http://hunspell.github.io/" + url = "https://github.com/hunspell/hunspell/archive/v1.6.0.tar.gz" + + version('1.6.0', '047c3feb121261b76dc16cdb62f54483') + + depends_on('autoconf', type='build') + depends_on('automake', type='build') + depends_on('libtool', type='build') + depends_on('m4', type='build') diff --git a/var/spack/repos/builtin/packages/intel-mkl/package.py b/var/spack/repos/builtin/packages/intel-mkl/package.py index f369e10d38c..1d7ea1ee898 100644 --- a/var/spack/repos/builtin/packages/intel-mkl/package.py +++ b/var/spack/repos/builtin/packages/intel-mkl/package.py @@ -55,8 +55,8 @@ class IntelMkl(IntelInstaller): # virtual dependency provides('blas') provides('lapack') + provides('scalapack') provides('mkl') - # TODO: MKL also provides implementation of Scalapack. @property def blas_libs(self): @@ -83,6 +83,34 @@ def blas_libs(self): def lapack_libs(self): return self.blas_libs + @property + def scalapack_libs(self): + libnames = ['libmkl_scalapack'] + if self.spec.satisfies('^openmpi'): + libnames.append('libmkl_blacs_openmpi') + elif self.spec.satisfies('^mpich@1'): + libnames.append('libmkl_blacs') + elif self.spec.satisfies('^mpich@2:'): + libnames.append('libmkl_blacs_intelmpi') + elif self.spec.satisfies('^mvapich2'): + libnames.append('libmkl_blacs_intelmpi') + elif self.spec.satisfies('^mpt'): + libnames.append('libmkl_blacs_sgimpt') + # TODO: ^intel-parallel-studio can mean intel mpi, a compiler or a lib + # elif self.spec.satisfies('^intel-parallel-studio'): + # libnames.append('libmkl_blacs_intelmpi') + else: + raise InstallError("No MPI found for scalapack") + + shared = True if '+shared' in self.spec else False + integer = 'ilp64' if '+ilp64' in self.spec else 'lp64' + libs = find_libraries( + ['{0}_{1}'.format(l, integer) for l in libnames], + root=join_path(self.prefix.lib, 'intel64'), + shared=shared + ) + return libs + def install(self, spec, prefix): self.intel_prefix = os.path.join(prefix, "pkg") IntelInstaller.install(self, spec, prefix) diff --git a/var/spack/repos/builtin/packages/intel-parallel-studio/package.py b/var/spack/repos/builtin/packages/intel-parallel-studio/package.py index 941ef9befbe..fbafb4fb0d2 100644 --- a/var/spack/repos/builtin/packages/intel-parallel-studio/package.py +++ b/var/spack/repos/builtin/packages/intel-parallel-studio/package.py @@ -77,7 +77,7 @@ class IntelParallelStudio(IntelInstaller): # virtual dependency provides('blas', when='+mkl') provides('lapack', when='+mkl') - # TODO: MKL also provides implementation of Scalapack. + provides('scalapack', when='+mkl') @property def blas_libs(self): @@ -104,6 +104,34 @@ def blas_libs(self): def lapack_libs(self): return self.blas_libs + @property + def scalapack_libs(self): + libnames = ['libmkl_scalapack'] + if self.spec.satisfies('^openmpi'): + libnames.append('libmkl_blacs_openmpi') + elif self.spec.satisfies('^mpich@1'): + libnames.append('libmkl_blacs') + elif self.spec.satisfies('^mpich@2:'): + libnames.append('libmkl_blacs_intelmpi') + elif self.spec.satisfies('^mvapich2'): + libnames.append('libmkl_blacs_intelmpi') + elif self.spec.satisfies('^mpt'): + libnames.append('libmkl_blacs_sgimpt') + # TODO: ^intel-parallel-studio can mean intel mpi, a compiler or a lib + # elif self.spec.satisfies('^intel-parallel-studio'): + # libnames.append('libmkl_blacs_intelmpi') + else: + raise InstallError("No MPI found for scalapack") + + shared = True if '+shared' in self.spec else False + integer = 'ilp64' if '+ilp64' in self.spec else 'lp64' + libs = find_libraries( + ['{0}_{1}'.format(l, integer) for l in libnames], + root=join_path(self.prefix, 'mkl', 'lib', 'intel64'), + shared=shared + ) + return libs + def url_for_version(self, version): """Assume the tarball is in the current directory.""" diff --git a/var/spack/repos/builtin/packages/lammps/Makefile.inc b/var/spack/repos/builtin/packages/lammps/Makefile.inc new file mode 100644 index 00000000000..6986a255b7e --- /dev/null +++ b/var/spack/repos/builtin/packages/lammps/Makefile.inc @@ -0,0 +1,49 @@ +SHELL = /bin/sh + +# --------------------------------------------------------------------- +# build rules and dependencies +# do not edit this section + +include Makefile.package.settings +include Makefile.package + +EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) +EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) +EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB) +EXTRA_CPP_DEPENDS = $(PKG_CPP_DEPENDS) +EXTRA_LINK_DEPENDS = $(PKG_LINK_DEPENDS) + +# Path to src files + +vpath %.cpp .. +vpath %.h .. + +# Link target + +$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) + $(SIZE) $(EXE) + +# Library targets + +lib: $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) + +shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + +# Compilation rules + +%.o:%.cpp + $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< + +# Individual dependencies + +depend : fastdep.exe $(SRC) + @./fastdep.exe $(EXTRA_INC) -- $^ > .depend || exit 1 + +fastdep.exe: ../DEPEND/fastdep.c + cc -O -o $@ $< + +sinclude .depend diff --git a/var/spack/repos/builtin/packages/lammps/package.py b/var/spack/repos/builtin/packages/lammps/package.py new file mode 100644 index 00000000000..d7c41f2e2e2 --- /dev/null +++ b/var/spack/repos/builtin/packages/lammps/package.py @@ -0,0 +1,207 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# +# Please also see the LICENSE file for our notice and the LGPL. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * +import os +import string +import datetime as dt + + +class Lammps(MakefilePackage): + """LAMMPS stands for Large-scale Atomic/Molecular Massively + Parallel Simulator.""" + homepage = "http://lammps.sandia.gov/" + url = "https://github.com/lammps/lammps/archive/stable_17Nov2016.tar.gz" + + version('2016.11.17', '8aecc58a39f9775203517c62a592d13b') + + def url_for_version(self, version): + vdate = dt.datetime.strptime(str(version), "%Y.%m.%d") + return "https://github.com/lammps/lammps/archive/stable_{0}.tar.gz".format( + vdate.strftime("%d%b%Y")) + + supported_packages = ['voronoi', 'rigid', 'user-nc-dump', + 'user-atc', 'meam', 'manybody'] + + for pkg in supported_packages: + variant(pkg, default=False, + description='Activate the {0} package'.format(pkg)) + variant('lib', default=True, + description='Build the liblammps in addition to the executable') + + depends_on('mpi') + depends_on('fftw') + depends_on('voropp', when='+voronoi') + depends_on('netcdf+mpi', when='+user-nc-dump') + depends_on('blas', when='+user-atc') + depends_on('lapack', when='+user-atc') + + def setup_environment(self, spack_env, run_env): + self.target_name = self.compiler.name + + def edit(self, spec, prefix): + config = [] + + config.append('CC = c++') + if self.compiler.name == 'intel': + # This is taken from MAKE/OPTIONS/Makefile.intel_cpu_intelmpi + config.append('OPTFLAGS = -xHost -O2 -fp-model fast=2 -no-prec-div -qoverride-limits') # noqa: E501 + config.append('CCFLAGS = -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload -fno-alias -ansi-alias -restrict $(OPTFLAGS)') # noqa: E501 + config.append('LINKFLAGS = -qopenmp $(OPTFLAGS)') + else: + # This is taken from MAKE/OPTIONS/Makefile.g++ + config.append('OPTFLAGS = -O3') + config.append('CCFLAGS = -fopenmp') + config.append('LINKFLAGS = -fopenmp $(OPTFLAGS)') + + config.append('SHFLAGS = -fPIC') + config.append('DEPFLAGS = -M') + config.append('LINK = c++') + + config.append('LIB = ') + config.append('SIZE = size') + + config.append('ARCHIVE = ar') + config.append('ARFLAGS = -rc') + config.append('SHLIBFLAGS = -shared') + + config.append('LMP_INC = -DLAMMPS_GZIP') + + mpi_path = self.spec['mpi'].prefix.lib + mpi_inc = self.spec['mpi'].prefix.include + + config.append( + 'MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -I{0}'.format( + mpi_inc)) + config.append('MPI_PATH = -L{0}'.format(mpi_path)) + config.append('MPI_LIB = {0}'.format( + ' '.join(self.spec['mpi'].mpicxx_shared_libs))) + + config.append('FFT_INC = -DFFT_FFTW3 -L{0}'.format( + self.spec['fftw'].prefix.include)) + config.append('FFT_PATH = -L{0}'.format(self.spec['fftw'].prefix.lib)) + config.append('FFT_LIB = -lfftw3') + + config.append('JPG_INC = ') + config.append('JPG_PATH = ') + config.append('JPG_LIB = ') + + makefile_inc_template = \ + join_path(os.path.dirname(self.module.__file__), + 'Makefile.inc') + with open(makefile_inc_template, "r") as fhr: + config.extend(fhr.read().split('\n')) + + with working_dir('src/MAKE/'): + with open('Makefile.{0}'.format(self.target_name), 'w') as fh: + fh.write('\n'.join(config)) + + def build_meam(self): + with working_dir('lib/meam'): + filter_file(r'EXTRAMAKE = Makefile.lammps.ifort', + 'EXTRAMAKE = Makefile.lammps.spack', + 'Makefile.ifort') + filter_file('F90 = *ifort', + 'F90 = {0}'.format(self.compiler.fc), + 'Makefile.ifort') + + with open('Makefile.lammps.spack', 'w') as fh: + syslib = '' + syspath = '' + if self.compiler.name == 'gcc': + syslib = '-lgfortran' + elif self.compiler.name == 'intel': + syslib = '-lifcore' + + makefile = ['meam_SYSINC =', + 'meam_SYSLIB = {0}'.format(syslib), + 'meam_SYSPATH = {0}'.format(syspath)] + + fh.write('\n'.join(makefile)) + + make('lib', '-f', 'Makefile.ifort') + + def build_user_atc(self): + with working_dir('lib/atc'): + filter_file(r'CC =.*', + 'CC = {0}'.format(self.compiler.cxx), + 'Makefile.icc') + + mpi_include = self.spec['mpi'].prefix.include + + filter_file(r'CCFLAGS = *', + 'CCFLAGS = -I{0} '.format(mpi_include), + 'Makefile.icc') + + filter_file('LINK =.*', + 'LINK = {0}'.format(self.compiler.cxx), + 'Makefile.icc') + + make('lib', '-f', 'Makefile.icc') + with open('Makefile.lammps', 'w') as fh: + lapack_blas = (self.spec['lapack'].lapack_libs + + self.spec['blas'].blas_libs) + makefile = [ + 'user-atc_SYSINC =', + 'user-atc_SYSLIB = {0}'.format(lapack_blas.ld_flags), + 'user-atc_SYSPATH = '] + fh.write('\n'.join(makefile)) + + def build_voronoi(self): + # no need to set the voronoi_SYS variable in Makefile.lammps + # since the spack wrapper takes care of the path + with working_dir('src/VORONOI'): + filter_file(r'#include "voro\+\+\.hh"', + '#include ', + 'compute_voronoi_atom.h') + + def build(self, spec, prefix): + for pkg in self.supported_packages: + _build_pkg_name = string.replace('build_{0}'.format(pkg), '-', '_') + if hasattr(self, _build_pkg_name): + _build_pkg = getattr(self, _build_pkg_name) + _build_pkg() + + with working_dir('src'): + for pkg in self.supported_packages: + if '+{0}'.format(pkg) in spec: + make('yes-{0}'.format(pkg)) + + make(self.target_name) + + if '+lib' in spec: + make('mode=shlib', self.target_name) + + def install(self, spec, prefix): + with working_dir('src'): + mkdirp(prefix.bin) + install('lmp_{0}'.format(self.target_name), prefix.bin) + + if '+lib' in spec: + mkdirp(prefix.lib) + install('liblammps_{0}.{1}'.format(self.target_name, + dso_suffix), prefix.lib) + + # TODO: install the necessary headers + mkdirp(prefix.include) diff --git a/var/spack/repos/builtin/packages/llvm-openmp-ompt/package.py b/var/spack/repos/builtin/packages/llvm-openmp-ompt/package.py new file mode 100644 index 00000000000..8b83f216b60 --- /dev/null +++ b/var/spack/repos/builtin/packages/llvm-openmp-ompt/package.py @@ -0,0 +1,62 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## + +from spack import * + + +class LlvmOpenmpOmpt(Package): + """The OpenMP subproject provides an OpenMP runtime for use with the + OpenMP implementation in Clang. This branch includes experimental + changes for OMPT, the OpenMP Tools interface""" + + homepage = "https://github.com/OpenMPToolsInterface/LLVM-openmp" + + # align-to-tr-rebased branch + version('3.9.2b', + git='https://github.com/OpenMPToolsInterface/LLVM-openmp.git', + commit='982a08bcf3df9fb5afc04ac3bada47f19cc4e3d3') + + depends_on('cmake', type='build') + depends_on('llvm+clang~gold') + depends_on('ninja', type='build') + + def install(self, spec, prefix): + + with working_dir('spack-build', create=True): + cmake_args = std_cmake_args[:] + cmake_args.extend([ + '-G', 'Ninja', + '-DCMAKE_C_COMPILER=clang', + '-DCMAKE_CXX_COMPILER=clang++', + '-DCMAKE_BUILD_TYPE=Release', + '-DLIBOMP_OMPT_SUPPORT=on', + '-DLIBOMP_OMPT_BLAME=on', + '-DLIBOMP_OMPT_TRACE=on' + ]) + + cmake('..', *cmake_args) + ninja = Executable('ninja') + ninja() + ninja('install') diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index 06572ea3121..1da14feb4f4 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -77,6 +77,7 @@ class Llvm(Package): # Universal dependency depends_on('python@2.7:2.8') # Seems not to support python 3.X.Y + depends_on('py-lit') # lldb dependencies depends_on('ncurses', when='+lldb') @@ -98,46 +99,55 @@ class Llvm(Package): 'url': base_url % {'pkg': 'compiler-rt'}, 'destination': 'projects', 'placement': 'compiler-rt', + 'variant': '+compiler-rt', }, 'openmp': { 'url': base_url % {'pkg': 'openmp'}, 'destination': 'projects', 'placement': 'openmp', + 'variant': '+clang', }, 'libcxx': { 'url': base_url % {'pkg': 'libcxx'}, 'destination': 'projects', 'placement': 'libcxx', + 'variant': '+libcxx', }, 'libcxxabi': { 'url': base_url % {'pkg': 'libcxxabi'}, 'destination': 'projects', 'placement': 'libcxxabi', + 'variant': '+libcxx', }, 'cfe': { 'url': base_url % {'pkg': 'cfe'}, 'destination': 'tools', 'placement': 'clang', + 'variant': '+clang', }, 'clang-tools-extra': { 'url': base_url % {'pkg': 'clang-tools-extra'}, 'destination': 'tools/clang/tools', 'placement': 'extra', + 'variant': '+clang', }, 'lldb': { 'url': base_url % {'pkg': 'lldb'}, 'destination': 'tools', 'placement': 'lldb', + 'variant': '+lldb', }, 'polly': { 'url': base_url % {'pkg': 'polly'}, 'destination': 'tools', 'placement': 'polly', + 'variant': '+polly', }, - 'llvm-libunwind': { + 'libunwind': { 'url': base_url % {'pkg': 'libunwind'}, 'destination': 'projects', 'placement': 'libunwind', + 'variant': '+internal_unwind', }, } releases = [ @@ -153,9 +163,24 @@ class Llvm(Package): 'cfe': 'http://llvm.org/svn/llvm-project/cfe/trunk', 'clang-tools-extra': 'http://llvm.org/svn/llvm-project/clang-tools-extra/trunk', 'lldb': 'http://llvm.org/svn/llvm-project/lldb/trunk', - 'llvm-libunwind': 'http://llvm.org/svn/llvm-project/libunwind/trunk', + 'libunwind': 'http://llvm.org/svn/llvm-project/libunwind/trunk', } }, + { + 'version': '3.9.1', + 'md5': '3259018a7437e157f3642df80f1983ea', + 'resources': { + 'compiler-rt': 'aadc76e7e180fafb10fb729444e287a3', + 'openmp': 'f076916bf2f49229b4df9fa0bb002599', + 'polly': '2cc7fe2bd9539775ba140abfd375bec6', + 'libcxx': '75a3214224301fc543fa6a38bdf7efe0', + 'libcxxabi': '62fd584b38cc502172c2ffab041b5fcc', + 'cfe': '45713ec5c417ed9cad614cd283d786a1', + 'clang-tools-extra': '1a01d545a064fcbc46a2f05f6880d3d7', + 'lldb': '91399402f287d3f637db1207113deecb', + 'libunwind': 'f273dd0ed638ad0601b23176a36f187b', + } + }, { 'version': '3.9.0', 'md5': 'f2093e98060532449eb7d2fcfd0bc6c6', @@ -168,7 +193,7 @@ class Llvm(Package): 'cfe': '29e1d86bee422ab5345f5e9fb808d2dc', 'clang-tools-extra': 'f4f663068c77fc742113211841e94d5e', 'lldb': '968d053c3c3d7297983589164c6999e9', - 'llvm-libunwind': '3e5c87c723a456be599727a444b1c166', + 'libunwind': '3e5c87c723a456be599727a444b1c166', } }, { @@ -183,7 +208,7 @@ class Llvm(Package): 'cfe': '4ff2f8844a786edb0220f490f7896080', 'clang-tools-extra': '6e49f285d0b366cc3cab782d8c92d382', 'lldb': '9e4787b71be8e432fffd31e13ac87623', - 'llvm-libunwind': 'd66e2387e1d37a8a0c8fe6a0063a3bab', + 'libunwind': 'd66e2387e1d37a8a0c8fe6a0063a3bab', } }, { @@ -198,7 +223,7 @@ class Llvm(Package): 'cfe': 'cc99e7019bb74e6459e80863606250c5', 'clang-tools-extra': 'c2344f50e0eea0b402f0092a80ddc036', 'lldb': 'a5da35ed9cc8c8817ee854e3dbfba00e', - 'llvm-libunwind': '162ade468607f153cca12be90b5194fa', + 'libunwind': '162ade468607f153cca12be90b5194fa', } }, { @@ -213,7 +238,7 @@ class Llvm(Package): 'cfe': '0acd026b5529164197563d135a8fd83e', 'clang-tools-extra': '5d49ff745037f061a7c86aeb6a24c3d2', 'lldb': 'a106d8a0d21fc84d76953822fbaf3398', - 'llvm-libunwind': '814bd52c9247c5d04629658fbcb3ab8c', + 'libunwind': '814bd52c9247c5d04629658fbcb3ab8c', } }, { @@ -228,7 +253,7 @@ class Llvm(Package): 'cfe': '8f9d27335e7331cf0a4711e952f21f01', 'clang-tools-extra': 'd5a87dacb65d981a427a536f6964642e', 'lldb': 'e5931740400d1dc3e7db4c7ba2ceff68', - 'llvm-libunwind': '9a75392eb7eb8ed5c0840007e212baf5', + 'libunwind': '9a75392eb7eb8ed5c0840007e212baf5', } }, { @@ -267,7 +292,8 @@ class Llvm(Package): resource(name=name, svn=repo, destination=resources[name]['destination'], - when='@%(version)s' % release, + when='@%s%s' % (release['version'], + resources[name].get('variant', "")), placement=resources[name].get('placement', None)) else: version(release['version'], release['md5'], url=llvm_url % release) @@ -277,7 +303,8 @@ class Llvm(Package): url=resources[name]['url'] % release, md5=md5, destination=resources[name]['destination'], - when='@%(version)s' % release, + when='@%s%s' % (release['version'], + resources[name].get('variant', "")), placement=resources[name].get('placement', None)) def install(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/maven/package.py b/var/spack/repos/builtin/packages/maven/package.py index c4e0a1d0a49..60c9e387cbb 100644 --- a/var/spack/repos/builtin/packages/maven/package.py +++ b/var/spack/repos/builtin/packages/maven/package.py @@ -30,7 +30,7 @@ class Maven(Package): """Apache Maven is a software project management and comprehension tool.""" homepage = "https://maven.apache.org/index.html" - url = "http://www.gtlib.gatech.edu/pub/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz" + url = "https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.tar.gz" version('3.3.9', '516923b3955b6035ba6b0a5b031fbd8b') diff --git a/var/spack/repos/builtin/packages/mpfr/package.py b/var/spack/repos/builtin/packages/mpfr/package.py index 5dc33b2fb98..09377804f66 100644 --- a/var/spack/repos/builtin/packages/mpfr/package.py +++ b/var/spack/repos/builtin/packages/mpfr/package.py @@ -31,6 +31,7 @@ class Mpfr(AutotoolsPackage): homepage = "http://www.mpfr.org" url = "https://gforge.inria.fr/frs/download.php/latestfile/159/mpfr-3.1.2.tar.bz2" + version('3.1.5', 'b1d23a55588e3b2a13e3be66bc69fd8d') version('3.1.4', 'b8a2f6b0e68bef46e53da2ac439e1cf4') version('3.1.3', '5fdfa3cfa5c86514ee4a241a1affa138') version('3.1.2', 'ee2c3ac63bf0c2359bf08fc3ee094c19') diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py index 34d3bd41c6f..f512ecf2ea2 100644 --- a/var/spack/repos/builtin/packages/netcdf/package.py +++ b/var/spack/repos/builtin/packages/netcdf/package.py @@ -33,7 +33,11 @@ class Netcdf(AutotoolsPackage): homepage = "http://www.unidata.ucar.edu/software/netcdf" url = "http://www.gfd-dennou.org/arch/netcdf/unidata-mirror/netcdf-4.3.3.tar.gz" + # Version 4.4.1.1 is having problems in tests + # https://github.com/Unidata/netcdf-c/issues/343 version('4.4.1.1', '503a2d6b6035d116ed53b1d80c811bda') + # netcdf@4.4.1 can crash on you (in real life and in tests). See: + # https://github.com/Unidata/netcdf-c/issues/282 version('4.4.1', '7843e35b661c99e1d49e60791d5072d8') version('4.4.0', 'cffda0cbd97fdb3a06e9274f7aef438e') version('4.3.3.1', '5c9dad3705a3408d27f696e5b31fb88c') diff --git a/var/spack/repos/builtin/packages/ocaml/package.py b/var/spack/repos/builtin/packages/ocaml/package.py index 855e2d7b3bc..75c19ec7c61 100644 --- a/var/spack/repos/builtin/packages/ocaml/package.py +++ b/var/spack/repos/builtin/packages/ocaml/package.py @@ -25,7 +25,7 @@ from spack import * -class Ocaml(AutotoolsPackage): +class Ocaml(Package): """OCaml is an industrial strength programming language supporting functional, imperative and object-oriented styles""" @@ -36,4 +36,8 @@ class Ocaml(AutotoolsPackage): depends_on('ncurses') - build_targets = ['world.opt'] + def install(self, spec, prefix): + configure('-prefix', '{0}'.format(prefix)) + + make('world.opt') + make('install') diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 3740923cf09..562ef22a096 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -63,6 +63,7 @@ class Openmpi(AutotoolsPackage): list_url = "http://www.open-mpi.org/software/ompi/" list_depth = 3 + version('2.0.2', 'ecd99aa436a1ca69ce936a96d6a3fa48') version('2.0.1', '6f78155bd7203039d2448390f3b51c96') version('2.0.0', 'cdacc800cb4ce690c1f1273cb6366674') version('1.10.3', 'e2fe4513200e2aaa1500b762342c674b') diff --git a/var/spack/repos/builtin/packages/perl/package.py b/var/spack/repos/builtin/packages/perl/package.py index d71a7492bad..ec0837e6a03 100644 --- a/var/spack/repos/builtin/packages/perl/package.py +++ b/var/spack/repos/builtin/packages/perl/package.py @@ -35,8 +35,9 @@ class Perl(Package): """Perl 5 is a highly capable, feature-rich programming language with over 27 years of development.""" homepage = "http://www.perl.org" - url = "http://www.cpan.org/src/5.0/perl-5.22.2.tar.gz" + url = "http://www.cpan.org/src/5.0/perl-5.24.1.tar.gz" + version('5.24.1', '765ef511b5b87a164e2531403ee16b3c') version('5.24.0', 'c5bf7f3285439a2d3b6a488e14503701') version('5.22.2', '5767e2a10dd62a46d7b57f74a90d952b') version('5.20.3', 'd647d0ea5a7a8194c34759ab9f2610cd') diff --git a/var/spack/repos/builtin/packages/protobuf/package.py b/var/spack/repos/builtin/packages/protobuf/package.py index 6faa0376ada..34d167b28c9 100644 --- a/var/spack/repos/builtin/packages/protobuf/package.py +++ b/var/spack/repos/builtin/packages/protobuf/package.py @@ -31,4 +31,10 @@ class Protobuf(AutotoolsPackage): homepage = "https://developers.google.com/protocol-buffers" url = "https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2" + version('3.0.2', '845b39e4b7681a2ddfd8c7f528299fbb', url='https://github.com/google/protobuf/archive/v3.0.2.tar.gz') version('2.5.0', 'a72001a9067a4c2c4e0e836d0f92ece4') + + depends_on('m4', when='@3.0.2:') + depends_on('autoconf', when='@3.0.2:') + depends_on('automake', when='@3.0.2:') + depends_on('libtool', when='@3.0.2:') diff --git a/var/spack/repos/builtin/packages/py-lit/package.py b/var/spack/repos/builtin/packages/py-lit/package.py new file mode 100644 index 00000000000..238d1b15001 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-lit/package.py @@ -0,0 +1,39 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class PyLit(PythonPackage): + """lit is a portable tool for executing LLVM and Clang style test suites, + summarizing their results, and providing indication of failures. lit is + designed to be a lightweight testing tool with as simple a user + interface as possible.""" + + homepage = "https://pypi.python.org/pypi/lit" + url = "https://pypi.python.org/packages/5b/a0/dbed2c8dfb220eb9a5a893257223cd0ff791c0fbc34ce2f1a957fa4b6c6f/lit-0.5.0.tar.gz" + + version('0.5.0', '8144660cc692be8fb903395a5f06564d') + + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-numpy/package.py b/var/spack/repos/builtin/packages/py-numpy/package.py index a48f5a19552..182616232e0 100644 --- a/var/spack/repos/builtin/packages/py-numpy/package.py +++ b/var/spack/repos/builtin/packages/py-numpy/package.py @@ -82,29 +82,12 @@ def patch(self): # differently. names = ','.join(lapackblas.names) dirs = ':'.join(lapackblas.directories) - # First, workout the defaults. - # The section title for the defaults changed in @1.10, see - # https://github.com/numpy/numpy/blob/master/site.cfg.example - if spec.satisfies('@:1.9.2'): - f.write('[DEFAULT]\n') - else: - f.write('[ALL]\n') - if not ('^openblas' in spec or - '^mkl' in spec or - '^atlas' in spec): - f.write('libraries=%s\n' % names) - f.write('library_dirs=%s\n' % dirs) - if not ((platform.system() == "Darwin") and - (platform.mac_ver()[0] == '10.12')): - f.write('rpath=%s\n' % ':'.join(lapackblas.directories)) - - # Now special treatment for some (!) BLAS/LAPACK. Note that + # Special treatment for some (!) BLAS/LAPACK. Note that # in this case library_dirs can not be specified within [ALL]. if '^openblas' in spec: f.write('[openblas]\n') f.write('libraries=%s\n' % names) - f.write('library_dirs=%s\n' % dirs) elif '^mkl' in spec: # numpy does not expect system libraries needed for MKL # here. @@ -123,8 +106,19 @@ def patch(self): # and using LD_LIBRARY_PATH throughout Spack. f.write('[mkl]\n') f.write('mkl_libs=%s\n' % 'mkl_rt') - f.write('library_dirs=%s\n' % dirs) elif '^atlas' in spec: f.write('[atlas]\n') f.write('atlas_libs=%s\n' % names) - f.write('library_dirs=%s\n' % dirs) + else: + # The section title for the defaults changed in @1.10, see + # https://github.com/numpy/numpy/blob/master/site.cfg.example + if spec.satisfies('@:1.9.2'): + f.write('[DEFAULT]\n') + else: + f.write('[ALL]\n') + f.write('libraries=%s\n' % names) + + f.write('library_dirs=%s\n' % dirs) + if not ((platform.system() == "Darwin") and + (platform.mac_ver()[0] == '10.12')): + f.write('rpath=%s\n' % dirs) diff --git a/var/spack/repos/builtin/packages/spark/package.py b/var/spack/repos/builtin/packages/spark/package.py index 84b63fa87f8..24dca5571df 100644 --- a/var/spack/repos/builtin/packages/spark/package.py +++ b/var/spack/repos/builtin/packages/spark/package.py @@ -33,7 +33,7 @@ class Spark(Package): """ homepage = "http://spark.apache.org" - url = "http://mirrors.ocf.berkeley.edu/apache/spark/spark-2.0.0/spark-2.0.0-bin-without-hadoop.tgz" + url = "http://archive.apache.org/dist/spark/spark-2.0.0/spark-2.0.0-bin-without-hadoop.tgz" variant('hadoop', default=False, description='Build with Hadoop') @@ -41,6 +41,8 @@ class Spark(Package): depends_on('jdk', type=('build', 'run')) depends_on('hadoop', when='+hadoop', type=('build', 'run')) + version('2.1.0', '21d4471e78250775b1fa7c0e6c3a1326') + version('2.0.2', '32110c1bb8f081359738742bd26bced1') version('2.0.0', '8a5307d973da6949a385aefb6ff747bb') version('1.6.2', '304394fbe2899211217f0cd9e9b2b5d9') version('1.6.1', 'fcf4961649f15af1fea78c882e65b001') diff --git a/var/spack/repos/builtin/packages/spectrum-mpi/package.py b/var/spack/repos/builtin/packages/spectrum-mpi/package.py new file mode 100644 index 00000000000..28ba423b9cc --- /dev/null +++ b/var/spack/repos/builtin/packages/spectrum-mpi/package.py @@ -0,0 +1,64 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at International Business Machines Corporation +# +# This file is part of Spack. +# Created by Serban Maerean, serban@us.ibm.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class SpectrumMpi(Package): + """ + IBM MPI implementation from Spectrum MPI. + + """ + + homepage = "http://www-03.ibm.com/systems/spectrum-computing/products/mpi" + + provides('mpi') + + def install(self, spec, prefix): + raise InstallError('IBM MPI is not installable; it is vendor supplied') + + def setup_dependent_package(self, module, dependent_spec): + # get the compiler names + if '%xl' in dependent_spec or '%xl_r' in dependent_spec: + self.spec.mpicc = join_path(self.prefix.bin, 'mpixlc') + self.spec.mpicxx = join_path(self.prefix.bin, 'mpixlC') + self.spec.mpif77 = join_path(self.prefix.bin, 'mpixlf') + self.spec.mpifc = join_path(self.prefix.bin, 'mpixlf') + else: + self.spec.mpicc = join_path(self.prefix.bin, 'mpicc') + self.spec.mpicxx = join_path(self.prefix.bin, 'mpicxx') + self.spec.mpif77 = join_path(self.prefix.bin, 'mpif77') + self.spec.mpifc = join_path(self.prefix.bin, 'mpif90') + + def setup_dependent_environment(self, spack_env, run_env, dependent_spec): + if '%xl' in dependent_spec or '%xl_r' in dependent_spec: + spack_env.set('MPICC', join_path(self.prefix.bin, 'mpixlc')) + spack_env.set('MPICXX', join_path(self.prefix.bin, 'mpixlC')) + spack_env.set('MPIF77', join_path(self.prefix.bin, 'mpixlf')) + spack_env.set('MPIF90', join_path(self.prefix.bin, 'mpixlf')) + else: + spack_env.set('MPICC', join_path(self.prefix.bin, 'mpicc')) + spack_env.set('MPICXX', join_path(self.prefix.bin, 'mpic++')) + spack_env.set('MPIF77', join_path(self.prefix.bin, 'mpif77')) + spack_env.set('MPIF90', join_path(self.prefix.bin, 'mpif90')) diff --git a/var/spack/repos/builtin/packages/tcl/package.py b/var/spack/repos/builtin/packages/tcl/package.py index a9bc3cceaab..31678caac6d 100644 --- a/var/spack/repos/builtin/packages/tcl/package.py +++ b/var/spack/repos/builtin/packages/tcl/package.py @@ -35,6 +35,7 @@ class Tcl(AutotoolsPackage): extensible.""" homepage = "http://www.tcl.tk" + version('8.6.6', '5193aea8107839a79df8ac709552ecb7') version('8.6.5', '0e6426a4ca9401825fbc6ecf3d89a326') version('8.6.4', 'd7cbb91f1ded1919370a30edd1534304') version('8.6.3', 'db382feca91754b7f93da16dc4cdad1f') diff --git a/var/spack/repos/builtin/packages/texlive/package.py b/var/spack/repos/builtin/packages/texlive/package.py index a960e5b68df..27f6c4c7166 100644 --- a/var/spack/repos/builtin/packages/texlive/package.py +++ b/var/spack/repos/builtin/packages/texlive/package.py @@ -41,7 +41,7 @@ class Texlive(Package): # digest values, but don't be surprised if this package is # briefly unbuildable. # - version('live', '01461ec2cc49fe0b14812eb67abbea46', + version('live', 'ad230fa814d122084c13d75c0b135fda', url="http://ctan.math.utah.edu/ctan/tex-archive/systems/texlive/tlnet/install-tl-unx.tar.gz") # There does not seem to be a complete list of schemes. @@ -59,9 +59,14 @@ class Texlive(Package): depends_on('perl', type='build') def install(self, spec, prefix): + # Using texlive's mirror system leads to mysterious problems, + # in lieu of being able to specify a repository as a variant, hardwire + # a particular (slow, but central) one for now. + _repository='http://ctan.math.washington.edu/tex-archive/systems/texlive/tlnet/' env = os.environ env['TEXLIVE_INSTALL_PREFIX'] = prefix perl = which('perl') scheme = spec.variants['scheme'].value perl('./install-tl', '-scheme', scheme, + '-repository', _repository, '-portable', '-profile', '/dev/null') diff --git a/var/spack/repos/builtin/packages/tk/package.py b/var/spack/repos/builtin/packages/tk/package.py index 66573eaa451..48fc32ebb97 100644 --- a/var/spack/repos/builtin/packages/tk/package.py +++ b/var/spack/repos/builtin/packages/tk/package.py @@ -34,6 +34,7 @@ class Tk(AutotoolsPackage): and more.""" homepage = "http://www.tcl.tk" + version('8.6.6', 'dd7dbb3a6523c42d05f6ab6e86096e99') version('8.6.5', '11dbbd425c3e0201f20d6a51482ce6c4') version('8.6.3', '85ca4dbf4dcc19777fd456f6ee5d0221') diff --git a/var/spack/repos/builtin/packages/voropp/package.py b/var/spack/repos/builtin/packages/voropp/package.py new file mode 100644 index 00000000000..0e39769927b --- /dev/null +++ b/var/spack/repos/builtin/packages/voropp/package.py @@ -0,0 +1,53 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class Voropp(MakefilePackage): + """Voro++ is a open source software library for the computation of the + Voronoi diagram, a widely-used tessellation that has applications in many + scientific fields.""" + + homepage = "http://math.lbl.gov/voro++/about.html" + + # This url is wrong but it passes the test the ++ make the url parser fail, + # the correct url is constructed by url_for_version that has to be used in + # any case due to the difference between the package name and the url + url = "http://math.lbl.gov/voropp/download/dir/voropp-0.4.6.tar.gz" + + version('0.4.6', '2338b824c3b7b25590e18e8df5d68af9') + + def url_for_version(self, version): + url = "http://math.lbl.gov/voro++/download/dir/voro++-{0}.tar.gz".format( # noqa: E501 + str(version)) + return url + + def edit(self, spec, prefix): + filter_file(r'CC=g\+\+', + 'CC={0}'.format(self.compiler.cxx), + 'config.mk') + filter_file(r'PREFIX=/usr/local', + 'PREFIX={0}'.format(self.prefix), + 'config.mk')