Skip to content

Fix FindLibxc.cmake to use /usr/include as include directory#3771

Merged
caic99 merged 1 commit intodeepmodeling:developfrom
yizeyi18:pkgconf-usr-include
Mar 23, 2024
Merged

Fix FindLibxc.cmake to use /usr/include as include directory#3771
caic99 merged 1 commit intodeepmodeling:developfrom
yizeyi18:pkgconf-usr-include

Conversation

@yizeyi18
Copy link

pkg-config would ignore flags like -I/usr/include in cflags; as ${prefix}_INCLUDE_DIRS is initialized from pkg-config --cflags-only-I ${pkgname}, it would be empty as only -I/usr/include in cflags. However, under this situation, cmake would still mark ${prefix}_FOUND as true, and without these global-visible includes no compilation issues arise; thus, this commit turns off detect of Libxc_INCLUDE_DIRS, and use Libxc_found instead.

Reminder

  • Have you linked an issue with this pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

Fix #3761

What's changed?

  • Changed filter condition of find_package_handle_standard_args in cmake/FindLibxc.cmake.

Any changes of core modules? (ignore if not applicable)

No.

pkg-config would ignore flags like '-I/usr/include' in cflags; as ${prefix}_INCLUDE_DIRS is initialized from `pkg-config --cflags-only-I ${pkgname}`, it would be empty as only -I/usr/include in cflags. However, under this situation, cmake would still mark ${prefix}_FOUND as true, and without these global-visible includes no compilation issues arise; thus, this commit turns off detect of Libxc_INCLUDE_DIRS, and use Libxc_found instead.
@jinzx10 jinzx10 mentioned this pull request Mar 22, 2024
10 tasks
@caic99 caic99 merged commit 2cc4cf8 into deepmodeling:develop Mar 23, 2024
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.

Fails to find Libxc

2 participants