libvdwxc: unbreak concretization, request fftw-api (#18688)
* libvdwxc: unbreak concretization, request fftw-api mixing both fftw and fftw-api in a dependency tree can trigger the following: ``` $ spack spec cp2k@master +sirius ==> [2020-09-16-12:36:06.552981] sirius applying constraint gsl ==> [2020-09-16-12:36:06.554270] sirius applying constraint openblas@0.3.10%gcc@7.5.0~consistent_fpcsr~ilp64+pic+shared threads=none arch=linux-opensuse_leap15-sandybridge Traceback (most recent call last): File "./bin/spack", line 64, in <module> sys.exit(spack.main.main()) File "/data/tiziano/debug-spack/spack2/lib/spack/spack/main.py", line 762, in main return _invoke_command(command, parser, args, unknown) File "/data/tiziano/debug-spack/spack2/lib/spack/spack/main.py", line 490, in _invoke_command return_val = command(parser, args) File "/data/tiziano/debug-spack/spack2/lib/spack/spack/cmd/spec.py", line 103, in spec spec.concretize() File "/data/tiziano/debug-spack/spack2/lib/spack/spack/spec.py", line 2228, in concretize user_spec_deps=user_spec_deps), File "/data/tiziano/debug-spack/spack2/lib/spack/spack/spec.py", line 2716, in normalize visited, all_spec_deps, provider_index, tests) File "/data/tiziano/debug-spack/spack2/lib/spack/spack/spec.py", line 2654, in _normalize_helper dep, visited, spec_deps, provider_index, tests) File "/data/tiziano/debug-spack/spack2/lib/spack/spack/spec.py", line 2613, in _merge_dependency visited, spec_deps, provider_index, tests) File "/data/tiziano/debug-spack/spack2/lib/spack/spack/spec.py", line 2654, in _normalize_helper dep, visited, spec_deps, provider_index, tests) File "/data/tiziano/debug-spack/spack2/lib/spack/spack/spec.py", line 2554, in _merge_dependency provider = self._find_provider(dep, provider_index) File "/data/tiziano/debug-spack/spack2/lib/spack/spack/spec.py", line 2489, in _find_provider providers = provider_index.providers_for(vdep) File "/data/tiziano/debug-spack/spack2/lib/spack/spack/provider_index.py", line 80, in providers_for return sorted(s.copy() for s in result) File "/data/tiziano/debug-spack/spack2/lib/spack/llnl/util/lang.py", line 249, in <lambda> lambda s, o: o is not None and s._cmp_key() < o._cmp_key()) TypeError: '<' not supported between instances of 'str' and 'NoneType' ``` while at the same point disallowing MKL as a fftw provider. Solving both issues by depending on `fftw-api@3` instead and adding a conflict on `^fftw~mpi` when using `+mpi` (thanks to alalazo). * cp2k: use conflicts instead of runtime checks for fftw/openblas variants
This commit is contained in:
parent
cb218058bc
commit
0d5c065678
@ -154,6 +154,10 @@ class Cp2k(MakefilePackage, CudaPackage):
|
||||
# cp2k with option smm=blas on aarch64
|
||||
conflicts('smm=libxsmm', when='target=aarch64:', msg='libxsmm is not available on arm')
|
||||
|
||||
conflicts('^fftw~openmp', when='+openmp')
|
||||
conflicts('^openblas threads=none', when='+openmp')
|
||||
conflicts('^openblas threads=pthreads', when='+openmp')
|
||||
|
||||
conflicts('~openmp', when='@8:', msg='Building without OpenMP is not supported in CP2K 8+')
|
||||
|
||||
@property
|
||||
@ -178,31 +182,7 @@ def makefile(self):
|
||||
def archive_files(self):
|
||||
return [os.path.join(self.stage.source_path, self.makefile)]
|
||||
|
||||
def consistency_check(self, spec):
|
||||
"""
|
||||
Consistency checks.
|
||||
Due to issue #1712 we can not put them into depends_on/conflicts.
|
||||
"""
|
||||
|
||||
if '+openmp' in spec:
|
||||
if '^openblas' in spec and '^openblas threads=openmp' not in spec:
|
||||
raise InstallError(
|
||||
'^openblas threads=openmp required for cp2k+openmp'
|
||||
' with openblas')
|
||||
|
||||
if '^fftw' in spec and '^fftw +openmp' not in spec:
|
||||
raise InstallError(
|
||||
'^fftw +openmp required for cp2k+openmp'
|
||||
' with fftw')
|
||||
|
||||
# MKL doesn't need to be checked since they are
|
||||
# OMP thread-safe when using mkl_sequential
|
||||
# BUT: we should check the version of MKL IF it is used for FFTW
|
||||
# since there we need at least v14 of MKL to be safe!
|
||||
|
||||
def edit(self, spec, prefix):
|
||||
self.consistency_check(spec)
|
||||
|
||||
pkgconf = which('pkg-config')
|
||||
|
||||
if '^fftw' in spec:
|
||||
|
@ -19,13 +19,13 @@ class Libvdwxc(AutotoolsPackage):
|
||||
variant("mpi", default=True, description="Enable MPI support")
|
||||
variant("pfft", default=False, description="Enable support for PFFT")
|
||||
|
||||
depends_on("fftw@3:", when="~mpi")
|
||||
depends_on("fftw-api@3")
|
||||
depends_on("mpi@2:", when="+mpi")
|
||||
depends_on("fftw@3:+mpi", when="+mpi")
|
||||
depends_on("pfft", when="+pfft")
|
||||
|
||||
# pfft needs MPI
|
||||
conflicts("~mpi", "+pfft")
|
||||
conflicts("^fftw~mpi", "+mpi")
|
||||
|
||||
def configure_args(self):
|
||||
spec = self.spec
|
||||
|
Loading…
Reference in New Issue
Block a user