diff options
author | AMD Toolchain Support <73240730+amd-toolchain-support@users.noreply.github.com> | 2020-11-26 20:37:56 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-26 09:07:56 -0600 |
commit | 3252fb05faf7b71f4d101161152a92207bc21c6a (patch) | |
tree | b73a31b9dda2f13ecb328475b61b6d57acfdd10a /var | |
parent | 03ff89fee60c012ca3698dadb7e15097cb5b06d0 (diff) | |
download | spack-3252fb05faf7b71f4d101161152a92207bc21c6a.tar.gz spack-3252fb05faf7b71f4d101161152a92207bc21c6a.tar.bz2 spack-3252fb05faf7b71f4d101161152a92207bc21c6a.tar.xz spack-3252fb05faf7b71f4d101161152a92207bc21c6a.zip |
spack recipe for gromacs with aocc compiler support (#19745)
* spack recipe for gromacs with aocc compiler support
Change-Id: I364aab4a0aa2dcd44bc47eb50c81b2d94c99cfbd
* Removed arch and other associated compilers flags
Added cycle_subcounters variant
Co-authored-by: vkallesh <Vijay-teekinavar.Kallesh@amd.com>
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/gromacs/package.py | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py index 73f4ffd871..0de3b539c4 100644 --- a/var/spack/repos/builtin/packages/gromacs/package.py +++ b/var/spack/repos/builtin/packages/gromacs/package.py @@ -2,6 +2,8 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) + + class Gromacs(CMakePackage): """GROMACS (GROningen MAchine for Chemical Simulations) is a molecular dynamics package primarily designed for simulations of proteins, lipids @@ -74,6 +76,10 @@ class Gromacs(CMakePackage): description='Use the hwloc portable hardware locality library') variant('lapack', default=False, description='Enables an external LAPACK library') + variant('blas', default=False, + description='Enables an external BLAS library') + variant('cycle_subcounters', default=False, + description='Enables cycle subcounters') depends_on('mpi', when='+mpi') # define matching plumed versions @@ -88,15 +94,17 @@ class Gromacs(CMakePackage): depends_on('plumed+mpi', when='+plumed+mpi') depends_on('plumed~mpi', when='+plumed~mpi') depends_on('fftw-api@3') + depends_on('mkl', when='fft=mkl') depends_on('cmake@2.8.8:3.99.99', type='build') depends_on('cmake@3.4.3:3.99.99', type='build', when='@2018:') depends_on('cmake@3.13.0:3.99.99', type='build', when='@master') depends_on('cmake@3.13.0:3.99.99', type='build', when='%fj') depends_on('cuda', when='+cuda') depends_on('lapack', when='+lapack') + depends_on('blas', when='+blas') # TODO: openmpi constraint; remove when concretizer is fixed - depends_on('hwloc@:1.999', when='+hwloc') + depends_on('hwloc@:1.999', when='@:3.0.0') patch('gmxDetectCpu-cmake-3.14.patch', when='@2018:2019.3^cmake@3.14.0:') patch('gmxDetectSimd-cmake-3.14.patch', when='@:2017.99^cmake@3.14.0:') @@ -148,11 +156,19 @@ class Gromacs(CMakePackage): if '+lapack' in self.spec: options.append('-DGMX_EXTERNAL_LAPACK:BOOL=ON') if self.spec['lapack'].libs: - options.append('-DLAPACK_LIBRARIES={0}'.format( + options.append('-DGMX_LAPACK_USER={0}'.format( self.spec['lapack'].libs.joined(';'))) else: options.append('-DGMX_EXTERNAL_LAPACK:BOOL=OFF') + if '+blas' in self.spec: + options.append('-DGMX_EXTERNAL_BLAS:BOOL=ON') + if self.spec['blas'].libs: + options.append('-DGMX_BLAS_USER={0}'.format( + self.spec['blas'].libs.joined(';'))) + else: + options.append('-DGMX_EXTERNAL_BLAS:BOOL=OFF') + # Activate SIMD based on properties of the target target = self.spec.target if target >= 'zen2': @@ -221,6 +237,11 @@ class Gromacs(CMakePackage): else: options.append('-DGMX_RELAXED_DOUBLE_PRECISION:BOOL=OFF') + if '+cycle_subcounters' in self.spec: + options.append('-DGMX_CYCLE_SUBCOUNTERS:BOOL=ON') + else: + options.append('-DGMX_CYCLE_SUBCOUNTERS:BOOL=OFF') + if '^mkl' in self.spec: # fftw-api@3 is provided by intel-mkl or intel-parllel-studio # we use the mkl interface of gromacs @@ -234,5 +255,13 @@ class Gromacs(CMakePackage): else: # we rely on the fftw-api@3 options.append('-DGMX_FFT_LIBRARY=fftw3') + if '^amdfftw' in self.spec: + options.append('-DGMX_FFT_LIBRARY=fftw3') + options.append( + '-DFFTWF_INCLUDE_DIRS={0}'. + format(self.spec['amdfftw'].headers.directories[0]) + ) + options.append('-DFFTWF_LIBRARIES={0}'. + format(self.spec['amdfftw'].libs.joined(';'))) return options |