Merge branch 'develop' into features/shared

This commit is contained in:
Carson Woods
2020-01-27 15:28:28 -05:00
47 changed files with 559 additions and 343 deletions

View File

@@ -103,10 +103,10 @@ interpreter_f="${interpreter_v[0]}"
# Invoke any interpreter found, or raise an error if none was found. # Invoke any interpreter found, or raise an error if none was found.
if [[ -n "$interpreter_f" ]]; then if [[ -n "$interpreter_f" ]]; then
if [[ "${interpreter_f##*/}" = "perl" ]]; then if [[ "${interpreter_f##*/}" = "perl"* ]]; then
exec $interpreter_v -x "$@" exec $interpreter -x "$@"
else else
exec $interpreter_v "$@" exec $interpreter "$@"
fi fi
else else
echo "error: sbang found no interpreter in $script" echo "error: sbang found no interpreter in $script"

View File

@@ -929,11 +929,13 @@ in GNU Autotools. If all flags are set, the order is
Compiler environment variables and additional RPATHs Compiler environment variables and additional RPATHs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In the exceptional case a compiler requires setting special environment Sometimes compilers require setting special environment variables to
variables, like an explicit library load path. These can bet set in an operate correctly. Spack handles these cases by allowing custom environment
extra section in the compiler configuration (the supported environment modifications in the ``environment`` attribute of the compiler configuration
modification commands are: ``set``, ``unset``, ``append-path``, and section. See also the :ref:`configuration_environment_variables` section
``prepend-path``). The user can also specify additional ``RPATHs`` that the of the configuration files docs for more information.
It is also possible to specify additional ``RPATHs`` that the
compiler will add to all executables generated by that compiler. This is compiler will add to all executables generated by that compiler. This is
useful for forcing certain compilers to RPATH their own runtime libraries, so useful for forcing certain compilers to RPATH their own runtime libraries, so
that executables will run without the need to set ``LD_LIBRARY_PATH``. that executables will run without the need to set ``LD_LIBRARY_PATH``.
@@ -950,28 +952,19 @@ that executables will run without the need to set ``LD_LIBRARY_PATH``.
fc: /opt/gcc/bin/gfortran fc: /opt/gcc/bin/gfortran
environment: environment:
unset: unset:
BAD_VARIABLE: # The colon is required but the value must be empty - BAD_VARIABLE
set: set:
GOOD_VARIABLE_NUM: 1 GOOD_VARIABLE_NUM: 1
GOOD_VARIABLE_STR: good GOOD_VARIABLE_STR: good
prepend-path: prepend_path:
PATH: /path/to/binutils PATH: /path/to/binutils
append-path: append_path:
LD_LIBRARY_PATH: /opt/gcc/lib LD_LIBRARY_PATH: /opt/gcc/lib
extra_rpaths: extra_rpaths:
- /path/to/some/compiler/runtime/directory - /path/to/some/compiler/runtime/directory
- /path/to/some/other/compiler/runtime/directory - /path/to/some/other/compiler/runtime/directory
.. note::
The section `environment` is interpreted as an ordered dictionary, which
means two things. First, environment modification are applied in the order
they are specified in the configuration file. Second, you cannot express
environment modifications that require mixing different commands, i.e. you
cannot `set` one variable, than `prepend-path` to another one, and than
again `set` a third one.
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
Architecture specifiers Architecture specifiers
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^

View File

@@ -427,6 +427,33 @@ home directory, and ``~user`` will expand to a specified user's home
directory. The ``~`` must appear at the beginning of the path, or Spack directory. The ``~`` must appear at the beginning of the path, or Spack
will not expand it. will not expand it.
.. _configuration_environment_variables:
-------------------------
Environment Modifications
-------------------------
Spack allows to prescribe custom environment modifications in a few places
within its configuration files. Every time these modifications are allowed
they are specified as a dictionary, like in the following example:
.. code-block:: yaml
environment:
set:
LICENSE_FILE: '/path/to/license'
unset:
- CPATH
- LIBRARY_PATH
append_path:
PATH: '/new/bin/dir'
The possible actions that are permitted are ``set``, ``unset``, ``append_path``,
``prepend_path`` and finally ``remove_path``. They all require a dictionary
of variable names mapped to the values used for the modification.
The only exception is ``unset`` that requires just a list of variable names.
No particular order is ensured on the execution of each of these modifications.
---------------------------- ----------------------------
Seeing Spack's Configuration Seeing Spack's Configuration
---------------------------- ----------------------------

View File

@@ -663,7 +663,7 @@ def extract_tarball(spec, filename, allow_root=False, unsigned=False,
_cached_specs = None _cached_specs = None
def get_specs(force=False): def get_specs(force=False, use_arch=False):
""" """
Get spec.yaml's for build caches available on mirror Get spec.yaml's for build caches available on mirror
""" """
@@ -690,7 +690,13 @@ def get_specs(force=False):
for file in files: for file in files:
if re.search('spec.yaml', file): if re.search('spec.yaml', file):
link = url_util.join(fetch_url_build_cache, file) link = url_util.join(fetch_url_build_cache, file)
urls.add(link) if use_arch and re.search('%s-%s' %
(spack.architecture.platform,
spack.architecture.os),
file):
urls.add(link)
else:
urls.add(link)
else: else:
tty.msg("Finding buildcaches at %s" % tty.msg("Finding buildcaches at %s" %
url_util.format(fetch_url_build_cache)) url_util.format(fetch_url_build_cache))
@@ -698,7 +704,13 @@ def get_specs(force=False):
url_util.join(fetch_url_build_cache, 'index.html')) url_util.join(fetch_url_build_cache, 'index.html'))
for link in links: for link in links:
if re.search("spec.yaml", link): if re.search("spec.yaml", link):
urls.add(link) if use_arch and re.search('%s-%s' %
(spack.architecture.platform,
spack.architecture.os),
link):
urls.add(link)
else:
urls.add(link)
_cached_specs = [] _cached_specs = []
for link in urls: for link in urls:

View File

@@ -39,7 +39,6 @@
import sys import sys
import traceback import traceback
import types import types
from six import iteritems
from six import StringIO from six import StringIO
import llnl.util.tty as tty import llnl.util.tty as tty
@@ -52,6 +51,7 @@
import spack.config import spack.config
import spack.main import spack.main
import spack.paths import spack.paths
import spack.schema.environment
import spack.store import spack.store
from spack.util.string import plural from spack.util.string import plural
from spack.util.environment import ( from spack.util.environment import (
@@ -342,21 +342,7 @@ def set_build_environment_variables(pkg, env, dirty):
# Set environment variables if specified for # Set environment variables if specified for
# the given compiler # the given compiler
compiler = pkg.compiler compiler = pkg.compiler
environment = compiler.environment env.extend(spack.schema.environment.parse(compiler.environment))
for command, variable in iteritems(environment):
if command == 'set':
for name, value in iteritems(variable):
env.set(name, value)
elif command == 'unset':
for name, _ in iteritems(variable):
env.unset(name)
elif command == 'prepend-path':
for name, value in iteritems(variable):
env.prepend_path(name, value)
elif command == 'append-path':
for name, value in iteritems(variable):
env.append_path(name, value)
if compiler.extra_rpaths: if compiler.extra_rpaths:
extra_rpaths = ':'.join(compiler.extra_rpaths) extra_rpaths = ':'.join(compiler.extra_rpaths)

View File

@@ -56,6 +56,8 @@ def setup_parser(subparser):
'--print-file', action='store_true', '--print-file', action='store_true',
help="print the file name that would be edited") help="print the file name that would be edited")
sp.add_parser('list', help='list configuration sections')
def _get_scope_and_section(args): def _get_scope_and_section(args):
"""Extract config scope and section from arguments.""" """Extract config scope and section from arguments."""
@@ -83,7 +85,6 @@ def config_get(args):
With no arguments and an active environment, print the contents of With no arguments and an active environment, print the contents of
the environment's manifest file (spack.yaml). the environment's manifest file (spack.yaml).
""" """
scope, section = _get_scope_and_section(args) scope, section = _get_scope_and_section(args)
@@ -113,7 +114,6 @@ def config_edit(args):
With no arguments and an active environment, edit the spack.yaml for With no arguments and an active environment, edit the spack.yaml for
the active environment. the active environment.
""" """
scope, section = _get_scope_and_section(args) scope, section = _get_scope_and_section(args)
if not scope and not section: if not scope and not section:
@@ -127,8 +127,19 @@ def config_edit(args):
editor(config_file) editor(config_file)
def config_list(args):
"""List the possible configuration sections.
Used primarily for shell tab completion scripts.
"""
print(' '.join(list(spack.config.section_schemas)))
def config(parser, args): def config(parser, args):
action = {'get': config_get, action = {
'blame': config_blame, 'get': config_get,
'edit': config_edit} 'blame': config_blame,
'edit': config_edit,
'list': config_list,
}
action[args.config_command](args) action[args.config_command](args)

View File

@@ -23,7 +23,7 @@
from spack.version import VersionList from spack.version import VersionList
if sys.version_info > (3, 1): if sys.version_info > (3, 1):
from html import escape from html import escape # novm
else: else:
from cgi import escape from cgi import escape

View File

@@ -28,26 +28,24 @@
Each of the four classes needs to be sub-classed when implementing a new Each of the four classes needs to be sub-classed when implementing a new
module type. module type.
""" """
import collections
import copy import copy
import datetime import datetime
import inspect import inspect
import os.path import os.path
import re import re
import collections
import six
import llnl.util.filesystem import llnl.util.filesystem
import llnl.util.tty as tty import llnl.util.tty as tty
import spack.paths
import spack.build_environment as build_environment import spack.build_environment as build_environment
import spack.util.environment
import spack.tengine as tengine
import spack.util.path
import spack.util.environment
import spack.error import spack.error
import spack.util.spack_yaml as syaml import spack.paths
import spack.schema.environment
import spack.tengine as tengine
import spack.util.environment
import spack.util.file_permissions as fp import spack.util.file_permissions as fp
import spack.util.path
import spack.util.spack_yaml as syaml
#: config section for this file #: config section for this file
@@ -417,22 +415,7 @@ def env(self):
"""List of environment modifications that should be done in the """List of environment modifications that should be done in the
module. module.
""" """
env_mods = spack.util.environment.EnvironmentModifications() return spack.schema.environment.parse(self.conf.get('environment', {}))
actions = self.conf.get('environment', {})
def process_arglist(arglist):
if method == 'unset':
for x in arglist:
yield (x,)
else:
for x in six.iteritems(arglist):
yield x
for method, arglist in actions.items():
for args in process_arglist(arglist):
getattr(env_mods, method)(*args)
return env_mods
@property @property
def suffixes(self): def suffixes(self):

