diff options
author | Tiziano Müller <tiziano.mueller@chem.uzh.ch> | 2021-03-19 21:52:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-19 14:52:07 -0600 |
commit | 3305a39c5504453d0e6bf524e3920074eaedf81d (patch) | |
tree | f52c02f37ed277a495a86b93bb0f53991bc5fc59 /var | |
parent | 629f94b4e19d90496043e5ed4c1da44897f035e1 (diff) | |
download | spack-3305a39c5504453d0e6bf524e3920074eaedf81d.tar.gz spack-3305a39c5504453d0e6bf524e3920074eaedf81d.tar.bz2 spack-3305a39c5504453d0e6bf524e3920074eaedf81d.tar.xz spack-3305a39c5504453d0e6bf524e3920074eaedf81d.zip |
CP2K: update libxc dep, SIRIUS: update spla dep for 7+ (#22249)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/cp2k/package.py | 3 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/sirius/package.py | 118 |
2 files changed, 62 insertions, 59 deletions
diff --git a/var/spack/repos/builtin/packages/cp2k/package.py b/var/spack/repos/builtin/packages/cp2k/package.py index 79ec2ad727..1ce16336eb 100644 --- a/var/spack/repos/builtin/packages/cp2k/package.py +++ b/var/spack/repos/builtin/packages/cp2k/package.py @@ -94,7 +94,8 @@ class Cp2k(MakefilePackage, CudaPackage): depends_on('libxc@2.2.2:3.99.0', when='+libxc@:5.5999', type='build') depends_on('libxc@4.0.3:4.99.0', when='+libxc@6.0:6.9', type='build') - depends_on('libxc@4.0.3:4.99.0', when='+libxc@7.0:') + depends_on('libxc@4.0.3:4.99.0', when='+libxc@7.0:8.1') + depends_on('libxc@5.1.2', when='+libxc@9.0:') depends_on('mpi@2:', when='+mpi') depends_on('scalapack', when='+mpi') diff --git a/var/spack/repos/builtin/packages/sirius/package.py b/var/spack/repos/builtin/packages/sirius/package.py index 66af3015c5..8a229f0bb9 100644 --- a/var/spack/repos/builtin/packages/sirius/package.py +++ b/var/spack/repos/builtin/packages/sirius/package.py @@ -19,7 +19,9 @@ class Sirius(CMakePackage, CudaPackage): maintainers = ['simonpintarelli', 'haampie', 'dev-zero', 'AdhocMan'] version('develop', branch='develop') + version('master', branch='master') + version('7.0.2', sha256='ee613607ce3be0b2c3f69b560b2415ce1b0e015179002aa90739430dbfaa0389') version('7.0.0', sha256='da783df11e7b65668e29ba8d55c8a6827e2216ad6d88040f84f42ac20fd1bb99') version('6.5.7', sha256='d886c3066163c43666ebac2ea50351df03907b5686671e514a75f131ba51b43c', preferred=True) @@ -48,6 +50,10 @@ class Sirius(CMakePackage, CudaPackage): variant('shared', default=True, description="Build shared libraries") variant('openmp', default=True, description="Build with OpenMP support") + variant('boost_filesystem', default=False, + description="Use Boost filesystem for self-consistent field method " + "mini-app. Only required when the compiler does not " + "support std::experimental::filesystem nor std::filesystem") variant('fortran', default=False, description="Build Fortran bindings") variant('python', default=False, description="Build Python bindings") variant('memory_pool', default=True, description="Build with memory pool") @@ -61,6 +67,8 @@ class Sirius(CMakePackage, CudaPackage): variant('build_type', default='Release', description='CMake build type', values=('Debug', 'Release', 'RelWithDebInfo')) + variant('apps', default=True, description="Build applications") + variant('tests', default=False, description="Build tests") depends_on('python', type=('build', 'run')) depends_on('mpi') @@ -80,17 +88,15 @@ class Sirius(CMakePackage, CudaPackage): depends_on('py-voluptuous', when='+python', type=('build', 'run')) depends_on('py-pybind11', when='+python', type=('build', 'run')) depends_on('magma', when='+magma') + depends_on('boost cxxstd=14 +filesystem', when='+boost_filesystem') depends_on('spfft', when='@6.4.0:') - depends_on('spfft', when='@develop') depends_on('spfft+cuda', when='@6.4.0:+cuda') - depends_on('spfft+cuda', when='@develop+cuda') depends_on('spfft+rocm', when='@6.4.0:+rocm') - depends_on('spfft+rocm', when='@develop+rocm') - depends_on('spla@1.1.0:', when='@develop') - depends_on('spla@1.1.0:+cuda', when='@develop+cuda') - depends_on('spla@1.1.0:+rocm', when='@develop+rocm') + depends_on('spla@1.2.0:', when='@7.0.0:') + depends_on('spla+cuda', when='@7.0.0:+cuda') + depends_on('spla+rocm', when='@7.0.0:+rocm') depends_on('elpa+openmp', when='+elpa+openmp') depends_on('elpa~openmp', when='+elpa~openmp') @@ -110,6 +116,8 @@ class Sirius(CMakePackage, CudaPackage): extends('python', when='+python') conflicts('+shared', when='@6.3.0:6.4.999') + conflicts('+boost_filesystem', when='~apps') + conflicts('^libxc@5.0.0') # known to produce incorrect results # TODO: # add support for CRAY_LIBSCI, testing @@ -144,78 +152,72 @@ class Sirius(CMakePackage, CudaPackage): def cmake_args(self): spec = self.spec - def _def(variant, flag=None): - """Returns "-DUSE_VARIANT:BOOL={ON,OFF}" depending on whether - +variant is set. If the CMake flag differs from the variant - name, pass the flag name explicitly. - """ - - return "-D{0}:BOOL={1}".format( - flag if flag else "USE_{0}".format( - variant.strip('+~').upper() - ), - "ON" if variant in spec else "OFF" - ) - args = [ - _def('+openmp'), - _def('+elpa'), - _def('+magma'), - _def('+nlcglib'), - _def('+vdwxc'), - _def('+memory_pool'), - _def('+scalapack'), - _def('+fortran', 'CREATE_FORTRAN_BINDINGS'), - _def('+python', 'CREATE_PYTHON_MODULE'), - _def('+cuda'), - _def('+rocm') + self.define_from_variant('USE_OPENMP', 'openmp'), + self.define_from_variant('USE_ELPA', 'elpa'), + self.define_from_variant('USE_MAGMA', 'magma'), + self.define_from_variant('USE_NLCGLIB', 'nlcglib'), + self.define_from_variant('USE_VDWXC', 'vdwxc'), + self.define_from_variant('USE_MEMORY_POOL', 'memory_pool'), + self.define_from_variant('USE_SCALAPACK', 'scalapack'), + self.define_from_variant('CREATE_FORTRAN_BINDINGS', 'fortran'), + self.define_from_variant('CREATE_PYTHON_MODULE', 'python'), + self.define_from_variant('USE_CUDA', 'cuda'), + self.define_from_variant('USE_ROCM', 'rocm'), + self.define_from_variant('BUILD_TESTING', 'tests'), + self.define_from_variant('BUILD_APPS', 'apps'), + self.define_from_variant('BUILD_SHARED_LIBS', 'shared') ] - args += [_def('+shared', 'BUILD_SHARED_LIBS')] - lapack = spec['lapack'] blas = spec['blas'] - args += [ - '-DLAPACK_FOUND=true', - '-DLAPACK_LIBRARIES={0}'.format(lapack.libs.joined(';')), - '-DBLAS_FOUND=true', - '-DBLAS_LIBRARIES={0}'.format(blas.libs.joined(';')), - ] + args.extend([ + self.define('LAPACK_FOUND', 'true'), + self.define('LAPACK_LIBRARIES', lapack.libs.joined(';')), + self.define('BLAS_FOUND', 'true'), + self.define('BLAS_LIBRARIES', blas.libs.joined(';')) + ]) if '+scalapack' in spec: - args += [ - '-DSCALAPACK_FOUND=true', - '-DSCALAPACK_INCLUDE_DIRS={0}'.format( - spec['scalapack'].prefix.include), - '-DSCALAPACK_LIBRARIES={0}'.format( - spec['scalapack'].libs.joined(';')), - ] + args.extend([ + self.define('SCALAPACK_FOUND', 'true'), + self.define('SCALAPACK_INCLUDE_DIRS', + spec['scalapack'].prefix.include), + self.define('SCALAPACK_LIBRARIES', + spec['scalapack'].libs.joined(';')) + ]) if spec['blas'].name in ['intel-mkl', 'intel-parallel-studio']: - args += ['-DUSE_MKL=ON'] + args.append(self.define('USE_MKL', 'ON')) if '+elpa' in spec: elpa_incdir = os.path.join( spec['elpa'].headers.directories[0], 'elpa' ) - args += ["-DELPA_INCLUDE_DIR={0}".format(elpa_incdir)] - - cuda_arch = spec.variants['cuda_arch'].value - cuda_arch_selected = cuda_arch[0] != 'none' - if '+cuda' in spec and cuda_arch_selected: - cuda_args = '-DCUDA_ARCH={0}'.format(cuda_arch[0]) - if spec.satisfies('@:6.999'): - cuda_args = '-DCMAKE_CUDA_FLAGS=-arch=sm_{0}'.format( - cuda_arch[0]) - args.append(cuda_args) + args.append(self.define('ELPA_INCLUDE_DIR', elpa_incdir)) + + if '+cuda' in spec: + cuda_arch = spec.variants['cuda_arch'].value + if cuda_arch[0] != 'none': + # Specify a single arch directly + if '@:6' in spec: + args.append(self.define( + 'CMAKE_CUDA_FLAGS', + '-arch=sm_{0}'.format(cuda_arch[0])) + ) + + # Make SIRIUS handle it + else: + args.append(self.define('CUDA_ARCH', ';'.join(cuda_arch))) if '+rocm' in spec: archs = ",".join(self.spec.variants['amdgpu_target'].value) args.extend([ - '-DHIP_ROOT_DIR={0}'.format(spec['hip'].prefix), - '-DHIP_HCC_FLAGS=--amdgpu-target={0}'.format(archs) + self.define('HIP_ROOT_DIR', spec['hip'].prefix), + self.define('HIP_HCC_FLAGS', '--amdgpu-target={0}'.format(archs)), + self.define('HIP_CXX_COMPILER', self.spec['hip'].hipcc) ]) return args |