diff options
author | AMD Toolchain Support <73240730+amd-toolchain-support@users.noreply.github.com> | 2021-10-14 17:33:15 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-14 12:03:15 +0000 |
commit | 8c1399ff7c7a45e607495df345a9d1b89d9691f7 (patch) | |
tree | a7a5518ebc65e02c9ba10ad572117d638288291d /var | |
parent | 2bc97f62fd27a8e755f21ab91bf56c1e99fa0838 (diff) | |
download | spack-8c1399ff7c7a45e607495df345a9d1b89d9691f7.tar.gz spack-8c1399ff7c7a45e607495df345a9d1b89d9691f7.tar.bz2 spack-8c1399ff7c7a45e607495df345a9d1b89d9691f7.tar.xz spack-8c1399ff7c7a45e607495df345a9d1b89d9691f7.zip |
LAMMPS: update recipe for %aocc (#26710)
* updating the recipe for betterment
* addressing the suggesions received from reviewers
* adding package helper macros
Co-authored-by: mohan002 <mohbabul@amd.com>
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/lammps/package.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/lammps/package.py b/var/spack/repos/builtin/packages/lammps/package.py index 619242fba7..52cf57ca91 100644 --- a/var/spack/repos/builtin/packages/lammps/package.py +++ b/var/spack/repos/builtin/packages/lammps/package.py @@ -196,6 +196,10 @@ class Lammps(CMakePackage, CudaPackage): if spec.satisfies('@20180629:+lib'): args.append('-DBUILD_LIB=ON') + if spec.satisfies('%aocc'): + cxx_flags = '-Ofast -mfma -fvectorize -funroll-loops' + args.append(self.define('CMAKE_CXX_FLAGS_RELEASE', cxx_flags)) + args.append(self.define_from_variant('WITH_JPEG', 'jpeg')) args.append(self.define_from_variant('WITH_PNG', 'png')) args.append(self.define_from_variant('WITH_FFMPEG', 'ffmpeg')) @@ -214,11 +218,14 @@ class Lammps(CMakePackage, CudaPackage): if '^mkl' in spec: args.append('-DFFT=MKL') if '^amdfftw' in spec: - fftw_prefix = spec['amdfftw'].prefix - args.append('-DFFTW_HOME={0}'.format(fftw_prefix)) - args.append('-DFFTW_INCLUDE_DIRS={0}' - .format(fftw_prefix.include)) - args.append('-DFFTW_LIBRARY_DIRS={0}'.format(fftw_prefix.lib)) + # If FFTW3 is selected, then CMake will try to detect, if threaded + # FFTW libraries are available and enable them by default. + args.append(self.define('FFT', 'FFTW3')) + # Using the -DFFT_SINGLE setting trades off a little accuracy + # for reduced memory use and parallel communication costs + # for transposing 3d FFT data. + args.append(self.define('FFT_SINGLE', True)) + if '+kokkos' in spec: args.append('-DEXTERNAL_KOKKOS=ON') if '+user-adios' in spec: |