Update CP2K recipe for AOCC compiler (#46985)
This commit is contained in:
parent
cbdc07248f
commit
b573ec3920
@ -188,9 +188,10 @@ class Cp2k(MakefilePackage, CMakePackage, CudaPackage, ROCmPackage):
|
|||||||
with when("+libint"):
|
with when("+libint"):
|
||||||
depends_on("pkgconfig", type="build", when="@7.0:")
|
depends_on("pkgconfig", type="build", when="@7.0:")
|
||||||
for lmax in HFX_LMAX_RANGE:
|
for lmax in HFX_LMAX_RANGE:
|
||||||
|
depends_on(f"libint@2.6.0:+fortran tune=cp2k-lmax-{lmax}", when=f"@7.0: lmax={lmax}")
|
||||||
|
# AOCC only works with libint@2.6.0
|
||||||
depends_on(
|
depends_on(
|
||||||
"libint@2.6.0:+fortran tune=cp2k-lmax-{0}".format(lmax),
|
f"libint@=2.6.0+fortran tune=cp2k-lmax-{lmax}", when=f"@7.0: lmax={lmax} %aocc"
|
||||||
when="@7.0: lmax={0}".format(lmax),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
with when("+libxc"):
|
with when("+libxc"):
|
||||||
@ -305,6 +306,9 @@ class Cp2k(MakefilePackage, CMakePackage, CudaPackage, ROCmPackage):
|
|||||||
depends_on("hipblas")
|
depends_on("hipblas")
|
||||||
depends_on("hipfft")
|
depends_on("hipfft")
|
||||||
|
|
||||||
|
# The CMake build system and AOCC are not compatible as of AOCC 5
|
||||||
|
requires("build_system=makefile", when="%aocc")
|
||||||
|
|
||||||
# CP2K needs compiler specific compilation flags, e.g. optflags
|
# CP2K needs compiler specific compilation flags, e.g. optflags
|
||||||
conflicts("%apple-clang")
|
conflicts("%apple-clang")
|
||||||
conflicts("%clang")
|
conflicts("%clang")
|
||||||
@ -827,6 +831,12 @@ def fflags(var, lst):
|
|||||||
if spec.satisfies("%intel"):
|
if spec.satisfies("%intel"):
|
||||||
mkf.write(fflags("LDFLAGS_C", ldflags + ["-nofor-main"]))
|
mkf.write(fflags("LDFLAGS_C", ldflags + ["-nofor-main"]))
|
||||||
|
|
||||||
|
if spec.satisfies("%aocc@5:"):
|
||||||
|
# ensure C based applications can be build properly
|
||||||
|
mkf.write(fflags("LDFLAGS_C", ldflags + ["-fno-fortran-main"]))
|
||||||
|
# This flag is required for the correct runtime behaviour of the code with aocc@5.0
|
||||||
|
mkf.write(fflags("FCFLAGS", fcflags + ["-mllvm -enable-newgvn=true"]))
|
||||||
|
|
||||||
mkf.write("# CP2K-specific flags\n\n")
|
mkf.write("# CP2K-specific flags\n\n")
|
||||||
mkf.write("GPUVER = {0}\n".format(gpuver))
|
mkf.write("GPUVER = {0}\n".format(gpuver))
|
||||||
mkf.write("DATA_DIR = {0}\n".format(prefix.share.data))
|
mkf.write("DATA_DIR = {0}\n".format(prefix.share.data))
|
||||||
|
Loading…
Reference in New Issue
Block a user