From 67585fe13eb957e4722c72a66577625a593273aa Mon Sep 17 00:00:00 2001 From: rfbgo <109985755+rfbgo@users.noreply.github.com> Date: Thu, 27 Oct 2022 15:59:06 -0600 Subject: [PATCH] Add vasp variant to control shmem compile options (#33531) Currently the vasp package always enables the use of shmem to reduce algorithm memory usage (see https://www.vasp.at/wiki/index.php/Precompiler_options). This is great,but on some systems gives compile errors with the interoperability of C and Fortran. This PR makes that shmem flag optional, but retains the existing default on behavior. --- var/spack/repos/builtin/packages/vasp/package.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/vasp/package.py b/var/spack/repos/builtin/packages/vasp/package.py index 1706aa28439..eac1f0431ed 100644 --- a/var/spack/repos/builtin/packages/vasp/package.py +++ b/var/spack/repos/builtin/packages/vasp/package.py @@ -46,6 +46,8 @@ class Vasp(MakefilePackage): "https://github.com/henniggroup/VASPsol", ) + variant("shmem", default=True, description="Enable use_shmem build flag") + depends_on("rsync", type="build") depends_on("blas") depends_on("lapack") @@ -151,8 +153,11 @@ def setup_build_environment(self, spack_env): "-Davoidalloc", "-Duse_bse_te", "-Dtbdyn", - "-Duse_shmem", ] + + if "+shmem" in spec: + cpp_options.append("-Duse_shmem") + if "%nvhpc" in self.spec: cpp_options.extend(['-DHOST=\\"LinuxPGI\\"', "-DPGI16", "-Dqd_emulate"]) elif "%aocc" in self.spec: