diff options
author | Scott McMillan <scott.andrew.mcmillan@gmail.com> | 2020-10-22 16:42:48 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-22 16:42:48 -0500 |
commit | 0015dd0bf8ff16344a18185f11d565fbf7094b0e (patch) | |
tree | 1a62ff38711fbe69cfbe57b6ed1d53cf6c98aff7 /var/spack/repos/builtin/packages/amber/package.py | |
parent | fd3dbb24932f0971fbf3dfd4ce545eb6c64cb913 (diff) | |
download | spack-0015dd0bf8ff16344a18185f11d565fbf7094b0e.tar.gz spack-0015dd0bf8ff16344a18185f11d565fbf7094b0e.tar.bz2 spack-0015dd0bf8ff16344a18185f11d565fbf7094b0e.tar.xz spack-0015dd0bf8ff16344a18185f11d565fbf7094b0e.zip |
Enable packages to use the NVIDIA HPC SDK (#19452)
* Enable packages to use the NVIDIA HPC SDK
* fix linter and review items
* fix linter issue
Co-authored-by: Scott McMillan <smcmillan@nvidia.com>
Diffstat (limited to 'var/spack/repos/builtin/packages/amber/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/amber/package.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/amber/package.py b/var/spack/repos/builtin/packages/amber/package.py index 9b772e0a6a..797d708fbc 100644 --- a/var/spack/repos/builtin/packages/amber/package.py +++ b/var/spack/repos/builtin/packages/amber/package.py @@ -91,6 +91,19 @@ class Amber(Package, CudaPackage): patch(patch_url_str.format(ver, num), sha256=checksum, level=0, when='@{0}'.format(ver)) + # Patch to add ppc64le in config.guess + patch('ppc64le.patch', when='@18.20') + + # Patch to add aarch64 in config.guess + patch('aarch64.patch', when='@18.20') + + # Workaround to modify the AmberTools script when using the NVIDIA + # compilers + patch('nvhpc.patch', when='@18.20 %nvhpc') + + # Workaround to use NVIDIA compilers to build the bundled Boost + patch('nvhpc-boost.patch', when='@18.20 %nvhpc') + variant('mpi', description='Build MPI executables', default=True) variant('openmp', description='Use OpenMP pragmas to parallelize', @@ -101,6 +114,7 @@ class Amber(Package, CudaPackage): default=False) depends_on('zlib') + depends_on('bzip2') depends_on('flex', type='build') depends_on('bison', type='build') depends_on('netcdf-fortran') @@ -125,6 +139,12 @@ class Amber(Package, CudaPackage): def setup_build_environment(self, env): amber_src = self.stage.source_path env.set('AMBERHOME', amber_src) + + # The bundled Boost does not detect the bzip2 package, but + # will silently fall back to a system install (if available). + # Force it to use the bzip2 package. + env.prepend_path('CPATH', self.spec['bzip2'].prefix.include) + # CUDA if self.spec.satisfies('+cuda'): env.set('CUDA_HOME', self.spec['cuda'].prefix) @@ -146,6 +166,8 @@ class Amber(Package, CudaPackage): compiler = 'intel' elif self.spec.satisfies('%pgi'): compiler = 'pgi' + elif self.spec.satisfies('%nvhpc'): + compiler = 'pgi' elif self.spec.satisfies('%clang'): compiler = 'clang' else: @@ -166,6 +188,10 @@ class Amber(Package, CudaPackage): else: base_args += ['--no-updates'] + # Non-x86 architecture + if self.spec.target.family != 'x86_64': + base_args += ['-nosse'] + # Single core conf(*(base_args + [compiler])) make('install') |