Skip to content

Commit

Permalink
Merge pull request #665 from DrTimothyAldenDavis/dev2
Browse files Browse the repository at this point in the history
cmake build system updates for nexrt SuiteSparse 7.5.0.betaX
  • Loading branch information
DrTimothyAldenDavis authored Dec 30, 2023
2 parents 96c3d81 + 7e6a8dd commit 48c4e0c
Show file tree
Hide file tree
Showing 57 changed files with 377 additions and 192 deletions.
10 changes: 5 additions & 5 deletions CHOLMOD/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# cmake 3.22 is required to find the BLAS/LAPACK
cmake_minimum_required ( VERSION 3.22 )

set ( CHOLMOD_DATE "Dec 30, 2023" )
set ( CHOLMOD_DATE "Jan XX, 2024" ) # FIXME for 7.5.0
set ( CHOLMOD_VERSION_MAJOR 5 CACHE STRING "" FORCE )
set ( CHOLMOD_VERSION_MINOR 1 CACHE STRING "" FORCE )
set ( CHOLMOD_VERSION_SUB 0 CACHE STRING "" FORCE )
set ( CHOLMOD_VERSION_SUB 1 CACHE STRING "" FORCE )

message ( STATUS "Building CHOLMOD version: v"
${CHOLMOD_VERSION_MAJOR}.
Expand Down Expand Up @@ -88,7 +88,7 @@ if ( NOT SUITESPARSE_USE_OPENMP )
set ( CHOLMOD_USE_OPENMP "OFF" CACHE STRING "" FORCE )
endif ( )
if ( CHOLMOD_USE_OPENMP )
find_package ( OpenMP GLOBAL )
find_package ( OpenMP COMPONENTS C GLOBAL )
else ( )
# OpenMP has been disabled
set ( OpenMP_C_FOUND OFF )
Expand All @@ -111,10 +111,10 @@ endif ( )
#-------------------------------------------------------------------------------

if ( NOT SUITESPARSE_ROOT_CMAKELISTS )
find_package ( SuiteSparse_config 7.4.0
find_package ( SuiteSparse_config 7.5.0
PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::SuiteSparseConfig )
find_package ( SuiteSparse_config 7.4.0 REQUIRED )
find_package ( SuiteSparse_config 7.5.0 REQUIRED )
endif ( )

find_package ( AMD 3.3.0
Expand Down
2 changes: 1 addition & 1 deletion CHOLMOD/Config/CHOLMODConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ endif ( )

# Look for OpenMP
if ( @CHOLMOD_HAS_OPENMP@ AND NOT OpenMP_C_FOUND )
find_dependency ( OpenMP )
find_dependency ( OpenMP COMPONENTS C )
if ( NOT OpenMP_C_FOUND )
set ( _dependencies_found OFF )
endif ( )
Expand Down
4 changes: 2 additions & 2 deletions CHOLMOD/Config/cholmod.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ int cholmod_l_version (int version [3]) ;
#include "SuiteSparse_config.h"

#if !defined (SUITESPARSE_VERSION) || \
(SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4))
#error "CHOLMOD @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@ requires SuiteSparse_config 7.4 or later"
(SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,5))
#error "CHOLMOD @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@ requires SuiteSparse_config 7.5 or later"
#endif

//------------------------------------------------------------------------------
Expand Down
Binary file modified CHOLMOD/Doc/CHOLMOD_UserGuide.pdf
Binary file not shown.
5 changes: 5 additions & 0 deletions CHOLMOD/Doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Jan XX, 2024: version 5.1.1 FIXME for 7.5.0

* MATLAB interface: add -DNO_SSIZE_T for Windows
* minor updates to build system

Dec 30, 2023: version 5.1.0

* major change to build system: by Markus Mützel
Expand Down
2 changes: 1 addition & 1 deletion CHOLMOD/Doc/cholmod_version.tex
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
% version of SuiteSparse/CHOLMOD
\date{VERSION 5.1.0, Dec 30, 2023}
\date{VERSION 5.1.1, Jan XX, 2024}
8 changes: 4 additions & 4 deletions CHOLMOD/Include/cholmod.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@
// version control
//------------------------------------------------------------------------------

#define CHOLMOD_DATE "Dec 30, 2023"
#define CHOLMOD_DATE "Jan XX, 2024"
#define CHOLMOD_MAIN_VERSION 5
#define CHOLMOD_SUB_VERSION 1
#define CHOLMOD_SUBSUB_VERSION 0
#define CHOLMOD_SUBSUB_VERSION 1

#define CHOLMOD_VER_CODE(main,sub) SUITESPARSE_VER_CODE(main,sub)
#define CHOLMOD_VERSION \
Expand Down Expand Up @@ -303,8 +303,8 @@ int cholmod_l_version (int version [3]) ;
#include "SuiteSparse_config.h"

#if !defined (SUITESPARSE_VERSION) || \
(SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4))
#error "CHOLMOD 5.1.0 requires SuiteSparse_config 7.4 or later"
(SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,5))
#error "CHOLMOD 5.1.1 requires SuiteSparse_config 7.5 or later"
#endif

//------------------------------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions CHOLMOD/MATLAB/cholmod_make.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
% -R2018a: interleaved complex is required
flags = '-O -R2018a -silent ' ;

if (pc)
% MSVC does not define ssize_t
flags = [flags ' -DNO_SSIZE_T'] ;
end

include = '-I. -I.. -I../../AMD/Include -I../../COLAMD/Include -I../../CCOLAMD/Include -I../../CAMD/Include -I../Include -I../../SuiteSparse_config' ;

if (~pc)
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ endif ( )

if ( SUITESPARSE_USE_SYSTEM_CHOLMOD )
list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "cholmod" )
find_package ( CHOLMOD 5.1.0 REQUIRED )
find_package ( CHOLMOD 5.1.1 REQUIRED )
else ( )
if ( ( KLU_USE_CHOLMOD AND "klu" IN_LIST SUITESPARSE_ENABLE_PROJECTS )
OR ( UMFPACK_USE_CHOLMOD AND "umfpack" IN_LIST SUITESPARSE_ENABLE_PROJECTS )
Expand Down
9 changes: 5 additions & 4 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
Jan 1, 2024: version 7.5.0
Jan XX, 2024: version 7.5.0 FIXME for 7.5.0

* Suitesparse_config: 7.5.0, to reflect the addition of GraphBLAS 9.0.0.
No change to the build system from SuiteSparse 7.4.0, except to update
the date and version numbers.
* GraphBLAS 9.0.0: supporting the v2.1 C API;
see https://github.com/GraphBLAS/graphblas-api-c
* Example 1.6.0: using GraphBLAS 9.0.0 and SuiteSparse_config 7.5.0
* Example 1.6.0: using GraphBLAS 9.0.0 and SuiteSparse_config 7.5.0,
remove explicit dependencies on OpenMP, libm, GMP, and MPFR
* CHOLMOD 5.1.1, SPQR 4.3.1, ParU 0.1.1, LAGraph 1.1.1:
minor updates to build system

Dec 30, 2023: version 7.4.0

Expand Down
168 changes: 89 additions & 79 deletions Example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ message ( STATUS "MY prefix path: ${CMAKE_PREFIX_PATH}" )
#-------------------------------------------------------------------------------

# cmake inserts the date and version number into Include/my.h:
set ( MY_DATE "Jan 1, 2024" )
set ( MY_DATE "Jan XX, 2024" ) # FIXME for 7.5.0
set ( MY_VERSION_MAJOR 1 )
set ( MY_VERSION_MINOR 6 )
set ( MY_VERSION_PATCH 0 )
Expand Down Expand Up @@ -92,29 +92,21 @@ find_package ( AMD 3.3.0 REQUIRED )
find_package ( BTF 2.3.0 REQUIRED )
find_package ( CAMD 3.3.0 REQUIRED )
find_package ( CCOLAMD 3.3.0 REQUIRED )
find_package ( CHOLMOD 5.1.0 REQUIRED )
find_package ( CHOLMOD 5.1.1 REQUIRED )
find_package ( COLAMD 3.3.0 REQUIRED )
find_package ( CXSparse 4.3.0 REQUIRED )
find_package ( GraphBLAS 9.0.0 )
find_package ( KLU 2.3.0 REQUIRED )
find_package ( KLU_CHOLMOD 2.3.0 REQUIRED )
find_package ( LDL 3.3.0 REQUIRED )
find_package ( LAGraph 1.1.0 )
find_package ( LAGraph 1.1.1 )
find_package ( SuiteSparse_Mongoose 3.3.0 REQUIRED )
find_package ( ParU 0.1.0 REQUIRED )
find_package ( ParU 0.1.1 REQUIRED )
find_package ( RBio 4.3.0 REQUIRED )
find_package ( SPEX 2.3.0 REQUIRED ) # requires GMP and MPFR
find_package ( SPQR 4.3.0 REQUIRED )
find_package ( SPQR 4.3.1 REQUIRED )
find_package ( UMFPACK 6.3.0 REQUIRED )

# look for all external libaries:
find_package ( OpenMP REQUIRED )
find_package ( BLAS REQUIRED )
find_package ( LAPACK REQUIRED )
# the SPEX/Find*.cmake packages are installed when SPEX is installed.
find_package ( GMP 6.1.2 REQUIRED )
find_package ( MPFR 4.0.2 REQUIRED )

#-------------------------------------------------------------------------------
# configure files
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -510,82 +502,100 @@ if ( BUILD_STATIC_LIBS )
endif ( )
endif ( )

# OpenMP:
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 ( my PRIVATE OpenMP::OpenMP_C )
target_link_libraries ( my_cxx PRIVATE OpenMP::OpenMP_CXX )
endif ( )
if ( BUILD_STATIC_LIBS )
target_link_libraries ( my_static PUBLIC OpenMP::OpenMP_C )
target_link_libraries ( my_cxx_static PUBLIC OpenMP::OpenMP_CXX )
endif ( )
#-------------------------------------------------------------------------------
# other libraries
#-------------------------------------------------------------------------------

# The "MY" library does not directly rely on the OpenMP, libm, BLAS, LAPACK,
# GMP, and MPFR libraries. However, if you wish to create a library that
# uses those libraries, uncomment the corresponding section. For example,
# when using SPEX, it would be common to also need direct access to GMP and
# MPFR. These direct dependencies are left out of the MY CMakeLists.txt, as
# a test for the other SuiteSparse cmake build system, to ensure that the
# libraries should be linked via the libraries that depend on them. For
# example, linking with SPEX (above) should bring in GMP and MPRF for use in
# SPEX (but not in MY).

if ( 0 )

# libm:
if ( NOT WIN32 )
# OpenMP:
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 ( my PRIVATE m )
target_link_libraries ( my_cxx PRIVATE m )
target_link_libraries ( my PRIVATE OpenMP::OpenMP_C )
target_link_libraries ( my_cxx PRIVATE OpenMP::OpenMP_CXX )
endif ( )
if ( BUILD_STATIC_LIBS )
target_link_libraries ( my_static PUBLIC m )
target_link_libraries ( my_cxx_static PUBLIC m )
target_link_libraries ( my_static PUBLIC OpenMP::OpenMP_C )
target_link_libraries ( my_cxx_static PUBLIC OpenMP::OpenMP_CXX )
endif ( )
endif ( )

# BLAS:
message ( STATUS "BLAS libraries: ${BLAS_LIBRARIES}" )
message ( STATUS "BLAS include: ${BLAS_INCLUDE_DIRS}" )
message ( STATUS "BLAS linker flags: ${BLAS_LINKER_FLAGS}" )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( my PRIVATE ${BLAS_LIBRARIES} )
target_link_libraries ( my_cxx PRIVATE ${BLAS_LIBRARIES} )
endif ( )
if ( BUILD_STATIC_LIBS )
target_link_libraries ( my_static PUBLIC ${BLAS_LIBRARIES} )
target_link_libraries ( my_cxx_static PUBLIC ${BLAS_LIBRARIES} )
endif ( )
include_directories ( ${BLAS_INCLUDE_DIRS} )
# libm:
if ( NOT WIN32 )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( my PRIVATE m )
target_link_libraries ( my_cxx PRIVATE m )
endif ( )
if ( BUILD_STATIC_LIBS )
target_link_libraries ( my_static PUBLIC m )
target_link_libraries ( my_cxx_static PUBLIC m )
endif ( )
endif ( )

# LAPACK:
message ( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES}" )
message ( STATUS "LAPACK include: ${LAPACK_INCLUDE_DIRS}" )
message ( STATUS "LAPACK linker flags: ${LAPACK_LINKER_FLAGS}" )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( my PRIVATE ${LAPACK_LIBRARIES} )
target_link_libraries ( my_cxx PRIVATE ${LAPACK_LIBRARIES} )
endif ( )
if ( BUILD_STATIC_LIBS )
target_link_libraries ( my_static PUBLIC ${LAPACK_LIBRARIES} )
target_link_libraries ( my_cxx_static PUBLIC ${LAPACK_LIBRARIES} )
endif ( )
include_directories ( ${LAPACK_INCLUDE_DIRS} )
# BLAS:
message ( STATUS "BLAS libraries: ${BLAS_LIBRARIES}" )
message ( STATUS "BLAS include: ${BLAS_INCLUDE_DIRS}" )
message ( STATUS "BLAS linker flags: ${BLAS_LINKER_FLAGS}" )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( my PRIVATE ${BLAS_LIBRARIES} )
target_link_libraries ( my_cxx PRIVATE ${BLAS_LIBRARIES} )
endif ( )
if ( BUILD_STATIC_LIBS )
target_link_libraries ( my_static PUBLIC ${BLAS_LIBRARIES} )
target_link_libraries ( my_cxx_static PUBLIC ${BLAS_LIBRARIES} )
endif ( )
include_directories ( ${BLAS_INCLUDE_DIRS} )

# gmp:
message ( STATUS "GMP library: ${GMP_LIBRARIES}" )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( my PRIVATE ${GMP_LIBRARIES} )
target_link_libraries ( my_cxx PRIVATE ${GMP_LIBRARIES} )
endif ( )
if ( BUILD_STATIC_LIBS )
target_link_libraries ( my_static PUBLIC ${GMP_STATIC} )
target_link_libraries ( my_cxx_static PUBLIC ${GMP_STATIC} )
endif ( )
include_directories ( ${GMP_INCLUDE_DIR} )
# LAPACK:
message ( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES}" )
message ( STATUS "LAPACK include: ${LAPACK_INCLUDE_DIRS}" )
message ( STATUS "LAPACK linker flags: ${LAPACK_LINKER_FLAGS}" )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( my PRIVATE ${LAPACK_LIBRARIES} )
target_link_libraries ( my_cxx PRIVATE ${LAPACK_LIBRARIES} )
endif ( )
if ( BUILD_STATIC_LIBS )
target_link_libraries ( my_static PUBLIC ${LAPACK_LIBRARIES} )
target_link_libraries ( my_cxx_static PUBLIC ${LAPACK_LIBRARIES} )
endif ( )
include_directories ( ${LAPACK_INCLUDE_DIRS} )

# gmp:
message ( STATUS "GMP library: ${GMP_LIBRARIES}" )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( my PRIVATE ${GMP_LIBRARIES} )
target_link_libraries ( my_cxx PRIVATE ${GMP_LIBRARIES} )
endif ( )
if ( BUILD_STATIC_LIBS )
target_link_libraries ( my_static PUBLIC ${GMP_STATIC} )
target_link_libraries ( my_cxx_static PUBLIC ${GMP_STATIC} )
endif ( )
include_directories ( ${GMP_INCLUDE_DIR} )

# mpfr:
message ( STATUS "MPFR library: ${MPFR_LIBRARIES}" )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( my PRIVATE ${MPFR_LIBRARIES} )
target_link_libraries ( my_cxx PRIVATE ${MPFR_LIBRARIES} )
endif ( )
if ( BUILD_STATIC_LIBS )
target_link_libraries ( my_static PUBLIC ${MPFR_STATIC} )
target_link_libraries ( my_cxx_static PUBLIC ${MPFR_STATIC} )
endif ( )
include_directories ( ${MPFR_INCLUDE_DIR} )

# mpfr:
message ( STATUS "MPFR library: ${MPFR_LIBRARIES}" )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( my PRIVATE ${MPFR_LIBRARIES} )
target_link_libraries ( my_cxx PRIVATE ${MPFR_LIBRARIES} )
endif ( )
if ( BUILD_STATIC_LIBS )
target_link_libraries ( my_static PUBLIC ${MPFR_STATIC} )
target_link_libraries ( my_cxx_static PUBLIC ${MPFR_STATIC} )
endif ( )
include_directories ( ${MPFR_INCLUDE_DIR} )

#-------------------------------------------------------------------------------
# installation location
Expand Down
2 changes: 1 addition & 1 deletion Example/Include/my.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// file, since it is constructed from Config/my.h.in by cmake.

// version and date for example user library
#define MY_DATE "Jan 1, 2024"
#define MY_DATE "Jan XX, 2024"
#define MY_MAJOR_VERSION 1
#define MY_MINOR_VERSION 6
#define MY_PATCH_VERSION 0
Expand Down
16 changes: 8 additions & 8 deletions Example/Include/my_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
// SuiteSparse include files for C/C++:
#include "SuiteSparse_config.h"
#if !defined (SUITESPARSE_VERSION) || \
(SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,4))
#error "This library requires SuiteSparse_config 7.4.0 or later"
(SUITESPARSE_VERSION < SUITESPARSE_VER_CODE(7,5))
#error "This library requires SuiteSparse_config 7.5.0 or later"
#endif

