summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2020-07-31 12:58:48 +0200
committerPeter Scheibel <scheibel1@llnl.gov>2020-08-10 11:59:05 -0700
commit193e8333fa23a2e9b44d44a80e153d9a27033860 (patch)
treeb2f8f03ced8aeb13694ff37085f0cd8c46e5e5e5 /var
parent1398038beead1a1532fc337165e2b6bf9d58c284 (diff)
downloadspack-193e8333fa23a2e9b44d44a80e153d9a27033860.tar.gz
spack-193e8333fa23a2e9b44d44a80e153d9a27033860.tar.bz2
spack-193e8333fa23a2e9b44d44a80e153d9a27033860.tar.xz
spack-193e8333fa23a2e9b44d44a80e153d9a27033860.zip
Update packages.yaml format and support configuration updates
The YAML config for paths and modules of external packages has changed: the new format allows a single spec to load multiple modules. Spack will automatically convert from the old format when reading the configs (the updates do not add new essential properties, so this change in Spack is backwards-compatible). With this update, Spack cannot modify existing configs/environments without updating them (e.g. “spack config add” will fail if the configuration is in a format that predates this PR). The user is prompted to do this explicitly and commands are provided. All config scopes can be updated at once. Each environment must be updated one at a time.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/find-externals1/package.py9
-rw-r--r--var/spack/repos/builtin/packages/mpich/package.py4
-rw-r--r--var/spack/repos/builtin/packages/mvapich2/package.py4
3 files changed, 9 insertions, 8 deletions
diff --git a/var/spack/repos/builtin.mock/packages/find-externals1/package.py b/var/spack/repos/builtin.mock/packages/find-externals1/package.py
index 25e26dcced..9f5f94aaab 100644
--- a/var/spack/repos/builtin.mock/packages/find-externals1/package.py
+++ b/var/spack/repos/builtin.mock/packages/find-externals1/package.py
@@ -2,12 +2,11 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack import *
-
import os
import re
+import spack.package
+
class FindExternals1(AutotoolsPackage):
executables = ['find-externals1-exe']
@@ -31,4 +30,6 @@ class FindExternals1(AutotoolsPackage):
match = re.search(r'find-externals1.*version\s+(\S+)', output)
if match:
version_str = match.group(1)
- return Spec('find-externals1@{0}'.format(version_str))
+ return Spec.from_detection(
+ 'find-externals1@{0}'.format(version_str)
+ )
diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py
index d967611fdd..85e884c8d3 100644
--- a/var/spack/repos/builtin/packages/mpich/package.py
+++ b/var/spack/repos/builtin/packages/mpich/package.py
@@ -187,7 +187,7 @@ spack package at this time.''',
# their run environments the code to make the compilers available.
# For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers.
# Cray MPIs always have cray in the module name, e.g. "cray-mpich"
- if self.spec.external_module and 'cray' in self.spec.external_module:
+ if self.spec.external_modules and 'cray' in self.spec.external_modules:
env.set('MPICC', spack_cc)
env.set('MPICXX', spack_cxx)
env.set('MPIF77', spack_fc)
@@ -210,7 +210,7 @@ spack package at this time.''',
def setup_dependent_package(self, module, dependent_spec):
# For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers.
# Cray MPIs always have cray in the module name, e.g. "cray-mpich"
- if self.spec.external_module and 'cray' in self.spec.external_module:
+ if self.spec.external_modules and 'cray' in self.spec.external_modules:
self.spec.mpicc = spack_cc
self.spec.mpicxx = spack_cxx
self.spec.mpifc = spack_fc
diff --git a/var/spack/repos/builtin/packages/mvapich2/package.py b/var/spack/repos/builtin/packages/mvapich2/package.py
index 0e0ab26a22..336f593806 100644
--- a/var/spack/repos/builtin/packages/mvapich2/package.py
+++ b/var/spack/repos/builtin/packages/mvapich2/package.py
@@ -235,7 +235,7 @@ class Mvapich2(AutotoolsPackage):
def setup_compiler_environment(self, env):
# For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers.
# Cray MPIs always have cray in the module name, e.g. "cray-mvapich"
- if self.spec.external_module and 'cray' in self.spec.external_module:
+ if self.spec.external_modules and 'cray' in self.spec.external_modules:
env.set('MPICC', spack_cc)
env.set('MPICXX', spack_cxx)
env.set('MPIF77', spack_fc)
@@ -249,7 +249,7 @@ class Mvapich2(AutotoolsPackage):
def setup_dependent_package(self, module, dependent_spec):
# For Cray MPIs, the regular compiler wrappers *are* the MPI wrappers.
# Cray MPIs always have cray in the module name, e.g. "cray-mvapich"
- if self.spec.external_module and 'cray' in self.spec.external_module:
+ if self.spec.external_modules and 'cray' in self.spec.external_modules:
self.spec.mpicc = spack_cc
self.spec.mpicxx = spack_cxx
self.spec.mpifc = spack_fc