Skip to content
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

Add dependency to system libraries after SuiteSparse libraries #561

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

mmuetzel
Copy link
Contributor

@mmuetzel mmuetzel commented Dec 1, 2023

Changes to the CMake build rules for KLU, ParU, SPQR, and UMFPACK that are similar to #555.

Currently, building SuiteSparse can fail if headers of older versions of the SuiteSparse libraries are installed at the same locations where the headers of other dependencies are installed (if that location is not one of the default include directories of the used pre-processor).
For the CHOLMOD library, it helped to change the order in which dependencies are added such that dependencies to SuiteSparse libraries are added ahead of dependencies to system libraries. So, do the same for the other libraries that have dependencies on system libraries.

(I can't reproduce the issue here. So, it would be nice if someone who can reproduce could test this.)

@DrTimothyAldenDavis
Copy link
Owner

Thanks! I'll give it a try. I'm tied up most of today and this weekend so it might take me a few days.

@DrTimothyAldenDavis
Copy link
Owner

I wonder if the Mac CI would be revised so that it starts by first doing "brew install suite-sparse" to get a stale version?

I could revise my Example program so that it compares the version #'s from the headers, and the version numbers from the library, and fails if they don't match

@mmuetzel
Copy link
Contributor Author

mmuetzel commented Dec 1, 2023

I wonder if the Mac CI would be revised so that it starts by first doing "brew install suite-sparse" to get a stale version?

I added that command in the CI for a test. But that didn't make a difference. That might be because we configure with -DCMAKE_PREFIX_PATH="/usr/local/opt/lapack;/usr/local/opt/openblas;/usr/local/opt/libomp" on that runner. I got those paths from the output that Homebrew shows in the CI when installing the respective packages.

@DrTimothyAldenDavis DrTimothyAldenDavis merged commit 2924933 into DrTimothyAldenDavis:dev2 Dec 1, 2023
24 checks passed
@mmuetzel
Copy link
Contributor Author

mmuetzel commented Dec 1, 2023

@DrTimothyAldenDavis: Thank you for merging. ❤️

@Fabian188: Now that this is in dev2, could you please check if you still see build errors when you build from that branch?

@Fabian188
Copy link

That come further, passed the dynamic umfpack but fails for the static one

25%] Linking C shared library libumfpack.dylib
[ 25%] Built target UMFPACK
[ 25%] Building C object UMFPACK/CMakeFiles/UMFPACK_static.dir/Source2/umf_di_assemble.c.o
In file included from /Users/fwein/code/SuiteSparse-org/UMFPACK/Source2/umf_di_assemble.c:10:
In file included from /Users/fwein/code/SuiteSparse-org/UMFPACK/Source/umf_assemble.c:14:
In file included from /Users/fwein/code/SuiteSparse-org/UMFPACK/Source/umf_internal.h:330:
/Users/fwein/code/SuiteSparse-org/UMFPACK/Include/umfpack.h:87:2: error: "UMFPACK 6.3.0 requires SuiteSparse_config 7.4.0 or later"
#error "UMFPACK 6.3.0 requires SuiteSparse_config 7.4.0 or later"
 ^
/Users/fwein/code/SuiteSparse-org/UMFPACK/Include/umfpack.h:91:2: error: "UMFPACK 6.3.0 requires AMD 3.3.0 or later"
#error "UMFPACK 6.3.0 requires AMD 3.3.0 or later"
 ^
2 errors generated.

git branch -> dev2
git log | head 
commit 292493371061dc3b983d390658a5d000eb99f174
Merge: 5d411658d 404d08ada
Author: Tim Davis <[email protected]>
Date:   Fri Dec 1 11:06:25 2023 -0600

    Merge pull request #561 from mmuetzel/cmake
    
    Add dependency to system libraries after SuiteSparse libraries

commit 5d411658d7b7684d4d369e4013b8cd4c22fa704c

@Fabian188
Copy link

If I would know the branch name or repository URL for a PR I would try it.

I installed GitHub Desktop which needs this information. The link from the web page does not open my desktop client but always wants to install it again.

@Fabian188
Copy link

This had been built:

