forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 141
Build: Improving CMake performance for finding LibXC and ELPA #3478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e6ebf07
Fix for finding LibXC and ELPA
yizeyi18 b43112b
For compatibility to previous routines
yizeyi18 e8d46c4
syntax fix for FindELPA.cmake
yizeyi18 283b67f
Update cmake/FindELPA.cmake
yizeyi18 f9e3642
Using CMake interface as default for finding LibXC
yizeyi18 50f8766
Merge branch 'develop' of https://github.com/yizeyi18/abacus-develop …
yizeyi18 660d390
update docs
yizeyi18 7bd18db
fix for FindLibxc: changing imcompatible if statement
yizeyi18 ab0ab5a
fix for FindLibxc: changing imcompatible if statement
yizeyi18 f887d41
fix for FindLibxc: changing imcompatible if statement
yizeyi18 7cdd7b4
update docs for installing pkg-config
yizeyi18 3ce7ac6
Update FindLibxc.cmake
caic99 e843819
Update FindLibxc.cmake
caic99 821977d
remove previous LibXC routine in CMakeLists.txt
yizeyi18 a9cbf70
Update easy_install.md with Makefile-built LibXC supported
yizeyi18 3eb0e2f
Update easy_install.md to include different behavior in different ver…
yizeyi18 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
include(FindPackageHandleStandardArgs) | ||
|
||
if(DEFINED Libxc_DIR) | ||
string(APPEND CMAKE_PREFIX_PATH ";${Libxc_DIR}") | ||
endif() | ||
# Using CMake interface as default. | ||
# NO REQUIRED here, otherwhile it would throw error | ||
# with no LibXC found. | ||
find_package(Libxc HINTS | ||
${Libxc_DIR}/share/cmake/Libxc | ||
${Libxc_DIR}/lib/cmake/Libxc | ||
${Libxc_DIR}/lib64/cmake/Libxc | ||
) | ||
if(NOT TARGET Libxc::xc) | ||
find_package(PkgConfig REQUIRED) | ||
pkg_search_module(Libxc REQUIRED IMPORTED_TARGET GLOBAL libxc) | ||
find_package_handle_standard_args(Libxc DEFAULT_MSG Libxc_LINK_LIBRARIES Libxc_INCLUDE_DIRS) | ||
endif() | ||
|
||
|
||
# Copy the results to the output variables and target. | ||
# if find_package() above works, Libxc::xc would be present and | ||
# below would be skipped. | ||
if(Libxc_FOUND AND NOT TARGET Libxc::xc) | ||
set(Libxc_LIBRARY ${Libxc_LINK_LIBRARIES}) | ||
set(Libxc_LIBRARIES ${Libxc_LIBRARY}) | ||
set(Libxc_INCLUDE_DIR ${Libxc_INCLUDE_DIRS}) | ||
add_library(Libxc::xc UNKNOWN IMPORTED) | ||
set_target_properties(Libxc::xc PROPERTIES | ||
IMPORTED_LOCATION "${Libxc_LIBRARY}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${Libxc_INCLUDE_DIR}") | ||
endif() | ||
|
||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${Libxc_INCLUDE_DIR}) | ||
|
||
mark_as_advanced(Libxc_INCLUDE_DIR Libxc_LIBRARY) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.