summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/amrex/package.py
diff options
context:
space:
mode:
authoreugeneswalker <38933153+eugeneswalker@users.noreply.github.com>2021-02-26 13:53:31 -0800
committerGitHub <noreply@github.com>2021-02-26 13:53:31 -0800
commit590457cf7fa82ac09d13e1fd7ae91d39a80cffc9 (patch)
treea9d77cb531ec72b48bbfd5c2d052b37ce2aa4c4c /var/spack/repos/builtin/packages/amrex/package.py
parent2fd8612f211995323a7ebf82693734975a890a70 (diff)
downloadspack-590457cf7fa82ac09d13e1fd7ae91d39a80cffc9.tar.gz
spack-590457cf7fa82ac09d13e1fd7ae91d39a80cffc9.tar.bz2
spack-590457cf7fa82ac09d13e1fd7ae91d39a80cffc9.tar.xz
spack-590457cf7fa82ac09d13e1fd7ae91d39a80cffc9.zip
amrex: use right cmake_args for @develop; depends_on(hypre) for link (#21892)
* amrex package: use right cmake_args for @develop; depends_on(hypre) * add explicit depends_on for petsc, for link, when +petsc
Diffstat (limited to 'var/spack/repos/builtin/packages/amrex/package.py')
-rw-r--r--var/spack/repos/builtin/packages/amrex/package.py76
1 files changed, 39 insertions, 37 deletions
diff --git a/var/spack/repos/builtin/packages/amrex/package.py b/var/spack/repos/builtin/packages/amrex/package.py
index de22be8687..e4cf189057 100644
--- a/var/spack/repos/builtin/packages/amrex/package.py
+++ b/var/spack/repos/builtin/packages/amrex/package.py
@@ -83,6 +83,8 @@ class Amrex(CMakePackage, CudaPackage, ROCmPackage):
depends_on('cmake@3.17:', type='build', when='^cuda @11:')
depends_on('hdf5@1.10.4: +mpi', when='+hdf5')
depends_on('rocrand', type='build', when='+rocm')
+ depends_on('hypre', type='link', when='+hypre')
+ depends_on('petsc', type='link', when='+petsc')
conflicts('%apple-clang')
conflicts('%clang')
@@ -134,45 +136,9 @@ class Amrex(CMakePackage, CudaPackage, ROCmPackage):
return ';'.join(str(x) for x in vf)
#
- # For versions <= 20.11
- #
- @when('@:20.11')
- def cmake_args(self):
- args = [
- '-DUSE_XSDK_DEFAULTS=ON',
- self.define_from_variant('DIM', 'dimensions'),
- self.define_from_variant('BUILD_SHARED_LIBS', 'shared'),
- self.define_from_variant('ENABLE_MPI', 'mpi'),
- self.define_from_variant('ENABLE_OMP', 'openmp'),
- '-DXSDK_PRECISION:STRING=%s' %
- self.spec.variants['precision'].value.upper(),
- self.define_from_variant('XSDK_ENABLE_Fortran', 'fortran'),
- self.define_from_variant('ENABLE_FORTRAN_INTERFACES', 'fortran'),
- self.define_from_variant('ENABLE_EB', 'eb'),
- self.define_from_variant('ENABLE_LINEAR_SOLVERS',
- 'linear_solvers'),
- self.define_from_variant('ENABLE_AMRDATA', 'amrdata'),
- self.define_from_variant('ENABLE_PARTICLES', 'particles'),
- self.define_from_variant('ENABLE_SUNDIALS', 'sundials'),
- self.define_from_variant('ENABLE_HDF5', 'hdf5'),
- self.define_from_variant('ENABLE_HYPRE', 'hypre'),
- self.define_from_variant('ENABLE_PETSC', 'petsc'),
- self.define_from_variant('ENABLE_CUDA', 'cuda'),
- ]
-
- if self.spec.satisfies('%fj'):
- args.append('-DCMAKE_Fortran_MODDIR_FLAG=-M')
-
- if '+cuda' in self.spec:
- cuda_arch = self.spec.variants['cuda_arch'].value
- args.append('-DCUDA_ARCH=' + self.get_cuda_arch_string(cuda_arch))
-
- return args
-
- #
# For versions > 20.11
#
- @when('@20.12:')
+ @when('@20.12:,develop')
def cmake_args(self):
args = [
'-DUSE_XSDK_DEFAULTS=ON',
@@ -212,3 +178,39 @@ class Amrex(CMakePackage, CudaPackage, ROCmPackage):
args.append('-DAMReX_AMD_ARCH=' + ';'.join(str(x) for x in targets))
return args
+
+ #
+ # For versions <= 20.11
+ #
+ @when('@:20.11')
+ def cmake_args(self):
+ args = [
+ '-DUSE_XSDK_DEFAULTS=ON',
+ self.define_from_variant('DIM', 'dimensions'),
+ self.define_from_variant('BUILD_SHARED_LIBS', 'shared'),
+ self.define_from_variant('ENABLE_MPI', 'mpi'),
+ self.define_from_variant('ENABLE_OMP', 'openmp'),
+ '-DXSDK_PRECISION:STRING=%s' %
+ self.spec.variants['precision'].value.upper(),
+ self.define_from_variant('XSDK_ENABLE_Fortran', 'fortran'),
+ self.define_from_variant('ENABLE_FORTRAN_INTERFACES', 'fortran'),
+ self.define_from_variant('ENABLE_EB', 'eb'),
+ self.define_from_variant('ENABLE_LINEAR_SOLVERS',
+ 'linear_solvers'),
+ self.define_from_variant('ENABLE_AMRDATA', 'amrdata'),
+ self.define_from_variant('ENABLE_PARTICLES', 'particles'),
+ self.define_from_variant('ENABLE_SUNDIALS', 'sundials'),
+ self.define_from_variant('ENABLE_HDF5', 'hdf5'),
+ self.define_from_variant('ENABLE_HYPRE', 'hypre'),
+ self.define_from_variant('ENABLE_PETSC', 'petsc'),
+ self.define_from_variant('ENABLE_CUDA', 'cuda'),
+ ]
+
+ if self.spec.satisfies('%fj'):
+ args.append('-DCMAKE_Fortran_MODDIR_FLAG=-M')
+
+ if '+cuda' in self.spec:
+ cuda_arch = self.spec.variants['cuda_arch'].value
+ args.append('-DCUDA_ARCH=' + self.get_cuda_arch_string(cuda_arch))
+
+ return args