make
[  0%] Built target SuiteSparseConfig
[  0%] Built target SuiteSparseConfig_static
[  1%] Built target Mongoose_static
[  1%] Built target Mongoose
[  1%] Built target Mongoose_static_dbg
[  1%] Built target mongoose_exe
[  1%] Built target demo_exe
[  1%] Built target mongoose_test_io
[  1%] Built target mongoose_test_edgesep
[  1%] Built target mongoose_test_memory
[  1%] Built target mongoose_test_performance
[  1%] Built target mongoose_test_reference
[  1%] Built target mongoose_unit_test_io
[  1%] Built target mongoose_unit_test_graph
[  1%] Built target mongoose_unit_test_edgesep
[  1%] Built target AMD
[  1%] Built target AMD_static
[  2%] Built target BTF
[  2%] Built target BTF_static
[  2%] Built target CAMD
[  3%] Built target CAMD_static
[  3%] Built target CCOLAMD
[  3%] Built target CCOLAMD_static
[  3%] Built target COLAMD
[  3%] Built target COLAMD_static
[  6%] Built target CHOLMOD
[ 10%] Built target CHOLMOD_static
[ 10%] Built target cholmod_di_demo
[ 10%] Built target cholmod_dl_demo
[ 10%] Built target cholmod_si_demo
[ 10%] Built target cholmod_sl_demo
[ 14%] Built target CXSparse
[ 17%] Built target CXSparse_static
[ 17%] Built target LDL
[ 17%] Built target LDL_static
[ 18%] Built target KLU
[ 19%] Built target KLU_static
[ 19%] Built target KLU_CHOLMOD
[ 19%] Built target KLU_CHOLMOD_static
[ 25%] Built target UMFPACK
[ 25%] Building C object UMFPACK/CMakeFiles/UMFPACK_static.dir/Source2/umf_di_assemble.c.o

@mmuetzel
Copy link
Contributor Author

mmuetzel commented Dec 1, 2023

Thank you for testing.

I've never worked with GitHub GUI. But I'd guess you could get the branch name and repository URL from the link in the line just below the PR title. In this case: mmuetzel:cmake

There are a couple of include_directories in the build rule for UMFPACK that might better be avoided. I've missed them in the first round. Maybe, that's causing the error for you.
If that's ok for you, I'll ping you when I have a PR ready.

@Fabian188
Copy link

If that's ok for you, I'll ping you when I have a PR ready.

Sure, I hope you did not wait for a reply from me. It just can take some time ...

@DrTimothyAldenDavis
Copy link
Owner

