-
Notifications
You must be signed in to change notification settings - Fork 262
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
SPEX: Try to put MPFR and GMP include directories last. #566
Conversation
e442d82
into
DrTimothyAldenDavis:dev2
SPEX still fails, if SPEX is built with "cd SPEX/build ; cmake .." etc. It gets the stale headers for all 3 packages: SuiteSparse_config, AMD, and COLAMD. In the root CMakeLists (cd SuiteSparse/build ; cmake .. ; " etc, SPEX finds the correct SuiteSparse_config, but not AMD or COLAMD. That was a parallel build and if I slow it down with "VERBOSE=1 ; make -j1" it fails on CHOLMOD first (getting the wrong headers for AMD, COLAMD, CAMD, and CCOLAMD). |
Could you please show the failing compiler command? I guess the fact that SuiteSparse_config depends on OpenMP and most of the SuiteSparse libraries depend on SuiteSparse_config makes that the folder where OpenMP installed its headers is added quite early... |
Does the following change make a difference? diff --git "a/SuiteSparse_config/CMakeLists.txt" "b/SuiteSparse_config/CMakeLists.txt"
index 1ff9b66f6..b2c31f91f 100644
--- "a/SuiteSparse_config/CMakeLists.txt"
+++ "b/SuiteSparse_config/CMakeLists.txt"
@@ -146,11 +146,13 @@ if ( OpenMP_C_FOUND )
message ( STATUS "OpenMP C flags: ${OpenMP_C_FLAGS} ")
if ( BUILD_SHARED_LIBS )
target_link_libraries ( SuiteSparseConfig PRIVATE OpenMP::OpenMP_C )
- target_include_directories ( SuiteSparseConfig PUBLIC
+ target_include_directories ( SuiteSparseConfig SYSTEM AFTER PUBLIC
"$<TARGET_PROPERTY:OpenMP::OpenMP_C,INTERFACE_INCLUDE_DIRECTORIES>" )
endif ( )
if ( BUILD_STATIC_LIBS )
- target_link_libraries ( SuiteSparseConfig_static PUBLIC OpenMP::OpenMP_C )
+ target_link_libraries ( SuiteSparseConfig_static PRIVATE OpenMP::OpenMP_C )
+ target_include_directories ( SuiteSparseConfig_static SYSTEM AFTER PUBLIC
+ "$<TARGET_PROPERTY:OpenMP::OpenMP_C,INTERFACE_INCLUDE_DIRECTORIES>" )
endif ( )
endif ( )
|
Here's the failed command when I remove my hack and revert to a clean copy of dev2, with added linebreaks for readability:
|
trying it now. |
Which version of CMake do you use? Maybe, we could change that? |
On my mac I'm using cmake 3.27. |
IIUC, CMake adds system include directories always after "normal" include directories. Try to add the include directories last in the order by making them system include directories and adding the keyword
AFTER
.Tbh, it's not entirely clean why CMake decides to add some of the include directories as system include directories. But this change might help to work around #565.