#include "amd.h"
Expand All @@ -43,7 +43,7 @@
#endif

#include "cholmod.h"
#if CHOLMOD_VERSION < SUITESPARSE_VER_CODE(3,3)
#if CHOLMOD_VERSION < SUITESPARSE_VER_CODE(5,1)
#error "This library requires CHOLMOD 5.1.0 or later"
#endif

Expand All @@ -60,16 +60,16 @@
#if ! defined (NO_GRAPHBLAS)
#include "GraphBLAS.h"
#if !defined ( GxB_SUITESPARSE_GRAPHBLAS ) || \
GxB_IMPLEMENTATION < GxB_VERSION (8,3,1)
#error "This library requires SuiteSparse:GraphBLAS 8.3.1 or later"
GxB_IMPLEMENTATION < GxB_VERSION (9,0,0)
#error "This library requires SuiteSparse:GraphBLAS 9.0.0 or later"
#endif
#endif

#if ! defined (NO_LAGRAPH)
#include "LAGraph.h"
#if VER3CODE (LAGRAPH_VERSION_MAJOR,LAGRAPH_VERSION_MINOR, \
LAGRAPH_VERSION_UPDATE) < VER3CODE(1,1,0)
#error "This library requires LAGraph 1.1.0 or later"
LAGRAPH_VERSION_UPDATE) < VER3CODE(1,1,1)
#error "This library requires LAGraph 1.1.1 or later"
#endif
#endif

Expand Down Expand Up @@ -100,7 +100,7 @@
#endif

#include "umfpack.h"
#if UMFPACK_VER < SUITESPARSE_VER_CODE(4,3)
#if UMFPACK_VER < SUITESPARSE_VER_CODE(6,3)
#error "This library requires UMFPACK 6.3.0 or later"
#endif

Expand Down
Loading

0 comments on commit 48c4e0c

Please sign in to comment.