I had a chance to try it on my MacBook Air. WIth a fresh build, and "make" at the top level (so I'm not using the new root CMakeLists.txt), I get the following result. I failed at the same point that @Fabian188 's build failed at, where it found the /usr/local/include version of the stale include files:

mac $ pwd
/Users/davis/dev2/SuiteSparse
mac $ cd UMFPACK/build 
mac $ VERBOSE=1 make -j1
/opt/homebrew/Cellar/cmake/3.27.7/bin/cmake -S/Users/davis/dev2/SuiteSparse/UMFPACK -B/Users/davis/dev2/SuiteSparse/UMFPACK/build --check-build-system CMakeFiles/Makefile.cmake 0
/opt/homebrew/Cellar/cmake/3.27.7/bin/cmake -E cmake_progress_start /Users/davis/dev2/SuiteSparse/UMFPACK/build/CMakeFiles
 ...
Consolidate compiler generated dependencies of target UMFPACK
/Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/UMFPACK.dir/build.make CMakeFiles/UMFPACK.dir/build
[  0%] Building C object CMakeFiles/UMFPACK.dir/Source2/umf_di_assemble.c.o
/Library/Developer/CommandLineTools/usr/bin/cc -DBLAS_Apple -DUMFPACK_EXPORTS -I/Users/davis/dev2/SuiteSparse/UMFPACK/build -I/Users/davis/dev2/SuiteSparse/UMFPACK -I/Users/davis/dev2/SuiteSparse/UMFPACK/Source -I/Users/davis/dev2/SuiteSparse/UMFPACK/Include -I/usr/local/include -F/Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk/System/Library/Frameworks -isystem /Users/davis/dev2/SuiteSparse/SuiteSparse_config -isystem /Users/davis/dev2/SuiteSparse/AMD/Include -isystem /Users/davis/dev2/SuiteSparse/CHOLMOD/Include -Xclang -fopenmp  -O3 -DNDEBUG -std=gnu11 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk -mmacosx-version-min=13.6 -fPIC -MD -MT CMakeFiles/UMFPACK.dir/Source2/umf_di_assemble.c.o -MF CMakeFiles/UMFPACK.dir/Source2/umf_di_assemble.c.o.d -o CMakeFiles/UMFPACK.dir/Source2/umf_di_assemble.c.o -c /Users/davis/dev2/SuiteSparse/UMFPACK/Source2/umf_di_assemble.c
In file included from /Users/davis/dev2/SuiteSparse/UMFPACK/Source2/umf_di_assemble.c:10:
In file included from /Users/davis/dev2/SuiteSparse/UMFPACK/Source/umf_assemble.c:14:
In file included from /Users/davis/dev2/SuiteSparse/UMFPACK/Source/umf_internal.h:330:
/Users/davis/dev2/SuiteSparse/UMFPACK/Include/umfpack.h:87:2: error: "UMFPACK 6.3.0 requires SuiteSparse_config 7.4.0 or later"
#error "UMFPACK 6.3.0 requires SuiteSparse_config 7.4.0 or later"
 ^
/Users/davis/dev2/SuiteSparse/UMFPACK/Include/umfpack.h:91:2: error: "UMFPACK 6.3.0 requires AMD 3.3.0 or later"
#error "UMFPACK 6.3.0 requires AMD 3.3.0 or later"
 ^
2 errors generated.
make[2]: *** [CMakeFiles/UMFPACK.dir/Source2/umf_di_assemble.c.o] Error 1
make[1]: *** [CMakeFiles/UMFPACK.dir/all] Error 2
make: *** [all] Error 2
mac $ 

Note the location of the -I/usr/local/include. I also have stale include files in /opt/homebrew/include but it didn't find those. I think SPEX will find that though. I'll try that next.

@DrTimothyAldenDavis
Copy link
Owner

Here's the SPEX build, where it stumbles over -I/opt/homebrew/include

I'm guessing this is different than UMFPACK because SPEX is using gmp and mprf, and I get those from brew, and the include folder for gmp and mpfr is /opt/homebrew/include.

mac $ VERBOSE=1 make JOBS=1
( cd build && cmake  .. && cmake --build . --config Release -j1 )
Re-run cmake no build system arguments
-- Building SPEX version: v2.3.0 (Dec 30, 2023)
-- The C compiler identification is AppleClang 15.0.0.15000040
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Source:        /Users/davis/dev2/SuiteSparse/SPEX 
-- Build:         /Users/davis/dev2/SuiteSparse/SPEX/build 
-- Install lib:      lib
-- Install include:  include
-- Install bin:      bin
-- Install pkg-file: lib
-- Install rpath:    
-- Build   rpath:    /Users/davis/dev2/SuiteSparse/SPEX/build
-- Build type:    Release 
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - /opt/homebrew/bin/gfortran
-- The Fortran compiler identification is GNU 13.2.0
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /opt/homebrew/bin/gfortran - skipped
-- Fortran: /opt/homebrew/bin/gfortran
-- CUDA: not enabled
-- SuiteSparse_config version: 7.4.0
-- SuiteSparse_config include: /Users/davis/dev2/SuiteSparse/SuiteSparse_config
-- SuiteSparse_config library: /Users/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.7.4.0.dylib
-- SuiteSparse_config static:  /Users/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a
-- AMD version: 3.3.0
-- AMD include: /Users/davis/dev2/SuiteSparse/AMD/Include
-- AMD library: /Users/davis/dev2/SuiteSparse/AMD/build/libamd.3.3.0.dylib
-- AMD static:  /Users/davis/dev2/SuiteSparse/AMD/build/libamd.a
-- COLAMD version: 3.3.0
-- COLAMD include: /Users/davis/dev2/SuiteSparse/COLAMD/Include
-- COLAMD library: /Users/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.3.3.0.dylib
-- COLAMD static:  /Users/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.a
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) 
-- major: #define __GNU_MP_VERSION            6
-- minor: #define __GNU_MP_VERSION_MINOR      3
-- patch: #define __GNU_MP_VERSION_PATCHLEVEL 0
-- Found GMP: /opt/homebrew/Cellar/gmp/6.3.0/lib/libgmp.10.dylib (found suitable version "6.3.0", minimum required is "6.1.2") 
-- gmp version: 6.3.0
-- gmp include: /opt/homebrew/include
-- gmp library: /opt/homebrew/Cellar/gmp/6.3.0/lib/libgmp.10.dylib
-- gmp static:  /opt/homebrew/lib/libgmp.a
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) 
-- major/minor/patch: #define MPFR_VERSION_STRING "4.2.0-p12"
-- Found MPFR: /opt/homebrew/Cellar/mpfr/4.2.0-p12/lib/libmpfr.6.dylib (found suitable version "4.2.0", minimum required is "4.0.2") 
-- mpfr version: 4.2.0
-- mpfr include: /opt/homebrew/include
-- mpfr library: /opt/homebrew/Cellar/mpfr/4.2.0-p12/lib/libmpfr.6.dylib
-- mpfr static:  /opt/homebrew/lib/libmpfr.a
-- Skipping the demos in SPEX/Demo
-- ------------------------------------------------------------------------
-- SuiteSparse CMAKE report for: spex
-- ------------------------------------------------------------------------
-- inside common SuiteSparse root:  false
-- install in SuiteSparse/lib and SuiteSparse/include: OFF
-- build type:           Release
-- BUILD_SHARED_LIBS:    ON
-- BUILD_STATIC_LIBS:    ON
-- use OpenMP:           no 
-- C compiler:           /Library/Developer/CommandLineTools/usr/bin/cc 
-- C flags:              
-- C++ compiler:         
-- C++ flags:            
-- C Flags release:      -O3 -DNDEBUG 
-- C++ Flags release:     
-- Fortran compiler:     /opt/homebrew/bin/gfortran 
-- compile definitions:  
-- ------------------------------------------------------------------------
-- Configuring done (1.9s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/davis/dev2/SuiteSparse/SPEX/build
Change Dir: '/Users/davis/dev2/SuiteSparse/SPEX/build'

Run Build Command(s): /opt/homebrew/Cellar/cmake/3.27.7/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile -j1
/opt/homebrew/Cellar/cmake/3.27.7/bin/cmake -S/Users/davis/dev2/SuiteSparse/SPEX -B/Users/davis/dev2/SuiteSparse/SPEX/build --check-build-system CMakeFiles/Makefile.cmake 0
/opt/homebrew/Cellar/cmake/3.27.7/bin/cmake -E cmake_progress_start /Users/davis/dev2/SuiteSparse/SPEX/build/CMakeFiles /Users/davis/dev2/SuiteSparse/SPEX/build//CMakeFiles/progress.marks
/Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/Makefile2 all
/Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/SPEX.dir/build.make CMakeFiles/SPEX.dir/depend
cd /Users/davis/dev2/SuiteSparse/SPEX/build && /opt/homebrew/Cellar/cmake/3.27.7/bin/cmake -E cmake_depends "Unix Makefiles" /Users/davis/dev2/SuiteSparse/SPEX /Users/davis/dev2/SuiteSparse/SPEX /Users/davis/dev2/SuiteSparse/SPEX/build /Users/davis/dev2/SuiteSparse/SPEX/build /Users/davis/dev2/SuiteSparse/SPEX/build/CMakeFiles/SPEX.dir/DependInfo.cmake "--color="
/Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/SPEX.dir/build.make CMakeFiles/SPEX.dir/build
[  1%] Building C object CMakeFiles/SPEX.dir/SPEX_Left_LU/Source/SPEX_Left_LU_backslash.c.o
/Library/Developer/CommandLineTools/usr/bin/cc -DSPEX_EXPORTS -I/Users/davis/dev2/SuiteSparse/SPEX/build -I/Users/davis/dev2/SuiteSparse/SPEX -I/Users/davis/dev2/SuiteSparse/SPEX/SPEX_Left_LU/Source -I/Users/davis/dev2/SuiteSparse/SPEX/SPEX_Util/Source -I/Users/davis/dev2/SuiteSparse/SPEX/Include -I/Users/davis/dev2/SuiteSparse/SPEX/SPEX_Left_LU/Demo -I/opt/homebrew/include -isystem /Users/davis/dev2/SuiteSparse/SuiteSparse_config -isystem /Users/davis/dev2/SuiteSparse/AMD/Include -isystem /Users/davis/dev2/SuiteSparse/COLAMD/Include -O3 -DNDEBUG -std=gnu11 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk -mmacosx-version-min=13.6 -fPIC -MD -MT CMakeFiles/SPEX.dir/SPEX_Left_LU/Source/SPEX_Left_LU_backslash.c.o -MF CMakeFiles/SPEX.dir/SPEX_Left_LU/Source/SPEX_Left_LU_backslash.c.o.d -o CMakeFiles/SPEX.dir/SPEX_Left_LU/Source/SPEX_Left_LU_backslash.c.o -c /Users/davis/dev2/SuiteSparse/SPEX/SPEX_Left_LU/Source/SPEX_Left_LU_backslash.c
In file included from /Users/davis/dev2/SuiteSparse/SPEX/SPEX_Left_LU/Source/SPEX_Left_LU_backslash.c:45:
In file included from /Users/davis/dev2/SuiteSparse/SPEX/SPEX_Left_LU/Source/spex_left_lu_internal.h:18:
In file included from /Users/davis/dev2/SuiteSparse/SPEX/SPEX_Util/Source/spex_util_internal.h:106:
/Users/davis/dev2/SuiteSparse/SPEX/Include/SPEX.h:270:2: error: "SPEX 2.3.0 requires SuiteSparse_config 7.4.0 or later"
#error "SPEX 2.3.0 requires SuiteSparse_config 7.4.0 or later"
 ^
In file included from /Users/davis/dev2/SuiteSparse/SPEX/SPEX_Left_LU/Source/SPEX_Left_LU_backslash.c:45:
In file included from /Users/davis/dev2/SuiteSparse/SPEX/SPEX_Left_LU/Source/spex_left_lu_internal.h:18:
/Users/davis/dev2/SuiteSparse/SPEX/SPEX_Util/Source/spex_util_internal.h:110:2: error: "SPEX requires SuiteSparse_config 7.4.0 or later"
#error "SPEX requires SuiteSparse_config 7.4.0 or later"
 ^
/Users/davis/dev2/SuiteSparse/SPEX/SPEX_Util/Source/spex_util_internal.h:114:2: error: "SPEX requires AMD 3.3.0 or later"
#error "SPEX requires AMD 3.3.0 or later"
 ^
/Users/davis/dev2/SuiteSparse/SPEX/SPEX_Util/Source/spex_util_internal.h:118:2: error: "SPEX requires COLAMD 3.3.0 or later"
#error "SPEX requires COLAMD 3.3.0 or later"
 ^
4 errors generated.
make[3]: *** [CMakeFiles/SPEX.dir/SPEX_Left_LU/Source/SPEX_Left_LU_backslash.c.o] Error 1
make[2]: *** [CMakeFiles/SPEX.dir/all] Error 2
make[1]: *** [all] Error 2

make: *** [library] Error 2
mac $ 

@DrTimothyAldenDavis
Copy link
Owner

I added some verbose diagnostics to the UMFPACK/CMakeLists.txt file, and built it on my MacBook Air. See the latest push to dev2. It brings in /usr/local/include for OpenMP.

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "24: ${dirs}" )
# OpenMP:
if ( OPENMP_FOUND )
message ( STATUS "OpenMP C libraries: ${OpenMP_C_LIBRARIES}" )
message ( STATUS "OpenMP C include: ${OpenMP_C_INCLUDE_DIRS}" )
message ( STATUS "OpenMP C flags: ${OpenMP_C_FLAGS}" )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( UMFPACK PRIVATE ${OpenMP_C_LIBRARIES} )
endif ( )
if ( BUILD_STATIC_LIBS )
target_link_libraries ( UMFPACK_static PUBLIC ${OpenMP_C_LIBRARIES} )
list ( APPEND UMFPACK_STATIC_LIBS ${OpenMP_C_LIBRARIES} )
endif ( )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} " )
include_directories ( ${OpenMP_C_INCLUDE_DIRS} )
endif ( )
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "25: ${dirs}" )