View File

@@ -1507,7 +1507,7 @@ def _update_explicit_entry_in_db(self, rec, explicit):
def try_install_from_binary_cache(self, explicit): def try_install_from_binary_cache(self, explicit):
tty.msg('Searching for binary cache of %s' % self.name) tty.msg('Searching for binary cache of %s' % self.name)
specs = binary_distribution.get_specs() specs = binary_distribution.get_specs(use_arch=True)
binary_spec = spack.spec.Spec.from_dict(self.spec.to_dict()) binary_spec = spack.spec.Spec.from_dict(self.spec.to_dict())
binary_spec._mark_concrete() binary_spec._mark_concrete()
if binary_spec not in specs: if binary_spec not in specs:

View File

@@ -8,7 +8,7 @@
.. literalinclude:: _spack_root/lib/spack/spack/schema/compilers.py .. literalinclude:: _spack_root/lib/spack/spack/schema/compilers.py
:lines: 13- :lines: 13-
""" """
import spack.schema.environment
#: Properties for inclusion in other schemas #: Properties for inclusion in other schemas
properties = { properties = {
@@ -68,50 +68,7 @@
{'type': 'boolean'} {'type': 'boolean'}
] ]
}, },
'environment': { 'environment': spack.schema.environment.definition,
'type': 'object',
'default': {},
'additionalProperties': False,
'properties': {
'set': {
'type': 'object',
'patternProperties': {
# Variable name
r'\w[\w-]*': {
'anyOf': [{'type': 'string'},
{'type': 'number'}]
}
}
},
'unset': {
'type': 'object',
'patternProperties': {
# Variable name
r'\w[\w-]*': {'type': 'null'}
}
},
'prepend-path': {
'type': 'object',
'patternProperties': {
# Variable name
r'\w[\w-]*': {
'anyOf': [{'type': 'string'},
{'type': 'number'}]
}
}
},
'append-path': {
'type': 'object',
'patternProperties': {
# Variable name
r'\w[\w-]*': {
'anyOf': [{'type': 'string'},
{'type': 'number'}]
}
}
}
}
},
'extra_rpaths': { 'extra_rpaths': {
'type': 'array', 'type': 'array',
'default': [], 'default': [],

View File

@@ -0,0 +1,58 @@
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Schema for environment modifications. Meant for inclusion in other
schemas.
"""
array_of_strings_or_num = {
'type': 'array', 'default': [], 'items':
{'anyOf': [{'type': 'string'}, {'type': 'number'}]}
}
dictionary_of_strings_or_num = {
'type': 'object', 'patternProperties':
{r'\w[\w-]*': {'anyOf': [{'type': 'string'}, {'type': 'number'}]}}
}
definition = {
'type': 'object',
'default': {},
'additionalProperties': False,
'properties': {
'set': dictionary_of_strings_or_num,
'unset': array_of_strings_or_num,
'prepend_path': dictionary_of_strings_or_num,
'append_path': dictionary_of_strings_or_num,
'remove_path': dictionary_of_strings_or_num
}
}
def parse(config_obj):
"""Returns an EnvironmentModifications object containing the modifications
parsed from input.
Args:
config_obj: a configuration dictionary conforming to the
schema definition for environment modifications
"""
import spack.util.environment as ev
try:
from collections import Sequence # novm
except ImportError:
from collections.abc import Sequence # novm
env = ev.EnvironmentModifications()
for command, variable in config_obj.items():
# Distinguish between commands that take only a name as argument
# (e.g. unset) and commands that take a name and a value.
if isinstance(variable, Sequence):
for name in variable:
getattr(env, command)(name)
else:
for name, value in variable.items():
getattr(env, command)(name, value)
return env

View File

@@ -8,6 +8,8 @@
.. literalinclude:: _spack_root/lib/spack/spack/schema/modules.py .. literalinclude:: _spack_root/lib/spack/spack/schema/modules.py
:lines: 13- :lines: 13-
""" """
import spack.schema.environment
#: Matches a spec or a multi-valued variant but not another #: Matches a spec or a multi-valued variant but not another
#: valid keyword. #: valid keyword.
@@ -66,17 +68,7 @@
} }
} }
}, },
'environment': { 'environment': spack.schema.environment.definition
'type': 'object',
'default': {},
'additionalProperties': False,
'properties': {
'set': dictionary_of_strings,
'unset': array_of_strings,
'prepend_path': dictionary_of_strings,
'append_path': dictionary_of_strings
}
}
} }
} }

View File

@@ -14,7 +14,6 @@
from spack.paths import build_env_path from spack.paths import build_env_path
from spack.build_environment import dso_suffix, _static_to_shared_library from spack.build_environment import dso_suffix, _static_to_shared_library
from spack.util.executable import Executable from spack.util.executable import Executable
from spack.util.spack_yaml import syaml_dict, syaml_str
from spack.util.environment import EnvironmentModifications from spack.util.environment import EnvironmentModifications
from llnl.util.filesystem import LibraryList, HeaderList from llnl.util.filesystem import LibraryList, HeaderList
@@ -65,6 +64,18 @@ def build_environment(working_env):
del os.environ[name] del os.environ[name]
@pytest.fixture
def ensure_env_variables(config, mock_packages, monkeypatch, working_env):
"""Returns a function that takes a dictionary and updates os.environ
for the test lifetime accordingly. Plugs-in mock config and repo.
"""
def _ensure(env_mods):
for name, value in env_mods.items():
monkeypatch.setenv(name, value)
return _ensure
def test_static_to_shared_library(build_environment): def test_static_to_shared_library(build_environment):
os.environ['SPACK_TEST_COMMAND'] = 'dump-args' os.environ['SPACK_TEST_COMMAND'] = 'dump-args'
@@ -119,79 +130,58 @@ def _set_wrong_cc(x):
assert os.environ['ANOTHER_VAR'] == 'THIS_IS_SET' assert os.environ['ANOTHER_VAR'] == 'THIS_IS_SET'
@pytest.mark.usefixtures('config', 'mock_packages') @pytest.mark.parametrize('initial,modifications,expected', [
def test_compiler_config_modifications(monkeypatch, working_env): # Set and unset variables
s = spack.spec.Spec('cmake') ({'SOME_VAR_STR': '', 'SOME_VAR_NUM': '0'},
s.concretize() {'set': {'SOME_VAR_STR': 'SOME_STR', 'SOME_VAR_NUM': 1}},
pkg = s.package {'SOME_VAR_STR': 'SOME_STR', 'SOME_VAR_NUM': '1'}),
({'SOME_VAR_STR': ''},
{'unset': ['SOME_VAR_STR']},
{'SOME_VAR_STR': None}),
({}, # Set a variable that was not defined already
{'set': {'SOME_VAR_STR': 'SOME_STR'}},
{'SOME_VAR_STR': 'SOME_STR'}),
# Append and prepend to the same variable
({'EMPTY_PATH_LIST': '/path/middle'},
{'prepend_path': {'EMPTY_PATH_LIST': '/path/first'},
'append_path': {'EMPTY_PATH_LIST': '/path/last'}},
{'EMPTY_PATH_LIST': '/path/first:/path/middle:/path/last'}),
# Append and prepend from empty variables
({'EMPTY_PATH_LIST': '', 'SOME_VAR_STR': ''},
{'prepend_path': {'EMPTY_PATH_LIST': '/path/first'},
'append_path': {'SOME_VAR_STR': '/path/last'}},
{'EMPTY_PATH_LIST': '/path/first', 'SOME_VAR_STR': '/path/last'}),
({}, # Same as before but on variables that were not defined
{'prepend_path': {'EMPTY_PATH_LIST': '/path/first'},
'append_path': {'SOME_VAR_STR': '/path/last'}},
{'EMPTY_PATH_LIST': '/path/first', 'SOME_VAR_STR': '/path/last'}),
# Remove a path from a list
({'EMPTY_PATH_LIST': '/path/first:/path/middle:/path/last'},
{'remove_path': {'EMPTY_PATH_LIST': '/path/middle'}},
{'EMPTY_PATH_LIST': '/path/first:/path/last'}),
({'EMPTY_PATH_LIST': '/only/path'},
{'remove_path': {'EMPTY_PATH_LIST': '/only/path'}},
{'EMPTY_PATH_LIST': ''}),
])
def test_compiler_config_modifications(
initial, modifications, expected, ensure_env_variables, monkeypatch
):
# Set the environment as per prerequisites
ensure_env_variables(initial)
os.environ['SOME_VAR_STR'] = '' # Monkeypatch a pkg.compiler.environment with the required modifications
os.environ['SOME_VAR_NUM'] = '0' pkg = spack.spec.Spec('cmake').concretized().package
os.environ['PATH_LIST'] = '/path/third:/path/forth' monkeypatch.setattr(pkg.compiler, 'environment', modifications)
os.environ['EMPTY_PATH_LIST'] = ''
os.environ.pop('NEW_PATH_LIST', None)
env_mod = syaml_dict() # Trigger the modifications
set_cmd = syaml_dict()
env_mod[syaml_str('set')] = set_cmd
set_cmd[syaml_str('SOME_VAR_STR')] = syaml_str('SOME_STR')
set_cmd[syaml_str('SOME_VAR_NUM')] = 1
monkeypatch.setattr(pkg.compiler, 'environment', env_mod)
spack.build_environment.setup_package(pkg, False) spack.build_environment.setup_package(pkg, False)
assert os.environ['SOME_VAR_STR'] == 'SOME_STR'
assert os.environ['SOME_VAR_NUM'] == str(1)
env_mod = syaml_dict() # Check they were applied
unset_cmd = syaml_dict() for name, value in expected.items():
env_mod[syaml_str('unset')] = unset_cmd if value is not None:
assert os.environ[name] == value
unset_cmd[syaml_str('SOME_VAR_STR')] = None continue
assert name not in os.environ
monkeypatch.setattr(pkg.compiler, 'environment', env_mod)
assert 'SOME_VAR_STR' in os.environ
spack.build_environment.setup_package(pkg, False)
assert 'SOME_VAR_STR' not in os.environ
env_mod = syaml_dict()
set_cmd = syaml_dict()
env_mod[syaml_str('set')] = set_cmd
append_cmd = syaml_dict()
env_mod[syaml_str('append-path')] = append_cmd
unset_cmd = syaml_dict()
env_mod[syaml_str('unset')] = unset_cmd
prepend_cmd = syaml_dict()
env_mod[syaml_str('prepend-path')] = prepend_cmd
set_cmd[syaml_str('EMPTY_PATH_LIST')] = syaml_str('/path/middle')
append_cmd[syaml_str('PATH_LIST')] = syaml_str('/path/last')
append_cmd[syaml_str('EMPTY_PATH_LIST')] = syaml_str('/path/last')
append_cmd[syaml_str('NEW_PATH_LIST')] = syaml_str('/path/last')
unset_cmd[syaml_str('SOME_VAR_NUM')] = None
prepend_cmd[syaml_str('PATH_LIST')] = syaml_str('/path/first:/path/second')
prepend_cmd[syaml_str('EMPTY_PATH_LIST')] = syaml_str('/path/first')
prepend_cmd[syaml_str('NEW_PATH_LIST')] = syaml_str('/path/first')
prepend_cmd[syaml_str('SOME_VAR_NUM')] = syaml_str('/8')
assert 'SOME_VAR_NUM' in os.environ
monkeypatch.setattr(pkg.compiler, 'environment', env_mod)
spack.build_environment.setup_package(pkg, False)
# Check that the order of modifications is respected and the
# variable was unset before it was prepended.
assert os.environ['SOME_VAR_NUM'] == '/8'
expected = '/path/first:/path/second:/path/third:/path/forth:/path/last'
assert os.environ['PATH_LIST'] == expected
expected = '/path/first:/path/middle:/path/last'
assert os.environ['EMPTY_PATH_LIST'] == expected
expected = '/path/first:/path/last'
assert os.environ['NEW_PATH_LIST'] == expected
@pytest.mark.regression('9107') @pytest.mark.regression('9107')

View File

@@ -91,3 +91,9 @@ def test_config_edit_fails_correctly_with_no_env(mutable_mock_env_path):
def test_config_get_fails_correctly_with_no_env(mutable_mock_env_path): def test_config_get_fails_correctly_with_no_env(mutable_mock_env_path):
output = config('get', fail_on_error=False) output = config('get', fail_on_error=False)
assert "requires a section argument or an active environment" in output assert "requires a section argument or an active environment" in output
def test_config_list():
output = config('list')
assert 'compilers' in output
assert 'packages' in output

View File

@@ -12,3 +12,6 @@ config:
verify_ssl: true verify_ssl: true
checksum: true checksum: true
dirty: false dirty: false
module_roots:
tcl: $spack/share/spack/modules
lmod: $spack/share/spack/lmod

View File

@@ -17,7 +17,6 @@
import llnl.util.tty as tty import llnl.util.tty as tty
import spack.util.executable as executable import spack.util.executable as executable
from spack.util.module_cmd import py_cmd
from llnl.util.lang import dedupe from llnl.util.lang import dedupe
@@ -919,8 +918,14 @@ def _source_single_file(file_and_args, environment):
source_file.extend(x for x in file_and_args) source_file.extend(x for x in file_and_args)
source_file = ' '.join(source_file) source_file = ' '.join(source_file)
dump_environment = 'PYTHONHOME="{0}" "{1}" -c "{2}"'.format( # If the environment contains 'python' use it, if not
sys.prefix, sys.executable, py_cmd) # go with sys.executable. Below we just need a working
# Python interpreter, not necessarily sys.executable.
python_cmd = executable.which('python3', 'python', 'python2')
python_cmd = python_cmd.name if python_cmd else sys.executable
dump_cmd = 'import os, json; print(json.dumps(dict(os.environ)))'
dump_environment = python_cmd + ' -c "{0}"'.format(dump_cmd)
# Try to source the file # Try to source the file
source_file_arguments = ' '.join([ source_file_arguments = ' '.join([

View File

@@ -18,7 +18,7 @@
# This list is not exhaustive. Currently we only use load and unload # This list is not exhaustive. Currently we only use load and unload
# If we need another option that changes the environment, add it here. # If we need another option that changes the environment, add it here.
module_change_commands = ['load', 'swap', 'unload', 'purge', 'use', 'unuse'] module_change_commands = ['load', 'swap', 'unload', 'purge', 'use', 'unuse']
py_cmd = 'import os; import json; print(json.dumps(dict(os.environ)))' py_cmd = "'import os;import json;print(json.dumps(dict(os.environ)))'"
# This is just to enable testing. I hate it but we can't find a better way # This is just to enable testing. I hate it but we can't find a better way
_test_mode = False _test_mode = False
@@ -32,8 +32,7 @@ def module(*args):
if args[0] in module_change_commands: if args[0] in module_change_commands:
# Do the module manipulation, then output the environment in JSON # Do the module manipulation, then output the environment in JSON
# and read the JSON back in the parent process to update os.environ # and read the JSON back in the parent process to update os.environ
module_cmd += ' > /dev/null; PYTHONHOME="{0}" "{1}" -c "{2}"'.format( module_cmd += ' >/dev/null;' + sys.executable + ' -c %s' % py_cmd
sys.prefix, sys.executable, py_cmd)
module_p = subprocess.Popen(module_cmd, module_p = subprocess.Popen(module_cmd,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,

View File

@@ -21,7 +21,7 @@
try: try:
# Python 2 had these in the HTMLParser package. # Python 2 had these in the HTMLParser package.
from HTMLParser import HTMLParser, HTMLParseError from HTMLParser import HTMLParser, HTMLParseError # novm
except ImportError: except ImportError:
# In Python 3, things moved to html.parser # In Python 3, things moved to html.parser
from html.parser import HTMLParser from html.parser import HTMLParser
@@ -80,7 +80,7 @@ class NonDaemonPool(multiprocessing.pool.Pool):
Process = NonDaemonProcess Process = NonDaemonProcess
else: else:
class NonDaemonContext(type(multiprocessing.get_context())): class NonDaemonContext(type(multiprocessing.get_context())): # novm
Process = NonDaemonProcess Process = NonDaemonProcess
class NonDaemonPool(multiprocessing.pool.Pool): class NonDaemonPool(multiprocessing.pool.Pool):
@@ -128,7 +128,7 @@ def read_from_url(url, accept_content_type=None):
warn_no_ssl_cert_checking() warn_no_ssl_cert_checking()
else: else:
# User wants SSL verification, and it *can* be provided. # User wants SSL verification, and it *can* be provided.
context = ssl.create_default_context() context = ssl.create_default_context() # novm
else: else:
# User has explicitly indicated that they do not want SSL # User has explicitly indicated that they do not want SSL
# verification. # verification.

View File

@@ -218,7 +218,7 @@ _keys() {
_config_sections() { _config_sections() {
if [[ -z "${SPACK_CONFIG_SECTIONS:-}" ]] if [[ -z "${SPACK_CONFIG_SECTIONS:-}" ]]
then then
SPACK_CONFIG_SECTIONS="compilers mirrors repos packages modules config upstreams" SPACK_CONFIG_SECTIONS="$(spack config list)"
fi fi
SPACK_COMPREPLY="$SPACK_CONFIG_SECTIONS" SPACK_COMPREPLY="$SPACK_CONFIG_SECTIONS"
} }

View File

@@ -218,7 +218,7 @@ _keys() {
_config_sections() { _config_sections() {
if [[ -z "${SPACK_CONFIG_SECTIONS:-}" ]] if [[ -z "${SPACK_CONFIG_SECTIONS:-}" ]]
then then
SPACK_CONFIG_SECTIONS="compilers mirrors repos packages modules config upstreams" SPACK_CONFIG_SECTIONS="$(spack config list)"
fi fi
SPACK_COMPREPLY="$SPACK_CONFIG_SECTIONS" SPACK_COMPREPLY="$SPACK_CONFIG_SECTIONS"
} }
@@ -584,7 +584,7 @@ _spack_config() {
then then
SPACK_COMPREPLY="-h --help --scope" SPACK_COMPREPLY="-h --help --scope"
else else
SPACK_COMPREPLY="get blame edit" SPACK_COMPREPLY="get blame edit list"
fi fi
} }
@@ -615,6 +615,10 @@ _spack_config_edit() {
fi fi
} }
_spack_config_list() {
SPACK_COMPREPLY="-h --help"
}
_spack_configure() { _spack_configure() {
if $list_options if $list_options
then then

View File

@@ -34,6 +34,8 @@ class ActsCore(CMakePackage):
maintainers = ['HadrienG2'] maintainers = ['HadrienG2']
version('develop', branch='master') version('develop', branch='master')
version('0.15.0', commit='267c28f69c561e64369661a6235b03b5a610d6da')
version('0.14.0', commit='38d678fcb205b77d60326eae913fbb1b054acea1')
version('0.13.0', commit='b33f7270ddbbb33050b7ec60b4fa255dc2bfdc88') version('0.13.0', commit='b33f7270ddbbb33050b7ec60b4fa255dc2bfdc88')
version('0.12.1', commit='a8b3d36e7c6cb86487637589e0eff7bbe626054a') version('0.12.1', commit='a8b3d36e7c6cb86487637589e0eff7bbe626054a')
version('0.12.0', commit='f9cda77299606d78c889fb1db2576c1971a271c4') version('0.12.0', commit='f9cda77299606d78c889fb1db2576c1971a271c4')
@@ -68,10 +70,11 @@ class ActsCore(CMakePackage):
variant('json', default=False, description='Build the Json plugin') variant('json', default=False, description='Build the Json plugin')
variant('tgeo', default=False, description='Build the TGeo plugin') variant('tgeo', default=False, description='Build the TGeo plugin')
depends_on('cmake @3.9:', type='build') depends_on('cmake @3.11:', type='build')
depends_on('boost @1.62:1.69.99 +program_options +test', when='@:0.10.3') depends_on('boost @1.62:1.69.99 +program_options +test', when='@:0.10.3')
depends_on('boost @1.62: +program_options +test', when='@0.10.4:') depends_on('boost @1.62: +program_options +test', when='@0.10.4:')
depends_on('eigen @3.2.9:', type='build') depends_on('eigen @3.2.9:', type='build')
depends_on('nlohmann-json @3.2.0:', when='@0.14.0: +json')
depends_on('root @6.10: cxxstd=14', when='+tgeo @:0.8.0') depends_on('root @6.10: cxxstd=14', when='+tgeo @:0.8.0')
depends_on('root @6.10:', when='+tgeo @0.8.1:') depends_on('root @6.10:', when='+tgeo @0.8.1:')
depends_on('dd4hep @1.2:', when='+dd4hep') depends_on('dd4hep @1.2:', when='+dd4hep')
@@ -99,4 +102,7 @@ def cmake_variant(cmake_label, spack_variant):
cxxstd = spec['root'].variants['cxxstd'].value cxxstd = spec['root'].variants['cxxstd'].value
args.append("-DCMAKE_CXX_STANDARD={0}".format(cxxstd)) args.append("-DCMAKE_CXX_STANDARD={0}".format(cxxstd))
if spec.satisfies('@0.14.0: +json'):
args.append("-DACTS_USE_BUNDLED_NLOHMANN_JSON=OFF")
return args return args

View File

@@ -12,11 +12,13 @@ class Amrex(CMakePackage):
mesh refinement (AMR) applications.""" mesh refinement (AMR) applications."""
homepage = "https://amrex-codes.github.io/amrex/" homepage = "https://amrex-codes.github.io/amrex/"
url = "https://github.com/AMReX-Codes/amrex/archive/20.01.tar.gz"
git = "https://github.com/AMReX-Codes/amrex.git" git = "https://github.com/AMReX-Codes/amrex.git"
maintainers = ['mic84', 'asalmgren'] maintainers = ['mic84', 'asalmgren']
version('develop', branch='development') version('develop', branch='development')
version('20.01', sha256='f7026d267ca5de79ec7e740264d54230f419776d40feae705e939be0b1d8e0d3')
version('19.10', commit='52844b32b7da11e9733b9a7f4a782e51de7f5e1e') # tag:19.10 version('19.10', commit='52844b32b7da11e9733b9a7f4a782e51de7f5e1e') # tag:19.10
version('19.08', commit='bdd1146139e8727a513d451075f900c172eb81fd') # tag:19.08 version('19.08', commit='bdd1146139e8727a513d451075f900c172eb81fd') # tag:19.08
version('18.10.1', commit='260b53169badaa760b91dfc60ea6b2ea3d9ccf06') # tag:18.10.1 version('18.10.1', commit='260b53169badaa760b91dfc60ea6b2ea3d9ccf06') # tag:18.10.1

View File

@@ -0,0 +1,47 @@
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class AsdfCxx(CMakePackage):
"""ASDF - Advanced Scientific Data Format, a C++ implementation"""
homepage = "https://github.com/eschnett/asdf-cxx"
url = "https://github.com/eschnett/asdf-cxx/archive/version/1.0.0.tar.gz"
maintainers = ['eschnett']
version('7.2.1', sha256='40864f4f27d3ce8acb5169b57211ce6ac3805f0a6de9c1dfd5f994f4a5beccda')
version('7.2.0', sha256='faded85d44288afb83f13634d2139adee07e06f7ea60960c6f2ef8d898c0aa09')
version('7.1.0', sha256='81fd8c7f91f8daf0f85a1486480ae9e736b9712e82ccb858271f7ee2c2b425f7')
version('7.0.0', sha256='a50718dfa68b86b0c3e280e6a9d0a4edb03d500ba70244bd38fa86bac1433979')
version('6.3.0', sha256='44a24cc490cf776106edcfded6006d63d28889dfe985cce3bd565d5151add9c8')
version('6.0.0', sha256='76ab0a893191a33a88a753d09a20135470f809c66173794fa3e37a2437ea3cde')
version('5.0.0', sha256='876c83bcc7514f2584dbf5462bd5b7de89b41301ec127451342079e703cd6a67')
version('4.0.1', sha256='c4597b8353b0e181d97c6702dae0cb69a558ae5b553945298757433615bb199b')
version('3.1.0', sha256='15de5156460ed581e1e755955e6a1b557758a6497d083c4873d143c05e720078')
version('3.0.0', sha256='a6d42f7d875eff2f1ff6af836a44e7a44fcc6be3409605d45f236e07d70c65db')
version('2.6.1', sha256='631426bd2784c2175b5a5035c12e91b0b0d36691f9972df427b41080ace43fc3')
version('2.5.1', sha256='d3c1f690716bd0883c4d429c9fa895ce41e6223bafa87624f9f1530c0d2e654c')
version('2.5.0', sha256='916e9021063c41eb7922ed69c958ea87757cdfcb7263d0d3fda31f0233dbbaaf')
version('2.4.1', sha256='a300bf11d4fd9923eb109c5f8e1067f2ef96f284ea43fafd871b469118d42597')
version('2.4.0', sha256='965360858bcacb6df4602fdff55924f7b9daf0750b27ac3f31781e23b54e8f93')
version('2.3.1', sha256='7c3ecf4fdafff5da57edb8b0c75b2e1f9c6bf42097c483025ff49f0a65094e22')
version('2.2.1', sha256='a34679d8690ff118bedd20652caebdb9c3fb5f628aca7ed2f535a026b28b3853')
version('2.1.1', sha256='f1a801b82facb2c0913ca3dce9c62970651e58fae8bc232f5079a1c4773ec6fa')
version('2.1.0', sha256='066c2c1033be41e10b874ceec1e87267fd792c40d46cbc768b05ba94cca234a1')
version('1.1.0', sha256='3e23b9cd16254f5adbf878145e320f56b4d3ad75de23d2c761eb7f04150926c5')
version('1.0.0', sha256='0b63594a1dec27cc85d25adbf900b6e936b5015f579b9b892b983151bec96775')
variant('python', default=True, description="Enable Python support")
depends_on('bzip2')
depends_on('openssl')
depends_on('py-numpy', type=('build', 'run'), when='+python')
depends_on('python', type=('build', 'run'), when='+python')
depends_on('swig', type='build', when='+python')
depends_on('yaml-cpp')
depends_on('zlib')

View File

@@ -6,7 +6,7 @@
from spack import * from spack import *
class Charliecloud(MakefilePackage): class Charliecloud(AutotoolsPackage):
"""Lightweight user-defined software stacks for HPC.""" """Lightweight user-defined software stacks for HPC."""
homepage = "https://hpc.github.io/charliecloud" homepage = "https://hpc.github.io/charliecloud"
@@ -14,19 +14,7 @@ class Charliecloud(MakefilePackage):
git = "https://github.com/hpc/charliecloud.git" git = "https://github.com/hpc/charliecloud.git"
version('master', branch='master') version('master', branch='master')
version('0.12', sha256='8a90f33406905cee935b5673a1159232b0b71845f4b6a26d28ca88f5d3f55891') version('0.13', sha256='5740bff6e410ca99484c1bdf3dbe834c0f753c846d55c19d6162967a3e2718e0')
version('0.11', sha256='942d3c7a74c978fd7420cb2b255e618f4f0acaafb6025160bc3a4deeb687ef3c')
version('0.10', sha256='5cf00b170e7568750ca0b828c43c0857c39674860b480d757057450d69f1a21e')
version('0.9.10', sha256='44e821b62f9c447749d3ed0d2b2e44d374153058814704a5543e83f42db2a45a')
version('0.9.9', sha256='2624c5a0b19a01c9bca0acf873ceeaec401b9185a23e9108fadbcee0b9d74736')
version('0.9.8', sha256='903bcce05b19501b5524ef57a929d2f4c6ddeacb0e8443fcb2fe6963e2f29229')
version('0.9.7', sha256='ec80a4b9bef3a2161a783e11d99cc58e09a32dfbc8a6234c8f7ce7fa76e2f62d')
version('0.9.6', sha256='50e20d5e2a3710cd06e7c999db22495b07ef0fb15ffbc0af3bccac5387f0fddb')
version('0.9.3', sha256='f1bf032377b8845bc9a93b8a4fad6386161e35900223c0acc61d1f3aa3a87bc7')
version('0.9.2', sha256='8d0e4804d412beef720a66f886a0a78bce42f3269e880ebf11f602581f8047d4')
version('0.9.1', sha256='8e69150a271285da71ece7a09b48251ef6593f72207c5126741d9976aa737d95')
version('0.9.0', sha256='7e74cb16e31fd9d502198f7509bab14d1049ec68ba90b15e277e76f805db9458')
version('0.2.4', sha256='b9a8ff54b9d296e30b2cf5d64a7e732ad09e14b989645aaa5eee8a1dc7ee34e5')
depends_on('python@3.4:', type=('build', 'run')) depends_on('python@3.4:', type=('build', 'run'))
@@ -45,13 +33,14 @@ class Charliecloud(MakefilePackage):
# bash automated testing harness (bats) # bash automated testing harness (bats)
depends_on('bats@0.4.0', type='test') depends_on('bats@0.4.0', type='test')
def url_for_version(self, version): def configure_args(self):
if version >= Version('0.9.8'):
url = "https://github.com/hpc/charliecloud/releases/download/v{0}/charliecloud-{0}.tar.gz"
else:
url = "https://github.com/hpc/charliecloud/archive/v{0}.tar.gz"
return url.format(version)
@property args = []
def install_targets(self):
return ['install', 'PREFIX=%s' % self.prefix] if '+docs' not in self.spec:
args.append('--disable-html')
if '+builder' not in self.spec:
args.append('--disable-ch-grow')
return args

View File

@@ -15,6 +15,7 @@ class Curl(AutotoolsPackage):
# URL must remain http:// so Spack can bootstrap curl # URL must remain http:// so Spack can bootstrap curl
url = "http://curl.haxx.se/download/curl-7.60.0.tar.bz2" url = "http://curl.haxx.se/download/curl-7.60.0.tar.bz2"
version('7.68.0', sha256='207f54917dd6a2dc733065ccf18d61bb5bebeaceb5df49cd9445483e8623eeb9')
version('7.63.0', sha256='9bab7ed4ecff77020a312d84cc5fb7eb02d58419d218f267477a724a17fd8dd8') version('7.63.0', sha256='9bab7ed4ecff77020a312d84cc5fb7eb02d58419d218f267477a724a17fd8dd8')
version('7.60.0', sha256='897dfb2204bd99be328279f88f55b7c61592216b0542fcbe995c60aa92871e9b') version('7.60.0', sha256='897dfb2204bd99be328279f88f55b7c61592216b0542fcbe995c60aa92871e9b')
version('7.59.0', sha256='b5920ffd6a8c95585fb95070e0ced38322790cb335c39d0dab852d12e157b5a0') version('7.59.0', sha256='b5920ffd6a8c95585fb95070e0ced38322790cb335c39d0dab852d12e157b5a0')

View File

@@ -7,15 +7,16 @@
class H5cpp(CMakePackage): class H5cpp(CMakePackage):
"""Easy to use HDF5 C++ templates for Serial and Paralell HDF5""" """Easy to use HDF5 C++ templates for Serial and Parallel HDF5"""
homepage = "http://h5cpp.org" homepage = "http://h5cpp.org"
# url = "https://github.com/steven-varga/h5cpp" url = "https://github.com/steven-varga/h5cpp/archive/v1.10.4-5.tar.gz"
git = "https://github.com/steven-varga/h5cpp.git" git = "https://github.com/steven-varga/h5cpp.git"
maintainers = ['eschnett'] maintainers = ['eschnett']
version('master', branch='master') version('master', branch='master')
version('1.10.4-5', sha256='42d0ca1aaff1ead8998a26d892a51c12b1b89023382f191dc438bd0fa4513455')
variant('mpi', default=True, description='Include MPI support') variant('mpi', default=True, description='Include MPI support')

View File

@@ -27,6 +27,9 @@ class Harfbuzz(AutotoolsPackage):
depends_on("zlib") depends_on("zlib")
depends_on("graphite2", when='+graphite2') depends_on("graphite2", when='+graphite2')
conflicts('%intel', when='@2.3.1:',
msg='harfbuzz-2.3.1 does not build with the Intel compiler')
def configure_args(self): def configure_args(self):
args = [] args = []
# disable building of gtk-doc files following #9771 # disable building of gtk-doc files following #9771

View File

@@ -28,6 +28,7 @@ class Hwloc(AutotoolsPackage):
git = 'https://github.com/open-mpi/hwloc.git' git = 'https://github.com/open-mpi/hwloc.git'
version('master', branch='master') version('master', branch='master')
version('2.1.0', sha256='1fb8cc1438de548e16ec3bb9e4b2abb9f7ce5656f71c0906583819fcfa8c2031')
version('2.0.2', sha256='27dcfe42e3fb3422b72ce48b48bf601c0a3e46e850ee72d9bdd17b5863b6e42c') version('2.0.2', sha256='27dcfe42e3fb3422b72ce48b48bf601c0a3e46e850ee72d9bdd17b5863b6e42c')
version('2.0.1', sha256='f1156df22fc2365a31a3dc5f752c53aad49e34a5e22d75ed231cd97eaa437f9d') version('2.0.1', sha256='f1156df22fc2365a31a3dc5f752c53aad49e34a5e22d75ed231cd97eaa437f9d')
version('2.0.0', sha256='a0d425a0fc7c7e3f2c92a272ffaffbd913005556b4443e1887d2e1718d902887') version('2.0.0', sha256='a0d425a0fc7c7e3f2c92a272ffaffbd913005556b4443e1887d2e1718d902887')

View File

@@ -19,6 +19,7 @@ class Hydrogen(CMakePackage):
maintainers = ['bvanessen'] maintainers = ['bvanessen']
version('develop', branch='hydrogen') version('develop', branch='hydrogen')
version('1.3.3', sha256='140112066b84d33ca4b75c8e520fb15748fa648c4d2b934c1eb5510173ede5f5')
version('1.3.2', sha256='50bc5e87955f8130003d04dfd9dcad63107e92b82704f8107baf95b0ccf98ed6') version('1.3.2', sha256='50bc5e87955f8130003d04dfd9dcad63107e92b82704f8107baf95b0ccf98ed6')
version('1.3.1', sha256='a8b8521458e9e747f2b24af87c4c2749a06e500019c383e0cefb33e5df6aaa1d') version('1.3.1', sha256='a8b8521458e9e747f2b24af87c4c2749a06e500019c383e0cefb33e5df6aaa1d')
version('1.3.0', sha256='0f3006aa1d8235ecdd621e7344c99f56651c6836c2e1bc0cf006331b70126b36') version('1.3.0', sha256='0f3006aa1d8235ecdd621e7344c99f56651c6836c2e1bc0cf006331b70126b36')
@@ -58,6 +59,8 @@ class Hydrogen(CMakePackage):
description='Builds with Aluminum communication library') description='Builds with Aluminum communication library')
variant('omp_taskloops', default=False, variant('omp_taskloops', default=False,
description='Use OpenMP taskloops instead of parallel for loops.') description='Use OpenMP taskloops instead of parallel for loops.')
variant('half', default=True,
description='Builds with support for FP16 precision data types')
# Note that #1712 forces us to enumerate the different blas variants # Note that #1712 forces us to enumerate the different blas variants
depends_on('openblas', when='blas=openblas ~openmp_blas ~int64_blas') depends_on('openblas', when='blas=openblas ~openmp_blas ~int64_blas')
@@ -94,6 +97,7 @@ class Hydrogen(CMakePackage):
depends_on('cuda', when='+cuda') depends_on('cuda', when='+cuda')
depends_on('cub', when='+cuda') depends_on('cub', when='+cuda')
depends_on('half', when='+half')
conflicts('@0:0.98', msg="Hydrogen did not exist before v0.99. " + conflicts('@0:0.98', msg="Hydrogen did not exist before v0.99. " +
"Did you mean to use Elemental instead?") "Did you mean to use Elemental instead?")
@@ -127,6 +131,7 @@ def cmake_args(self):
'-DHydrogen_ENABLE_CUB=%s' % ('+cuda' in spec), '-DHydrogen_ENABLE_CUB=%s' % ('+cuda' in spec),
'-DHydrogen_ENABLE_CUDA=%s' % ('+cuda' in spec), '-DHydrogen_ENABLE_CUDA=%s' % ('+cuda' in spec),
'-DHydrogen_ENABLE_TESTING=%s' % ('+test' in spec), '-DHydrogen_ENABLE_TESTING=%s' % ('+test' in spec),
'-DHydrogen_ENABLE_HALF=%s' % ('+half' in spec),
] ]
# Add support for OS X to find OpenMP # Add support for OS X to find OpenMP

View File

@@ -11,9 +11,10 @@ class Ior(AutotoolsPackage):
using POSIX, MPI-IO, or HDF5 interfaces.""" using POSIX, MPI-IO, or HDF5 interfaces."""
homepage = "https://github.com/hpc/ior" homepage = "https://github.com/hpc/ior"
url = "https://github.com/hpc/ior/archive/3.2.0.tar.gz" url = "https://github.com/hpc/ior/archive/3.2.1.tar.gz"
version('3.2.0', sha256='91a766fb9c34b5780705d0997b71b236a1120da46652763ba11d9a8c44251852') version('3.2.1', sha256='ebcf2495aecb357370a91a2d5852cfd83bba72765e586bcfaf15fb79ca46d00e')
version('3.2.0', sha256='91a766fb9c34b5780705d0997b71b236a1120da46652763ba11d9a8c44251852')
version('3.0.1', sha256='0cbefbcdb02fb13ba364e102f9e7cc2dcf761698533dac25de446a3a3e81390d') version('3.0.1', sha256='0cbefbcdb02fb13ba364e102f9e7cc2dcf761698533dac25de446a3a3e81390d')
variant('hdf5', default=False, description='support IO with HDF5 backend') variant('hdf5', default=False, description='support IO with HDF5 backend')

View File

@@ -48,6 +48,7 @@ class Lbann(CMakePackage):
'(note that for v0.99 conduit is required)') '(note that for v0.99 conduit is required)')
variant('vtune', default=False, description='Builds with support for Intel VTune') variant('vtune', default=False, description='Builds with support for Intel VTune')
variant('docs', default=False, description='Builds with support for building documentation') variant('docs', default=False, description='Builds with support for building documentation')
variant('extras', default=False, description='Add python modules for LBANN related tools')
conflicts('@:0.90,0.99:', when='~conduit') conflicts('@:0.90,0.99:', when='~conduit')
@@ -96,7 +97,6 @@ class Lbann(CMakePackage):
'~pthreads_pf ~python ~qt ~stitching ~superres ~ts ~video' '~pthreads_pf ~python ~qt ~stitching ~superres ~ts ~video'
'~videostab ~videoio ~vtk', when='+opencv') '~videostab ~videoio ~vtk', when='+opencv')
depends_on('protobuf@3.6.1: build_type=Release')
depends_on('cnpy') depends_on('cnpy')
depends_on('nccl', when='@0.94:0.98.2 +gpu +nccl') depends_on('nccl', when='@0.94:0.98.2 +gpu +nccl')
@@ -107,20 +107,22 @@ class Lbann(CMakePackage):
extends("python") extends("python")
depends_on('py-setuptools', type='build') depends_on('py-setuptools', type='build')
depends_on('py-argparse', type='run', when='@:0.90,0.99: ^python@:2.6') depends_on('py-argparse', type='run', when='@:0.90,0.99: ^python@:2.6')
depends_on('py-configparser', type='run', when='@:0.90,0.99:') depends_on('py-configparser', type='run', when='@:0.90,0.99: +extras')
depends_on('py-graphviz@0.10.1:', type='run', when='@:0.90,0.99:') depends_on('py-graphviz@0.10.1:', type='run', when='@:0.90,0.99: +extras')
depends_on('py-matplotlib@3.0.0:', type='run', when='@:0.90,0.99:') depends_on('py-matplotlib@3.0.0:', type='run', when='@:0.90,0.99: +extras')
depends_on('py-numpy@1.16.0:', type=('build', 'run'), when='@:0.90,0.99:') depends_on('py-numpy@1.16.0:', type=('build', 'run'), when='@:0.90,0.99: +extras')
depends_on('py-onnx@1.3.0:', type='run', when='@:0.90,0.99:') depends_on('py-onnx@1.3.0:', type='run', when='@:0.90,0.99: +extras')
depends_on('py-pandas@0.24.1:', type='run', when='@:0.90,0.99:') depends_on('py-pandas@0.24.1:', type='run', when='@:0.90,0.99: +extras')
depends_on('py-texttable@1.4.0:', type='run', when='@:0.90,0.99:') depends_on('py-texttable@1.4.0:', type='run', when='@:0.90,0.99: +extras')
depends_on('py-pytest', type='test', when='@:0.90,0.99:') depends_on('py-pytest', type='test', when='@:0.90,0.99:')
depends_on('py-protobuf+cpp', type='run', when='@:0.90,0.99:') depends_on('py-protobuf+cpp@3.6.1:', type=('build', 'run'), when='@:0.90,0.99:')
depends_on('py-breathe', type='build', when='+docs') depends_on('py-breathe', type='build', when='+docs')
depends_on('py-m2r', type='build', when='+docs') depends_on('py-m2r', type='build', when='+docs')
depends_on('cereal') depends_on('cereal')
depends_on('catch2', type='test')
depends_on('clara')
generator = 'Ninja' generator = 'Ninja'
depends_on('ninja', type='build') depends_on('ninja', type='build')

View File

@@ -15,6 +15,7 @@ class Libcircle(AutotoolsPackage):
url = "https://github.com/hpc/libcircle/releases/download/0.2.1-rc.1/libcircle-0.2.1-rc.1.tar.gz" url = "https://github.com/hpc/libcircle/releases/download/0.2.1-rc.1/libcircle-0.2.1-rc.1.tar.gz"
version('master', branch='master') version('master', branch='master')
version('0.3.0', sha256='5ce38eb5b3c2b394bca1316310758f276c893dd3f4c15d7bc14ea05d3110ce58', url='https://github.com/hpc/libcircle/releases/download/v0.3/libcircle-0.3.0.tar.gz')
version('0.2.1-rc.1', sha256='5747f91cf4417023304dcc92fd07e3617ac712ca1eeb698880979bbca3f54865') version('0.2.1-rc.1', sha256='5747f91cf4417023304dcc92fd07e3617ac712ca1eeb698880979bbca3f54865')
depends_on('mpi') depends_on('mpi')

View File

@@ -49,10 +49,6 @@ class Libhio(AutotoolsPackage):
patch('0001-hdf5-make-docs-optional.patch', when="@1.4.1.0") patch('0001-hdf5-make-docs-optional.patch', when="@1.4.1.0")
patch('0001-spack-fix-for-spack-to-work-on-non-cray-systems.patch', when="@1.4.1.2") patch('0001-spack-fix-for-spack-to-work-on-non-cray-systems.patch', when="@1.4.1.2")
def autoreconf(self, spec, prefix):
autoreconf = which('autoreconf')
autoreconf('-ifv')
def configure_args(self): def configure_args(self):
spec = self.spec spec = self.spec
args = [] args = []

View File

@@ -87,20 +87,16 @@ class Llvm(CMakePackage):
variant('omp_tsan', default=False, variant('omp_tsan', default=False,
description="Build with OpenMP capable thread sanitizer") description="Build with OpenMP capable thread sanitizer")
variant('python', default=False, description="Install python bindings") variant('python', default=False, description="Install python bindings")
variant('flang', default=False,
description='Build flang branch version instead')
extends('python', when='+python') extends('python', when='+python')
# Build dependency # Build dependency
depends_on('cmake@3.4.3:', type='build') depends_on('cmake@3.4.3:', type='build')
depends_on('python@2.7:2.8', when='@:4.999 ~python', type='build') depends_on('python@2.7:2.8', when='@:4.999 ~python', type='build')
depends_on('python@2.7:2.8', when='@5: ~python +flang', type='build')
depends_on('python', when='@5: ~python', type='build') depends_on('python', when='@5: ~python', type='build')
# Universal dependency # Universal dependency
depends_on('python@2.7:2.8', when='@:4.999+python') depends_on('python@2.7:2.8', when='@:4.999+python')
depends_on('python@2.7:2.8', when='@5:+python+flang')
depends_on('python', when='@5:+python') depends_on('python', when='@5:+python')
# openmp dependencies # openmp dependencies
@@ -119,59 +115,6 @@ class Llvm(CMakePackage):
depends_on('gmp', when='@:3.6.999 +polly') depends_on('gmp', when='@:3.6.999 +polly')
depends_on('isl', when='@:3.6.999 +polly') depends_on('isl', when='@:3.6.999 +polly')
resource(name='flang-llvm',
git='https://github.com/flang-compiler/llvm.git',
branch='release_60',
placement='llvm-flang',
when='llvm@develop+flang')
resource(name='flang-llvm',
git='https://github.com/flang-compiler/llvm.git',
commit='d8b30082648dc869eba68f9e539605f437d7760c',
placement='llvm-flang',
when='@7.0.1+flang')
resource(name='flang-llvm',
git='https://github.com/flang-compiler/llvm.git',
commit='f26a3ece4ccd68a52f5aa970ec42837ee0743296',
placement='llvm-flang',
when='@6.0.0+flang')
resource(name='flang-driver',
git='https://github.com/flang-compiler/flang-driver.git',
branch='release_60',
destination='llvm-flang/tools',
placement='clang',
when='llvm@develop+flang')
resource(name='flang-driver',
git='https://github.com/flang-compiler/flang-driver.git',
commit='dd7587310ae498c22514a33e1a2546b86af9cf25',
destination='llvm-flang/tools',
placement='clang',
when='@7.0.1+flang')
resource(name='flang-driver',
git='https://github.com/flang-compiler/flang-driver.git',
commit='e079fa68cb35a53c88c41a1939f90b94d539e984',
destination='llvm-flang/tools',
placement='clang',
when='@6.0.0+flang')
resource(name='openmp',
git='https://github.com/llvm-mirror/openmp.git',
branch='release_60',
destination='llvm-flang/projects',
placement='openmp',
when='@develop+flang')
resource(name='openmp',
git='https://github.com/llvm-mirror/openmp.git',
commit='d5aa29cb3bcf51289d326b4e565613db8aff65ef',
destination='llvm-flang/projects',
placement='openmp',
when='@6:7.0.1+flang')
conflicts('+clang_extra', when='~clang') conflicts('+clang_extra', when='~clang')
conflicts('+lldb', when='~clang') conflicts('+lldb', when='~clang')
@@ -182,15 +125,6 @@ class Llvm(CMakePackage):
# OMP TSAN exists in > 5.x # OMP TSAN exists in > 5.x
conflicts('+omp_tsan', when='@:5.99') conflicts('+omp_tsan', when='@:5.99')
# +flang conflicts other variants
conflicts('+gold', when='+flang')
conflicts('+lldb', when='+flang')
conflicts('+lld', when='+flang')
conflicts('+copiler-rt', when='+flang')
conflicts('+libcxx', when='+flang')
conflicts('+polly', when='+flang')
conflicts('+internal_unwind', when='+flang')
# Github issue #4986 # Github issue #4986
patch('llvm_gcc7.patch', when='@4.0.0:4.0.1+lldb %gcc@7.0:') patch('llvm_gcc7.patch', when='@4.0.0:4.0.1+lldb %gcc@7.0:')
# Backport from llvm master + additional fix # Backport from llvm master + additional fix
@@ -235,13 +169,7 @@ def setup_run_environment(self, env):
env.set('CC', join_path(self.spec.prefix.bin, 'clang')) env.set('CC', join_path(self.spec.prefix.bin, 'clang'))
env.set('CXX', join_path(self.spec.prefix.bin, 'clang++')) env.set('CXX', join_path(self.spec.prefix.bin, 'clang++'))
# When building flang we do not use the mono repo root_cmakelists_dir = 'llvm'
@property
def root_cmakelists_dir(self):
if '+flang' in self.spec:
return 'llvm-flang'
else:
return 'llvm'
def cmake_args(self): def cmake_args(self):
spec = self.spec spec = self.spec
@@ -283,7 +211,7 @@ def cmake_args(self):
if '+libcxx' in spec: if '+libcxx' in spec:
projects.append('libcxx') projects.append('libcxx')
projects.append('libcxxabi') projects.append('libcxxabi')
if spec.satisfies('@3.9.0:') and '+flang' not in spec: if spec.satisfies('@3.9.0:'):
cmake_args.append('-DCLANG_DEFAULT_CXX_STDLIB=libc++') cmake_args.append('-DCLANG_DEFAULT_CXX_STDLIB=libc++')
if '+internal_unwind' in spec: if '+internal_unwind' in spec:
projects.append('libunwind') projects.append('libunwind')
@@ -300,14 +228,10 @@ def cmake_args(self):
if '+all_targets' not in spec: # all is default on cmake if '+all_targets' not in spec: # all is default on cmake
targets = ['NVPTX', 'AMDGPU'] targets = ['NVPTX', 'AMDGPU']
if (spec.version < Version('3.9.0') if (spec.version < Version('3.9.0')):
and '+flang' not in spec):
# Starting in 3.9.0 CppBackend is no longer a target (see # Starting in 3.9.0 CppBackend is no longer a target (see
# LLVM_ALL_TARGETS in llvm's top-level CMakeLists.txt for # LLVM_ALL_TARGETS in llvm's top-level CMakeLists.txt for
# the complete list of targets) # the complete list of targets)
# This also applies to the version of llvm used by flang
# hence the test to see if the version starts with "flang".
targets.append('CppBackend') targets.append('CppBackend')
if spec.target.family == 'x86' or spec.target.family == 'x86_64': if spec.target.family == 'x86' or spec.target.family == 'x86_64':
@@ -340,10 +264,9 @@ def cmake_args(self):
spec.satisfies('platform=linux'): spec.satisfies('platform=linux'):
cmake_args.append('-DCMAKE_BUILD_WITH_INSTALL_RPATH=1') cmake_args.append('-DCMAKE_BUILD_WITH_INSTALL_RPATH=1')
if '+flang' not in spec: # Semicolon seperated list of projects to enable
# Semicolon seperated list of projects to enable cmake_args.append(
cmake_args.append( '-DLLVM_ENABLE_PROJECTS:STRING={0}'.format(';'.join(projects)))
'-DLLVM_ENABLE_PROJECTS:STRING={0}'.format(';'.join(projects)))
return cmake_args return cmake_args

View File

@@ -17,6 +17,7 @@ class Magma(CMakePackage):
url = "http://icl.cs.utk.edu/projectsfiles/magma/downloads/magma-2.2.0.tar.gz" url = "http://icl.cs.utk.edu/projectsfiles/magma/downloads/magma-2.2.0.tar.gz"
maintainers = ['luszczek'] maintainers = ['luszczek']
version('2.5.2', sha256='065feb85558f9dd6f4cc4db36ac633a3f787827fc832d0b578a049a43a195620')
version('2.5.1', sha256='ce32c199131515336b30c92a907effe0c441ebc5c5bdb255e4b06b2508de109f') version('2.5.1', sha256='ce32c199131515336b30c92a907effe0c441ebc5c5bdb255e4b06b2508de109f')
version('2.5.0', sha256='4fd45c7e46bd9d9124253e7838bbfb9e6003c64c2c67ffcff02e6c36d2bcfa33') version('2.5.0', sha256='4fd45c7e46bd9d9124253e7838bbfb9e6003c64c2c67ffcff02e6c36d2bcfa33')
version('2.4.0', sha256='4eb839b1295405fd29c8a6f5b4ed578476010bf976af46573f80d1169f1f9a4f') version('2.4.0', sha256='4eb839b1295405fd29c8a6f5b4ed578476010bf976af46573f80d1169f1f9a4f')

View File

@@ -0,0 +1,19 @@
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Mbdyn(AutotoolsPackage):
"""MBDyn is the first and possibly the only free general purpose
multibody dynamics analysis software."""
homepage = "https://www.mbdyn.org/"
url = "https://www.mbdyn.org/userfiles/downloads/mbdyn-1.7.3.tar.gz"
version('1.7.3', sha256='3cf05cd1cb14c1af3d987aac119b6ecf0d835bc1aee06bc4cf7cc5a245c1f36d')
# Failed to build mbdyn with gcc@4.8.5 and gcc@9.2.0
conflicts('%gcc@:5.0,9.0:')

View File

@@ -0,0 +1,103 @@
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class P3dfft3(AutotoolsPackage):
"""P3DFFT++ (a.k.a. P3DFFT v. 3) is a new generation of P3DFFT library
that aims to provide a comprehensive framework for simulating multiscale
phenomena. It takes the essence of P3DFFT further by creating an
extensible, modular structure uniquely adaptable to a greater range
of use cases."""
homepage = "https://www.p3dfft.net"
url = "https://github.com/sdsc/p3dfft.3/archive/v3.0.0.tar.gz"
git = "https://github.com/sdsc/p3dfft.3.git"
version('develop', branch='master')
version('3.0.0', sha256='1c549e78097d1545d18552b039be0d11cdb96be46efe99a16b65fd5d546dbfa7')
variant('fftw', default=True,
description='Builds with FFTW library')
variant('essl', default=False,
description='Builds with ESSL library')
variant('mpi', default=True,
description="Enable MPI support.")
variant('measure', default=False,
description="Define if you want to use"
"the measure fftw planner flag")
variant('estimate', default=False,
description="Define if you want to"
"use the estimate fftw planner flag")
variant('patient', default=False,
description="Define if you want to"
"use the patient fftw planner flag")
# TODO: Add more configure options!
depends_on('mpi', when='+mpi')
depends_on('fftw', when='+fftw')
depends_on('essl', when='+essl')
def configure_args(self):
args = []
if '%gcc' in self.spec:
args.append('--enable-gnu')
if '%intel' in self.spec:
args.append('--enable-intel')
if '%xl' in self.spec:
args.append('--enable-ibm')
if '%cce' in self.spec:
args.append('--enable-cray')
if '%pgi' in self.spec:
args.append('--enable-pgi')
if '+mpi' in self.spec:
args.append('CC=%s' % self.spec['mpi'].mpicc)
args.append('CXX=%s' % self.spec['mpi'].mpicxx)
args.append('FC=%s' % self.spec['mpi'].mpifc)
if '+openmpi' in self.spec:
args.append('--enable-openmpi')
if '+fftw' in self.spec:
args.append('--enable-fftw')
if '@:3.0.0' in self.spec:
args.append('--with-fftw-lib=%s' %
self.spec['fftw'].prefix.lib)
args.append('--with-fftw-inc=%s' %
self.spec['fftw'].prefix.include)
else:
args.append('--with-fftw=%s' % self.spec['fftw'].prefix)
if 'fftw+measure' in self.spec:
args.append('--enable-fftwmeasure')
if 'fftw+estimate' in self.spec:
args.append('--enable-fftwestimate')
if 'fftw+patient' in self.spec:
args.append('--enable-fftwpatient')
if '+essl' in self.spec:
args.append('--enable-essl')
args.append('--with-essl-lib=%s' %
self.spec['essl'].prefix.lib)
args.append('--with-essl-inc=%s' %
self.spec['essl'].prefix.include)
if '+mkl' in self.spec:
args.append('--enable-mkl')
args.append('--with-mkl-lib=%s' %
self.spec['mkl'].prefix.lib)
args.append('--with-mkl-inc=%s' %
self.spec['mkl'].prefix.include)
return args

View File

@@ -43,6 +43,10 @@ def configure(self, spec, prefix):
options.append('-icpc') options.append('-icpc')
elif self.compiler.name == 'pgi': elif self.compiler.name == 'pgi':
options.append('-pgCC') options.append('-pgCC')
elif self.compiler.name == 'gcc':
options.append('-GNU')
else:
raise InstallError('Unknown/unsupported compiler family')
configure(*options) configure(*options)

View File

@@ -12,10 +12,11 @@ class PyOpppy(PythonPackage):
output and dump files generated by scientific software packages.""" output and dump files generated by scientific software packages."""
homepage = "https://github.com/lanl/opppy" homepage = "https://github.com/lanl/opppy"
url = "https://github.com/lanl/OPPPY/archive/OPPPY-0_1_1.tar.gz" url = "https://github.com/lanl/OPPPY/archive/opppy-0_1_2.tar.gz"
git = "https://github.com/lanl/opppy.git" git = "https://github.com/lanl/opppy.git"
version('master', branch='master') version('master', branch='master')
version('0_1_2', sha256='ef3795d3164fa0aa7ea7da7e223d6d0a48d2960aefd03a7d90cdb8b8f480cd4c')
version('0_1_1', sha256='505c023853e75552abc65de9777a125ecb6a99a1cb4e605a4f702af837e3168b') version('0_1_1', sha256='505c023853e75552abc65de9777a125ecb6a99a1cb4e605a4f702af837e3168b')
depends_on('py-setuptools', type=('build', 'run')) depends_on('py-setuptools', type=('build', 'run'))

View File

@@ -22,6 +22,8 @@ class PyPygdal(PythonPackage):
version('3.0.1.5', sha256='1222f69fe5e6b632d0d2a42d3acb8fac80fb4577c05e01969d8cd5548192ccaa') version('3.0.1.5', sha256='1222f69fe5e6b632d0d2a42d3acb8fac80fb4577c05e01969d8cd5548192ccaa')
version('2.4.2.5', sha256='73386683c0b10ab43b6d64257fca2ba812f53ec61b268de8811565fd9ae9bacd') version('2.4.2.5', sha256='73386683c0b10ab43b6d64257fca2ba812f53ec61b268de8811565fd9ae9bacd')
version('2.4.1.6', sha256='5d1af98ad09f59e34e3b332cf20630b532b33c7120295aaaabbccebf58a11aa4')
version('2.4.0.6', sha256='728d11f3ecae0cd3493cd27dab599a0b6184f5504cc172d49400d88ea2b24a9c')
version('1.11.5.3', sha256='746d13b73a284446a1b604772f869789eabfe6e69dee463f537da27845b29fa7') version('1.11.5.3', sha256='746d13b73a284446a1b604772f869789eabfe6e69dee463f537da27845b29fa7')
version('1.11.4.3', sha256='99d4b0c94d57ae50592924faaa65cc6a0c0892d83764e9f24ef9270c3a4b111a') version('1.11.4.3', sha256='99d4b0c94d57ae50592924faaa65cc6a0c0892d83764e9f24ef9270c3a4b111a')
@@ -29,5 +31,7 @@ class PyPygdal(PythonPackage):
depends_on('py-numpy@1.0.0:', type=('build', 'run')) depends_on('py-numpy@1.0.0:', type=('build', 'run'))
depends_on('gdal@3.0.1', type=('build', 'link', 'run'), when='@3.0.1.5') depends_on('gdal@3.0.1', type=('build', 'link', 'run'), when='@3.0.1.5')
depends_on('gdal@2.4.2', type=('build', 'link', 'run'), when='@2.4.2.5') depends_on('gdal@2.4.2', type=('build', 'link', 'run'), when='@2.4.2.5')
depends_on('gdal@2.4.1', type=('build', 'link', 'run'), when='@2.4.1.6')
depends_on('gdal@2.4.0', type=('build', 'link', 'run'), when='@2.4.0.6')
depends_on('gdal@1.11.5', type=('build', 'link', 'run'), when='@1.11.5.3') depends_on('gdal@1.11.5', type=('build', 'link', 'run'), when='@1.11.5.3')
depends_on('gdal@1.11.4', type=('build', 'link', 'run'), when='@1.11.4.3') depends_on('gdal@1.11.4', type=('build', 'link', 'run'), when='@1.11.4.3')

View File

@@ -19,7 +19,9 @@ class PyTensorflow(Package, CudaPackage):
import_modules = ['tensorflow'] import_modules = ['tensorflow']
version('2.1.0', sha256='638e541a4981f52c69da4a311815f1e7989bf1d67a41d204511966e1daed14f7') version('2.1.0', sha256='638e541a4981f52c69da4a311815f1e7989bf1d67a41d204511966e1daed14f7')
version('2.0.1', sha256='29197d30923b9670992ee4b9c6161f50c7452e9a4158c720746e846080ac245a')
version('2.0.0', sha256='49b5f0495cd681cbcb5296a4476853d4aea19a43bdd9f179c928a977308a0617') version('2.0.0', sha256='49b5f0495cd681cbcb5296a4476853d4aea19a43bdd9f179c928a977308a0617')
version('1.15.2', sha256='d95d75d26a298211b5e802842e87fda5b8b14f6ad83719377b391e5fb71b8746')
version('1.15.1', sha256='19b6e72bc8675937f618cede364d7228a71c2eeaffc42801bcefd98dda7ca056') version('1.15.1', sha256='19b6e72bc8675937f618cede364d7228a71c2eeaffc42801bcefd98dda7ca056')
version('1.15.0', sha256='a5d49c00a175a61da7431a9b289747d62339be9cf37600330ad63b611f7f5dc9') version('1.15.0', sha256='a5d49c00a175a61da7431a9b289747d62339be9cf37600330ad63b611f7f5dc9')
version('1.14.0', sha256='aa2a6a1daafa3af66807cfe0bc77bfe1144a9a53df9a96bab52e3e575b3047ed') version('1.14.0', sha256='aa2a6a1daafa3af66807cfe0bc77bfe1144a9a53df9a96bab52e3e575b3047ed')

View File

@@ -62,6 +62,7 @@ class PyTorch(PythonPackage, CudaPackage):
version('0.4.0', tag='v0.4.0', submodules=True) version('0.4.0', tag='v0.4.0', submodules=True)
version('0.3.1', tag='v0.3.1', submodules=True) version('0.3.1', tag='v0.3.1', submodules=True)
variant('cuda', default=True, description='Build with CUDA')
variant('cudnn', default=True, description='Enables the cuDNN build') variant('cudnn', default=True, description='Enables the cuDNN build')
variant('magma', default=False, description='Enables the MAGMA build') variant('magma', default=False, description='Enables the MAGMA build')
variant('fbgemm', default=False, description='Enables the FBGEMM build') variant('fbgemm', default=False, description='Enables the FBGEMM build')
@@ -100,6 +101,27 @@ class PyTorch(PythonPackage, CudaPackage):
conflicts('+zstd', when='@:1.0') conflicts('+zstd', when='@:1.0')
conflicts('+tbb', when='@:1.1') conflicts('+tbb', when='@:1.1')
cuda_arch_conflict = ('This version of Torch/Caffe2 only supports compute '
'capabilities ')
conflicts('cuda_arch=none', when='+cuda+caffe2',
msg='Must specify CUDA compute capabilities of your GPU, see '
'https://developer.nvidia.com/cuda-gpus')
conflicts('cuda_arch=52', when='@1.3.0:+cuda+caffe2',
msg=cuda_arch_conflict + '>=5.3')
conflicts('cuda_arch=50', when='@1.3.0:+cuda+caffe2',
msg=cuda_arch_conflict + '>=5.3')
conflicts('cuda_arch=35', when='@1.3.0:+cuda+caffe2',
msg=cuda_arch_conflict + '>=5.3')
conflicts('cuda_arch=32', when='@1.3.0:+cuda+caffe2',
msg=cuda_arch_conflict + '>=5.3')
conflicts('cuda_arch=30', when='@1.3.0:+cuda+caffe2',
msg=cuda_arch_conflict + '>=5.3')
conflicts('cuda_arch=30', when='@1.2.0:+cuda+caffe2',
msg=cuda_arch_conflict + '>=3.2')
conflicts('cuda_arch=20', when='@1.0.0:+cuda+caffe2',
msg=cuda_arch_conflict + '>=3.0')
# Required dependencies # Required dependencies
depends_on('cmake@3.5:', type='build') depends_on('cmake@3.5:', type='build')
# Use Ninja generator to speed up build times # Use Ninja generator to speed up build times
@@ -128,7 +150,10 @@ class PyTorch(PythonPackage, CudaPackage):
# depends_on('fbgemm', when='+fbgemm') # depends_on('fbgemm', when='+fbgemm')
# TODO: add dependency: https://github.com/ROCmSoftwarePlatform/MIOpen # TODO: add dependency: https://github.com/ROCmSoftwarePlatform/MIOpen
# depends_on('miopen', when='+miopen') # depends_on('miopen', when='+miopen')
depends_on('intel-mkl-dnn', when='+mkldnn') # TODO: See if there is a way to use an external mkldnn installation.
# Currently, only older versions of py-torch use an external mkldnn
# library.
depends_on('intel-mkl-dnn', when='@0.4:0.4.1+mkldnn')
# TODO: add dependency: https://github.com/Maratyszcza/NNPACK # TODO: add dependency: https://github.com/Maratyszcza/NNPACK
# depends_on('nnpack', when='+nnpack') # depends_on('nnpack', when='+nnpack')
depends_on('qnnpack', when='+qnnpack') depends_on('qnnpack', when='+qnnpack')
@@ -197,6 +222,10 @@ def enable_or_disable(variant, keyword='USE', var=None, newer=False):
enable_or_disable('cuda') enable_or_disable('cuda')
if '+cuda' in self.spec: if '+cuda' in self.spec:
env.set('CUDA_HOME', self.spec['cuda'].prefix) env.set('CUDA_HOME', self.spec['cuda'].prefix)
torch_cuda_arch = ';'.join('{0:.1f}'.format(float(i) / 10.0) for i
in
self.spec.variants['cuda_arch'].value)
env.set('TORCH_CUDA_ARCH_LIST', torch_cuda_arch)
enable_or_disable('cudnn') enable_or_disable('cudnn')
if '+cudnn' in self.spec: if '+cudnn' in self.spec:
@@ -213,7 +242,7 @@ def enable_or_disable(variant, keyword='USE', var=None, newer=False):
env.set('MIOPEN_LIBRARY', self.spec['miopen'].libs[0]) env.set('MIOPEN_LIBRARY', self.spec['miopen'].libs[0])
enable_or_disable('mkldnn') enable_or_disable('mkldnn')
if '+mkldnn' in self.spec: if '@0.4:0.4.1+mkldnn' in self.spec:
env.set('MKLDNN_HOME', self.spec['intel-mkl-dnn'].prefix) env.set('MKLDNN_HOME', self.spec['intel-mkl-dnn'].prefix)
enable_or_disable('nnpack') enable_or_disable('nnpack')

View File

@@ -0,0 +1,23 @@
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyVermin(PythonPackage):
"""Concurrently detect the minimum Python versions needed to run code."""
homepage = "https://github.com/netromdk/vermin"
url = "https://github.com/netromdk/vermin/archive/v0.10.0.tar.gz"
import_modules = ['vermin']
version('0.10.0', sha256='3458a4d084bba5c95fd7208888aaf0e324a07ee092786ee4e5529f539ab4951f')
depends_on('python@2.7:', type=('build', 'run'))
depends_on('py-setuptools', type=('build', 'run'))
def test(self):
make('test')

View File

@@ -23,7 +23,7 @@ class Simulationio(CMakePackage):
variant('pic', default=True, variant('pic', default=True,
description="Produce position-independent code") description="Produce position-independent code")
depends_on('hdf5 +cxx @:1.10.0-patch1') depends_on('hdf5 +cxx @1.10.1:')
depends_on('julia', when='+julia', type=('build', 'run')) depends_on('julia', when='+julia', type=('build', 'run'))
depends_on('py-h5py', when='+python', type=('build', 'run')) depends_on('py-h5py', when='+python', type=('build', 'run'))
depends_on('py-numpy', when='+python', type=('build', 'run')) depends_on('py-numpy', when='+python', type=('build', 'run'))

View File

@@ -91,6 +91,9 @@ class Vtk(CMakePackage):
depends_on('libpng') depends_on('libpng')
depends_on('libtiff') depends_on('libtiff')
depends_on('zlib') depends_on('zlib')
depends_on('eigen', when='@8.2.0:')
depends_on('double-conversion', when='@8.2.0:')
depends_on('sqlite', when='@8.2.0:')
def url_for_version(self, version): def url_for_version(self, version):
url = "http://www.vtk.org/files/release/{0}/VTK-{1}.tar.gz" url = "http://www.vtk.org/files/release/{0}/VTK-{1}.tar.gz"
@@ -117,8 +120,6 @@ def cmake_args(self):
# However, in a few cases we can't do without them yet # However, in a few cases we can't do without them yet
'-DVTK_USE_SYSTEM_GL2PS:BOOL=OFF', '-DVTK_USE_SYSTEM_GL2PS:BOOL=OFF',
'-DVTK_USE_SYSTEM_LIBHARU=OFF', '-DVTK_USE_SYSTEM_LIBHARU=OFF',
'-DVTK_USE_SYSTEM_LIBPROJ4:BOOL=OFF',
'-DVTK_USE_SYSTEM_OGGTHEORA:BOOL=OFF',
'-DNETCDF_DIR={0}'.format(spec['netcdf-c'].prefix), '-DNETCDF_DIR={0}'.format(spec['netcdf-c'].prefix),
'-DNETCDF_C_ROOT={0}'.format(spec['netcdf-c'].prefix), '-DNETCDF_C_ROOT={0}'.format(spec['netcdf-c'].prefix),
@@ -132,6 +133,20 @@ def cmake_args(self):
'-DVTK_WRAP_TCL=OFF', '-DVTK_WRAP_TCL=OFF',
] ]
# Some variable names have changed
if spec.satisfies('@8.2.0:'):
cmake_args.extend([
'-DVTK_USE_SYSTEM_OGG:BOOL=OFF',
'-DVTK_USE_SYSTEM_THEORA:BOOL=OFF',
'-DVTK_USE_SYSTEM_LIBPROJ:BOOL=OFF',
'-DVTK_USE_SYSTEM_PUGIXML:BOOL=OFF',
])
else:
cmake_args.extend([
'-DVTK_USE_SYSTEM_OGGTHEORA:BOOL=OFF',
'-DVTK_USE_SYSTEM_LIBPROJ4:BOOL=OFF',
])
if '+mpi' in spec: if '+mpi' in spec:
cmake_args.extend([ cmake_args.extend([
'-DVTK_Group_MPI:BOOL=ON', '-DVTK_Group_MPI:BOOL=ON',

View File

@@ -17,6 +17,7 @@ class YamlCpp(CMakePackage):
git = "https://github.com/jbeder/yaml-cpp.git" git = "https://github.com/jbeder/yaml-cpp.git"
version('develop', branch='master') version('develop', branch='master')
version('0.6.3', sha256='77ea1b90b3718aa0c324207cb29418f5bced2354c2e483a9523d98c3460af1ed')
version('0.6.2', sha256='e4d8560e163c3d875fd5d9e5542b5fd5bec810febdcba61481fe5fc4e6b1fd05') version('0.6.2', sha256='e4d8560e163c3d875fd5d9e5542b5fd5bec810febdcba61481fe5fc4e6b1fd05')
version('0.5.3', sha256='decc5beabb86e8ed9ebeb04358d5363a5c4f72d458b2c788cb2f3ac9c19467b2') version('0.5.3', sha256='decc5beabb86e8ed9ebeb04358d5363a5c4f72d458b2c788cb2f3ac9c19467b2')

View File

@@ -22,6 +22,7 @@ class Z3(MakefilePackage):
variant('python', default=False, description='Enable python binding') variant('python', default=False, description='Enable python binding')
depends_on('python', type=('build', 'run')) depends_on('python', type=('build', 'run'))
extends('python', when='+python')
# Referenced: https://github.com/Z3Prover/z3/issues/1016 # Referenced: https://github.com/Z3Prover/z3/issues/1016
patch('fix_1016_1.patch', when='@:4.4.1') patch('fix_1016_1.patch', when='@:4.4.1')
@@ -31,9 +32,18 @@ class Z3(MakefilePackage):
def configure_args(self): def configure_args(self):
spec = self.spec spec = self.spec
return [
'--python' if '+python' in spec else '' args = []
]
if spec.satisfies('+python'):
args.append('--python')
args.append(
'--pypkgdir=%s' % join_path(
prefix.lib,
'python%s' % spec['python'].version.up_to(2),
'site-packages'))
return args
def bootstrap(self, spec, prefix): def bootstrap(self, spec, prefix):
options = ['--prefix={0}'.format(prefix)] + self.configure_args() options = ['--prefix={0}'.format(prefix)] + self.configure_args()