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>
This commit is contained in:
AMD Toolchain Support 2020-11-26 20:37:56 +05:30 committed by GitHub
parent 03ff89fee6
commit 3252fb05fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 @@ def cmake_args(self):
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 @@ def cmake_args(self):
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 @@ def cmake_args(self):
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