-- 24: /Users/davis/dev2/SuiteSparse/UMFPACK/Source;/Users/davis/dev2/SuiteSparse/UMFPACK/Include
-- OpenMP C libraries:      /usr/local/lib/libomp.dylib
-- OpenMP C include:        /usr/local/include
-- OpenMP C flags:          -Xclang -fopenmp
-- 25: /Users/davis/dev2/SuiteSparse/UMFPACK/Source;/Users/davis/dev2/SuiteSparse/UMFPACK/Include;/usr/local/include

Then later on, it complains about SuiteSparse_config.h (a stale copy is in /usr/local/include):

/Library/Developer/CommandLineTools/usr/bin/cc -DBLAS_Apple -DUMFPACK_EXPORTS -I/Users/davis/dev2/SuiteSparse/UMFPACK/build -I/Users/davis/dev2/SuiteSparse/UMFPACK -I/Users/davis/dev2/SuiteSparse/UMFPACK/Source -I/Users/davis/dev2/SuiteSparse/UMFPACK/Include -I/usr/local/include -F/Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk/System/Library/Frameworks -isystem /Users/davis/dev2/SuiteSparse/SuiteSparse_config -isystem /Users/davis/dev2/SuiteSparse/AMD/Include -isystem /Users/davis/dev2/SuiteSparse/CHOLMOD/Include -Xclang -fopenmp  -O3 -DNDEBUG -std=gnu11 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk -mmacosx-version-min=13.6 -fPIC -MD -MT CMakeFiles/UMFPACK.dir/Source2/umf_di_assemble_fixq.c.o -MF CMakeFiles/UMFPACK.dir/Source2/umf_di_assemble_fixq.c.o.d -o CMakeFiles/UMFPACK.dir/Source2/umf_di_assemble_fixq.c.o -c /Users/davis/dev2/SuiteSparse/UMFPACK/Source2/umf_di_assemble_fixq.c
In file included from /Users/davis/dev2/SuiteSparse/UMFPACK/Source2/umf_di_build_tuples.c:10:
In file included from /Users/davis/dev2/SuiteSparse/UMFPACK/Source/umf_build_tuples.c:19:
In file included from /Users/davis/dev2/SuiteSparse/UMFPACK/Source/umf_internal.h:330:
/Users/davis/dev2/SuiteSparse/UMFPACK/Include/umfpack.h:87:2: error: "UMFPACK 6.3.0 requires SuiteSparse_config 7.4.0 or later"
#error "UMFPACK 6.3.0 requires SuiteSparse_config 7.4.0 or later"

The curious thing is that the message doesn't print the entire list of include directories. And also AMD and SuiteSparse_config are brought in before OpenMP.

@DrTimothyAldenDavis
Copy link
Owner

I added a few more diagnostics:

get_target_property(dirs UMFPACK INCLUDE_DIRECTORIES)
message ( STATUS "umfpack 1: ${dirs}" )
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "24: ${dirs}" )
# OpenMP:
if ( OPENMP_FOUND )
message ( STATUS "OpenMP C libraries: ${OpenMP_C_LIBRARIES}" )
message ( STATUS "OpenMP C include: ${OpenMP_C_INCLUDE_DIRS}" )
message ( STATUS "OpenMP C flags: ${OpenMP_C_FLAGS}" )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( UMFPACK PRIVATE ${OpenMP_C_LIBRARIES} )
endif ( )
if ( BUILD_STATIC_LIBS )
target_link_libraries ( UMFPACK_static PUBLIC ${OpenMP_C_LIBRARIES} )
list ( APPEND UMFPACK_STATIC_LIBS ${OpenMP_C_LIBRARIES} )
endif ( )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} " )
include_directories ( ${OpenMP_C_INCLUDE_DIRS} )
endif ( )
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
message ( STATUS "25: ${dirs}" )
get_target_property(dirs UMFPACK INCLUDE_DIRECTORIES)
message ( STATUS "umfpack 2: ${dirs}" )

And it reports this:

-- umfpack 1: /Users/davis/dev2/SuiteSparse/UMFPACK/Source;/Users/davis/dev2/SuiteSparse/UMFPACK/Include;$<TARGET_PROPERTY:SuiteSparse::SuiteSparseConfig,INTERFACE_INCLUDE_DIRECTORIES>;$<TARGET_PROPERTY:SuiteSparse::AMD,INTERFACE_INCLUDE_DIRECTORIES>
-- 24: /Users/davis/dev2/SuiteSparse/UMFPACK/Source;/Users/davis/dev2/SuiteSparse/UMFPACK/Include
-- OpenMP C libraries:      /usr/local/lib/libomp.dylib
-- OpenMP C include:        /usr/local/include
-- OpenMP C flags:          -Xclang -fopenmp
-- 25: /Users/davis/dev2/SuiteSparse/UMFPACK/Source;/Users/davis/dev2/SuiteSparse/UMFPACK/Include;/usr/local/include
-- umfpack 2: /Users/davis/dev2/SuiteSparse/UMFPACK/Source;/Users/davis/dev2/SuiteSparse/UMFPACK/Include;$<TARGET_PROPERTY:SuiteSparse::SuiteSparseConfig,INTERFACE_INCLUDE_DIRECTORIES>;$<TARGET_PROPERTY:SuiteSparse::AMD,INTERFACE_INCLUDE_DIRECTORIES>;/usr/local/include

@mmuetzel
Copy link
Contributor Author

mmuetzel commented Dec 2, 2023

Sure, I hope you did not wait for a reply from me. It just can take some time ...

Sorry. Got caught up in something else yesterday.
Could you please check if #562 gets you further?

@DrTimothyAldenDavis
Copy link
Owner

It works!

As a test for this issue, I will add tests in the Example package to compare the version in the header with the version the library itself reports.

@DrTimothyAldenDavis
Copy link
Owner

SPEX has the same issue: gmp and mpfr bring in /opt/homebrew/include, which then causes the conflict with 'brew install suite-sparse'. SPEX finds the stale headers for SuiteSparse_config.h, amd.h, and colamd.h from the brew suite-sparse headers in /opt/homebrew/include.

@mmuetzel
Copy link
Contributor Author

mmuetzel commented Dec 2, 2023

Could you please show the output on the console when it fails?

@Fabian188
Copy link

For me it works!

make
[  0%] Built target SuiteSparseConfig
[  0%] Built target SuiteSparseConfig_static
[  1%] Built target Mongoose_static
[  1%] Built target Mongoose
[  1%] Built target Mongoose_static_dbg
[  1%] Built target mongoose_exe
[  1%] Built target demo_exe
[  1%] Built target mongoose_test_io
[  1%] Built target mongoose_test_edgesep
[  1%] Built target mongoose_test_memory
[  1%] Built target mongoose_test_performance
[  1%] Built target mongoose_test_reference
[  1%] Built target mongoose_unit_test_io
[  1%] Built target mongoose_unit_test_graph
[  1%] Built target mongoose_unit_test_edgesep
[  1%] Built target AMD
[  1%] Built target AMD_static
[  2%] Built target BTF
[  2%] Built target BTF_static
[  2%] Built target CAMD
[  3%] Built target CAMD_static
[  3%] Built target CCOLAMD
[  3%] Built target CCOLAMD_static
[  3%] Built target COLAMD
[  3%] Built target COLAMD_static
[  6%] Built target CHOLMOD
[ 10%] Built target CHOLMOD_static
[ 10%] Built target cholmod_di_demo
[ 10%] Built target cholmod_dl_demo
[ 10%] Built target cholmod_si_demo
[ 10%] Built target cholmod_sl_demo
[ 14%] Built target CXSparse
[ 17%] Built target CXSparse_static
[ 17%] Built target LDL
[ 17%] Built target LDL_static
[ 18%] Built target KLU
[ 19%] Built target KLU_static
[ 19%] Built target KLU_CHOLMOD
[ 19%] Built target KLU_CHOLMOD_static
[ 25%] Built target UMFPACK
[ 31%] Built target UMFPACK_static
[ 32%] Built target ParU
[ 33%] Built target ParU_static
[ 33%] Built target RBio
[ 33%] Built target RBio_static
[ 34%] Built target SPQR
[ 35%] Built target SPQR_static
[ 36%] Built target SPEX
[ 36%] Built target SPEX_static
[ 36%] Built target grb_jitpackage
[ 92%] Built target GraphBLAS
[ 93%] Built target LAGraph
[ 94%] Built target LAGraph_static
[ 95%] Built target lagraphtest
[ 95%] Built target lagraphtest_static
[ 96%] Built target LAGraphX
[ 96%] Built target test_Betweenness
[ 96%] Built target test_BreadthFirstSearch
[ 96%] Built target test_Cached_AT
[ 96%] Built target test_Cached_Degree
[ 96%] Built target test_Cached_NDiag
[ 96%] Built target test_Cached_SymmetricStructure
[ 96%] Built target test_CheckGraph
[ 96%] Built target test_ConnectedComponents
[ 96%] Built target test_DeleteCached
[ 96%] Built target test_DisplayGraph
[ 96%] Built target test_Init
[ 96%] Built target test_Init_errors
[ 96%] Built target test_IsEqual
[ 96%] Built target test_KindName
[ 96%] Built target test_MMRead
[ 96%] Built target test_Malloc
[ 96%] Built target test_Matrix_Structure
[ 96%] Built target test_Multiply_size_t
[ 97%] Built target test_New
[ 97%] Built target test_NumThreads
[ 97%] Built target test_PageRank
[ 97%] Built target test_SampleDegree
[ 97%] Built target test_SingleSourceShortestPath
[ 97%] Built target test_Sort
[ 97%] Built target test_SortByDegree
[ 97%] Built target test_TriangleCount
[ 97%] Built target test_Type
[ 97%] Built target test_Vector_Print
[ 97%] Built target test_Vector_Structure
[ 97%] Built target test_WallClockTime
[ 97%] Built target test_Xinit
[ 97%] Built target test_acutest
[ 97%] Built target test_export
[ 97%] Built target test_fopen
[ 97%] Built target test_minmax
[ 98%] Built target test_vector
[ 98%] Built target bc_demo
[ 98%] Built target bfs_demo
[ 98%] Built target cc_demo
[ 98%] Built target gappagerank_demo
[ 98%] Built target mtx2bin_demo
[ 98%] Built target ss2_demo
[ 98%] Built target sssp_demo
[ 99%] Built target tc_demo
[100%] Built target LAGraphX_static
[100%] Built target lagraphxtest
[100%] Built target lagraphxtest_static
[100%] Built target test_AllKCore
[100%] Built target test_AllKtruss
[100%] Built target test_BF
[100%] Built target test_FastGraphletTransform
[100%] Built target test_HelloWorld
[100%] Built target test_KCore
[100%] Built target test_KCoreDecompose
[100%] Built target test_KTruss
[100%] Built target test_MaximalIndependentSet
[100%] Built target test_Random
[100%] Built target test_Random_Matrix
[100%] Built target test_SSaveSet
[100%] Built target test_SWrite
[100%] Built target test_SquareClustering
[100%] Built target test_TriangleCentrality
[100%] Built target test_cdlp
[100%] Built target test_dnn
[100%] Built target test_lcc
[100%] Built target test_msf
[100%] Built target test_scc
[100%] Built target AllKCore_demo
[100%] Built target KCore_demo
[100%] Built target dnn_demo
[100%] Built target fglt_demo
[100%] Built target helloworld2_demo
[100%] Built target helloworld_demo
[100%] Built target mis_demo
[100%] Built target tcc_demo

