summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Essman <68349992+joshessman-llnl@users.noreply.github.com>2020-11-19 14:03:22 -0600
committerGitHub <noreply@github.com>2020-11-19 14:03:22 -0600
commitf92e52cdc8219e974b6c1bfa017f4c16fc5025f3 (patch)
treee26758d2af619e1f64b6cf88a9798721e4ced2c9
parent16d5cc2c99d3b4aa8bfb54a4539edfcaa3a7633e (diff)
downloadspack-f92e52cdc8219e974b6c1bfa017f4c16fc5025f3.tar.gz
spack-f92e52cdc8219e974b6c1bfa017f4c16fc5025f3.tar.bz2
spack-f92e52cdc8219e974b6c1bfa017f4c16fc5025f3.tar.xz
spack-f92e52cdc8219e974b6c1bfa017f4c16fc5025f3.zip
mfem: Add support for AmgX, fix to version extensions (#19990)
* fix: leading . is not needed in extension kwarg * mfem: add support for NVIDIA AmgX fix: proper spacing * mfem: use conflict to indicate that AmgX is expected to depend on CUDA
-rw-r--r--var/spack/repos/builtin/packages/mfem/package.py36
1 files changed, 28 insertions, 8 deletions
diff --git a/var/spack/repos/builtin/packages/mfem/package.py b/var/spack/repos/builtin/packages/mfem/package.py
index c7f7e7e4d9..a04c5bb4ce 100644
--- a/var/spack/repos/builtin/packages/mfem/package.py
+++ b/var/spack/repos/builtin/packages/mfem/package.py
@@ -47,45 +47,45 @@ class Mfem(Package):
version('4.2.0',
'4352a225b55948d2e73a5ee88cece0e88bdbe7ba6726a23d68b2736d3221a86d',
- url='https://bit.ly/mfem-4-2', extension='.tar.gz',
+ url='https://bit.ly/mfem-4-2', extension='tar.gz',
preferred=True)
version('4.1.0',
'4c83fdcf083f8e2f5b37200a755db843cdb858811e25a8486ad36b2cbec0e11d',
- url='https://bit.ly/mfem-4-1', extension='.tar.gz')
+ url='https://bit.ly/mfem-4-1', extension='tar.gz')
# Tagged development version used by xSDK
version('4.0.1-xsdk', commit='c55c80d17b82d80de04b849dd526e17044f8c99a')
version('4.0.0',
'df5bdac798ea84a263979f6fbf79de9013e1c55562f95f98644c3edcacfbc727',
- url='https://bit.ly/mfem-4-0', extension='.tar.gz')
+ url='https://bit.ly/mfem-4-0', extension='tar.gz')
# Tagged development version used by the laghos package:
version('3.4.1-laghos-v2.0', tag='laghos-v2.0')
version('3.4.0',
sha256='4e73e4fe0482636de3c5dc983cd395839a83cb16f6f509bd88b053e8b3858e05',
- url='https://bit.ly/mfem-3-4', extension='.tar.gz')
+ url='https://bit.ly/mfem-3-4', extension='tar.gz')
version('3.3.2',
sha256='b70fa3c5080b9ec514fc05f4a04ff74322b99ac4ecd6d99c229f0ed5188fc0ce',
- url='https://goo.gl/Kd7Jk8', extension='.tar.gz')
+ url='https://goo.gl/Kd7Jk8', extension='tar.gz')
# Tagged development version used by the laghos package:
version('3.3.1-laghos-v1.0', tag='laghos-v1.0')
version('3.3',
sha256='b17bd452593aada93dc0fee748fcfbbf4f04ce3e7d77fdd0341cc9103bcacd0b',
- url='http://goo.gl/Vrpsns', extension='.tar.gz')
+ url='http://goo.gl/Vrpsns', extension='tar.gz')
version('3.2',
sha256='2938c3deed4ec4f7fd5b5f5cfe656845282e86e2dcd477d292390058b7b94340',
- url='http://goo.gl/Y9T75B', extension='.tar.gz')
+ url='http://goo.gl/Y9T75B', extension='tar.gz')
version('3.1',
sha256='841ea5cf58de6fae4de0f553b0e01ebaab9cd9c67fa821e8a715666ecf18fc57',
- url='http://goo.gl/xrScXn', extension='.tar.gz')
+ url='http://goo.gl/xrScXn', extension='tar.gz')
variant('static', default=True,
description='Build static library')
@@ -105,6 +105,7 @@ class Mfem(Package):
variant('raja', default=False, description='Enable RAJA backend')
variant('libceed', default=False, description='Enable libCEED backend')
variant('umpire', default=False, description='Enable Umpire support')
+ variant('amgx', default=False, description='Enable NVIDIA AmgX solver support')
variant('threadsafe', default=False,
description=('Enable thread safe features.'
@@ -174,6 +175,8 @@ class Mfem(Package):
conflicts('+raja', when='mfem@:3.99.99')
conflicts('+libceed', when='mfem@:4.0.99')
conflicts('+umpire', when='mfem@:4.0.99')
+ conflicts('+amgx', when='mfem@:4.1.99')
+ conflicts('+amgx', when='~cuda')
conflicts('+superlu-dist', when='~mpi')
conflicts('+strumpack', when='~mpi')
@@ -246,6 +249,13 @@ class Mfem(Package):
depends_on('umpire@2.0.0:', when='+umpire')
depends_on('umpire+cuda', when='+umpire+cuda')
+ depends_on('amgx', when='+amgx')
+ # MPI is enabled by default
+ depends_on('amgx~mpi', when='+amgx~mpi')
+ for sm_ in CudaPackage.cuda_arch_values:
+ depends_on('amgx cuda_arch={0}'.format(sm_),
+ when='+amgx cuda_arch=sm_{0}'.format(sm_))
+
patch('mfem_ppc_build.patch', when='@3.2:3.3.0 arch=ppc64le')
patch('mfem-3.4.patch', when='@3.4.0')
patch('mfem-3.3-3.4-petsc-3.9.patch',
@@ -363,6 +373,7 @@ class Mfem(Package):
'MFEM_USE_CUDA=%s' % yes_no('+cuda'),
'MFEM_USE_OCCA=%s' % yes_no('+occa'),
'MFEM_USE_RAJA=%s' % yes_no('+raja'),
+ 'MFEM_USE_AMGX=%s' % yes_no('+amgx'),
'MFEM_USE_CEED=%s' % yes_no('+libceed'),
'MFEM_USE_UMPIRE=%s' % yes_no('+umpire')]
@@ -569,6 +580,15 @@ class Mfem(Package):
ld_flags_from_dirs([spec['raja'].prefix.lib],
['RAJA'])]
+ if '+amgx' in spec:
+ amgx = spec['amgx']
+ if '+shared' in amgx:
+ options += ['AMGX_OPT=-I%s' % amgx.prefix.include,
+ 'AMGX_LIB=%s' %
+ ld_flags_from_library_list(amgx.libs)]
+ else:
+ options += ['AMGX_DIR=%s' % amgx.prefix]
+
if '+libceed' in spec:
options += ['CEED_OPT=-I%s' % spec['libceed'].prefix.include,
'CEED_LIB=%s' %