Skip to content

Fix: Fix LibXC 7.x build after the XC gradient split - #7884

Open
AsTonyshment wants to merge 1 commit into
deepmodeling:developfrom
AsTonyshment:fix/libxc-xc-grad-include
Open

Fix: Fix LibXC 7.x build after the XC gradient split#7884
AsTonyshment wants to merge 1 commit into
deepmodeling:developfrom
AsTonyshment:fix/libxc-xc-grad-include

Conversation

@AsTonyshment

Copy link
Copy Markdown
Collaborator

Summary

PR #7873, Split some large files (fs_nonlocal_tools.cpp, onsite_proj.cpp, to_wannier90_lcao.cpp, etc.) into smaller ones, removed the indirect libxc_abacus.h include from xc_grad.cpp while splitting the XC gradient implementation. However, XC_Functional::gradcorr() still uses the LibXC functional ID XC_GGA_C_LYP.

With LibXC 7.1.2, xc.h does not define functional IDs; they are provided by xc_funcs.h. Consequently, builds with ENABLE_LIBXC=ON fail because XC_GGA_C_LYP is undefined.

This PR conditionally includes xc_funcs.h when __LIBXC is enabled. The change restores the missing direct dependency without altering runtime or numerical behavior.

@AsTonyshment
AsTonyshment requested a review from mohanchen August 31, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant