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>
This commit is contained in:
AMD Toolchain Support 2021-10-14 17:33:15 +05:30 committed by GitHub
parent 2bc97f62fd
commit 8c1399ff7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -196,6 +196,10 @@ def cmake_args(self):
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 @@ def cmake_args(self):
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: