-
Notifications
You must be signed in to change notification settings - Fork 139
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
Compilation errors with the GNU environment #4309
Comments
@denghuilu, could you have a look? |
Are you in Sugon environment ? It would be better to tell us the cmake commands as well as the loaded modules. Also I would suggest to compile with a self build OpenBLAS library. |
@caic99, could you have a look? |
@LiuXiaohui123321 Would you attach your full input script and error log? Thanks. |
|
The attached files are,
|
If I change some part of the CMakeFiles/abacus.dir/link.txt file,
to
and the compilation is ok. |
All of $PathtoXXX are self build, |
This may come from old cmake's --- a/abacus-develop/cmake/FindLapack.cmake
+++ b/abacus-develop/cmake/FindLapack.cmake
@@ -6,9 +6,13 @@ if(DEFINED LAPACK_LIBRARY)
set(LAPACK_LIBRARIES ${LAPACK_LIBRARY})
endif()
+message("before finding LAPACK by cmake, $LAPACK_LIBRARIES is ${LAPACK_LIBRARIES}")
+
find_package(Blas REQUIRED)
find_package(LAPACK REQUIRED)
+message("after finding LAPACK by cmake, $LAPACK_LIBRARIES is ${LAPACK_LIBRARIES}")
+
if(NOT TARGET LAPACK::LAPACK)
add_library(LAPACK::LAPACK UNKNOWN IMPORTED)
set_target_properties(LAPACK::LAPACK PROPERTIES Edit, remove old build dir, rerun detailed explaination
For ABACUS, LAPACK and BLAS library are linked with seperate cmake target; they are Some old versions of cmake do not create these target. To deal with these versions, default routines of ABACUS are implemented in |
Hi! I add the 2 lines, and the output is,
|
Hi @LiuXiaohui123321 , diff --git a/abacus-develop/cmake/FindLapack.cmake b/abacus-develop/cmake/FindLapack1.cmake
index 15c3976..ad3dc05 100644
--- a/abacus-develop/cmake/FindLapack.cmake
+++ b/abacus-develop/cmake/FindLapack1.cmake
@@ -6,10 +6,15 @@ if(DEFINED LAPACK_LIBRARY)
set(LAPACK_LIBRARIES ${LAPACK_LIBRARY})
endif()
message("before finding LAPACK by cmake, $LAPACK_LIBRARIES is ${LAPACK_LIBRARIES}")
find_package(Blas REQUIRED)
find_package(LAPACK REQUIRED)
message("after finding LAPACK by cmake, $LAPACK_LIBRARIES is ${LAPACK_LIBRARIES}")
if(NOT TARGET LAPACK::LAPACK)
+ list(GET LAPACK_LIBRARIES 0 LAPACK_LIBRARIES)
add_library(LAPACK::LAPACK UNKNOWN IMPORTED)
set_target_properties(LAPACK::LAPACK PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C" This would only use the first component, The return you report means, for netlib LAPACK/BLAS, cmake-3.16.2 really mixes BLAS and LAPACK libraries in one return value; more details for fixing it, like if other versions of cmake would do the same or in a reverted order, if other BLAS-LAPACK seperated libs would face a same issue(e.g blis/libflame, the libs used in AMD optimizing CPU libraries). Detecting this need our works, you could try find the @caic99 Below are some supposed solutions, which one would you, or the core developers prefer? Possible solutions contains:
|
@yizeyi18 Thanks for your reply and suggestion! |
Hi @LiuXiaohui123321 , |
Yes, it works. |
When I try to compile ABACUS(Github version: 050a2c4) with GNU environment,
it interrupts with the error that the liblapack.so file was not found.
According to the error message, I found the CMakeFiles/abacus.dir/link.txt file,
The text was updated successfully, but these errors were encountered: