From 5547f8f76b0475ebd3bb91043388b8b2274e1aab Mon Sep 17 00:00:00 2001 From: AsTonyshment Date: Tue, 18 Feb 2025 14:45:13 +0800 Subject: [PATCH 1/2] Fix: Resolve compilation issue with Libxc 7.0.0 in ABACUS --- source/module_hamilt_general/module_xc/xc_functional.h | 1 + source/module_hamilt_general/module_xc/xc_functional_libxc.h | 1 + 2 files changed, 2 insertions(+) diff --git a/source/module_hamilt_general/module_xc/xc_functional.h b/source/module_hamilt_general/module_xc/xc_functional.h index c0fbc91744..8228722c6f 100644 --- a/source/module_hamilt_general/module_xc/xc_functional.h +++ b/source/module_hamilt_general/module_xc/xc_functional.h @@ -7,6 +7,7 @@ #ifdef USE_LIBXC #include +#include #else #include "xc_funcs.h" #endif // ifdef USE_LIBXC diff --git a/source/module_hamilt_general/module_xc/xc_functional_libxc.h b/source/module_hamilt_general/module_xc/xc_functional_libxc.h index f206261076..12cf1fdd8e 100644 --- a/source/module_hamilt_general/module_xc/xc_functional_libxc.h +++ b/source/module_hamilt_general/module_xc/xc_functional_libxc.h @@ -7,6 +7,7 @@ #include "module_base/vector3.h" #include +#include #include #include From bcad3f7b9d7e2a7488ab7a7da4497953c7998621 Mon Sep 17 00:00:00 2001 From: AsTonyshment Date: Tue, 18 Feb 2025 17:33:24 +0800 Subject: [PATCH 2/2] Fix: Resolve compilation issue with Libxc 7.0.0 in ABACUS: fix a minor test issue (304_NO_GO_AF_atommag) --- source/module_hamilt_general/module_xc/xc_functional.h | 1 - .../module_xc/xc_functional_wrapper_xc.cpp | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/module_hamilt_general/module_xc/xc_functional.h b/source/module_hamilt_general/module_xc/xc_functional.h index 8228722c6f..c0fbc91744 100644 --- a/source/module_hamilt_general/module_xc/xc_functional.h +++ b/source/module_hamilt_general/module_xc/xc_functional.h @@ -7,7 +7,6 @@ #ifdef USE_LIBXC #include -#include #else #include "xc_funcs.h" #endif // ifdef USE_LIBXC diff --git a/source/module_hamilt_general/module_xc/xc_functional_wrapper_xc.cpp b/source/module_hamilt_general/module_xc/xc_functional_wrapper_xc.cpp index aa6927ea9a..972c324990 100644 --- a/source/module_hamilt_general/module_xc/xc_functional_wrapper_xc.cpp +++ b/source/module_hamilt_general/module_xc/xc_functional_wrapper_xc.cpp @@ -5,6 +5,10 @@ // 2. xc_spin, which is the spin polarized counterpart of xc // 3. xc_spin_libxc, which is the wrapper for LDA functional, spin polarized +#ifdef USE_LIBXC +#include +#endif // ifdef USE_LIBXC + #include "xc_functional.h" #include