lammps: compiler flags for Intel compiler on AMD zen+ procs (#31183)

Co-authored-by: Stephen Sachs <stesachs@amazon.com>
This commit is contained in:
Stephen Sachs 2022-06-30 15:25:41 +02:00 committed by GitHub
parent eec78f7702
commit e046dc3ca4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,8 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import datetime as dt import datetime as dt
import archspec
from spack.package import * from spack.package import *
@ -530,6 +532,13 @@ def cmake_args(self):
cxx_flags = '-Ofast -mfma -fvectorize -funroll-loops' cxx_flags = '-Ofast -mfma -fvectorize -funroll-loops'
args.append(self.define('CMAKE_CXX_FLAGS_RELEASE', cxx_flags)) args.append(self.define('CMAKE_CXX_FLAGS_RELEASE', cxx_flags))
# Overwrite generic cpu tune option
cmake_tune_flags = archspec.cpu.TARGETS[spec.target.name].optimization_flags(
spec.compiler.name,
spec.compiler.version
)
args.append(self.define('CMAKE_TUNE_FLAGS', cmake_tune_flags))
lammps_sizes = self.spec.variants['lammps_sizes'].value lammps_sizes = self.spec.variants['lammps_sizes'].value
args.append(self.define('LAMMPS_SIZES', lammps_sizes)) args.append(self.define('LAMMPS_SIZES', lammps_sizes))