summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Alexis Paz <alexis.paz@gmail.com>2023-11-29 17:16:27 -0300
committerGitHub <noreply@github.com>2023-11-29 12:16:27 -0800
commit3987604b8910f8d90d4696e1c0b7e4c0dd0a3308 (patch)
treec804818c10860c0924ce8b74d7a2225590e3a5ea
parentb6f8cb821c7595b054cb03c57fc654a0fa447d8c (diff)
downloadspack-3987604b8910f8d90d4696e1c0b7e4c0dd0a3308.tar.gz
spack-3987604b8910f8d90d4696e1c0b7e4c0dd0a3308.tar.bz2
spack-3987604b8910f8d90d4696e1c0b7e4c0dd0a3308.tar.xz
spack-3987604b8910f8d90d4696e1c0b7e4c0dd0a3308.zip
Add gipaw when building quantum-espresso with cmake (#41142)
* gipaw.x installed by cmake if version >= 5c4a4ce. gipaw.x will only be installed with cmake if the qe-gipaw version is >= 5c4a4ce. Currently, QE source uses the older f5823521 one. Here a patch to the submodule_commit_hash_records to use a newer qe-gipaw version.
-rw-r--r--var/spack/repos/builtin/packages/quantum-espresso/gipaw-eccee44.patch8
-rw-r--r--var/spack/repos/builtin/packages/quantum-espresso/package.py21
2 files changed, 24 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/quantum-espresso/gipaw-eccee44.patch b/var/spack/repos/builtin/packages/quantum-espresso/gipaw-eccee44.patch
new file mode 100644
index 0000000000..e2d8179010
--- /dev/null
+++ b/var/spack/repos/builtin/packages/quantum-espresso/gipaw-eccee44.patch
@@ -0,0 +1,8 @@
+--- spack-src/external/submodule_commit_hash_records.org 2023-11-15 18:38:47.485317449 -0300
++++ spack-src/external/submodule_commit_hash_records 2023-11-15 18:39:02.661861757 -0300
+@@ -5,4 +5,4 @@
+ 82005cbb65bdf5d32ca021848eec8f19da956a77 mbd
+ f72ab25fa4ea755c1b4b230ae8074b47d5509c70 pw2qmcpack
+ 1d6b187374a2d50b509e5e79e2cab01a79ff7ce1 wannier90
+-f5823521ad8fdd8b8e9e29197eedb354f9b9146d qe-gipaw
++eccee44d3caf1c930fb72ad9c741fbb743eabf45 qe-gipaw
diff --git a/var/spack/repos/builtin/packages/quantum-espresso/package.py b/var/spack/repos/builtin/packages/quantum-espresso/package.py
index 40c036320d..dacf771f60 100644
--- a/var/spack/repos/builtin/packages/quantum-espresso/package.py
+++ b/var/spack/repos/builtin/packages/quantum-espresso/package.py
@@ -227,13 +227,8 @@ class QuantumEspresso(CMakePackage, Package):
variant(
"gipaw",
default=False,
- when="build_system=generic",
description="Builds Gauge-Including Projector Augmented-Waves executable",
)
- with when("+gipaw"):
- conflicts(
- "@:6.3", msg="gipaw standard support available for QE 6.3 or grater version only"
- )
# Dependencies not affected by variants
depends_on("blas")
@@ -260,6 +255,15 @@ class QuantumEspresso(CMakePackage, Package):
# NOTE: *SOME* third-party patches will require deactivation of
# upstream patches using `~patch` variant
+ # gipaw
+ conflicts(
+ "@:6.2",
+ when="+gipaw",
+ msg="gipaw standard support available for QE 6.3 or grater version only",
+ )
+
+ conflicts("+gipaw build_system=cmake", when="@:7.1")
+
# Only CMake will work for @6.8: %aocc
conflicts(
"build_system=generic", when="@6.8: %aocc", msg="Please use CMake to build with AOCC"
@@ -400,6 +404,9 @@ class QuantumEspresso(CMakePackage, Package):
# extlibs_makefile updated to work with fujitsu compilers
patch("fj-fox.patch", when="+patch %fj")
+ # gipaw.x will only be installed with cmake if the qe-gipaw version is >= 5c4a4ce.
+ patch("gipaw-eccee44.patch", when="@7.2+gipaw build_system=cmake")
+
class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder):
def cmake_args(self):
@@ -416,6 +423,10 @@ class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder):
self.define_from_variant("QE_ENABLE_MPI_GPU_AWARE", "mpigpu"),
]
+ if "+gipaw" in spec:
+ cmake_args.append(self.define("QE_ENABLE_PLUGINS", "gipaw"))
+ cmake_args.append(self.define("QE_ENABLE_FOX", True))
+
if "+cuda" in self.spec:
cmake_args.append(self.define("QE_ENABLE_OPENACC", True))