dev2

git log | head                 
commit c4581154a6342eba8adf9282a388cfa8c4a595eb
Author: Tim Davis <[email protected]>
Date:   Sat Dec 2 10:09:57 2023 -0600

    GraphBLAS JIT configure: MINGW vs Mac

commit fc26ba4aa1a40aa0dd4bfdadf7c7382db4421338
Merge: 96edb8951 287e86ed2
Author: Tim Davis <[email protected]>
Date:   Sat Dec 2 05:50:06 2023 -0600
➜  mybuild git:(dev2) ✗ git log | head -n 23
commit c4581154a6342eba8adf9282a388cfa8c4a595eb
Author: Tim Davis <[email protected]>
Date:   Sat Dec 2 10:09:57 2023 -0600

    GraphBLAS JIT configure: MINGW vs Mac

commit fc26ba4aa1a40aa0dd4bfdadf7c7382db4421338
Merge: 96edb8951 287e86ed2
Author: Tim Davis <[email protected]>
Date:   Sat Dec 2 05:50:06 2023 -0600

    Merge pull request #562 from mmuetzel/umfpack
    
    UMFPACK: Try fixing issues with old installed headers.

commit 287e86ed2a3c992f2e15c68796ff53c3a2918a9a
Author: Markus Mützel <[email protected]>
Date:   Sat Dec 2 11:41:12 2023 +0100

    Revert "lots of diagnostics in UMFPACK/CMakeLists.txt"
    
    This reverts commit 4228c25c08e1795d6b53701f390f5b88d63ad765.

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.

3 participants