sirius: libxc 7 forward compat (#48663)

This commit is contained in:
Taillefumier Mathieu 2025-01-22 05:27:19 -05:00 committed by GitHub
parent 68af5cc4c0
commit e1e17786c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,16 @@
--- a/src/potential/xc_functional_base.hpp
+++ b/src/potential/xc_functional_base.hpp
@@ -15,6 +15,13 @@
#define __XC_FUNCTIONAL_BASE_HPP__
#include <xc.h>
+
+/* libxc >= 7 split the functional definition in a different file from xc.h */
+
+#if (XC_MAJOR_VERSION >= 7)
+#include <xc_funcs.h>
+#endif
+
#include <string.h>
#include <memory>
#include <map>

View File

@ -130,7 +130,7 @@ class Sirius(CMakePackage, CudaPackage, ROCmPackage):
depends_on("fftw-api@3")
depends_on("libxc@3.0.0:")
depends_on("libxc@4.0.0:", when="@7.2.0:")
depends_on("libxc@:6", when="@:7.6.1")
depends_on("libxc@:7", when="@:7.5")
depends_on("spglib")
depends_on("hdf5+hl")
depends_on("pkgconfig", type="build")
@ -164,6 +164,8 @@ class Sirius(CMakePackage, CudaPackage, ROCmPackage):
# spla removed the openmp option in 1.6.0
conflicts("^spla@:1.5~openmp", when="+openmp")
patch("libxc7.patch", when="@7.6:")
depends_on("nlcglib", when="+nlcglib")
depends_on("nlcglib+rocm", when="+nlcglib+rocm")
depends_on("nlcglib+cuda", when="+nlcglib+cuda")