Skip to content

Commit

Permalink
SPEX 3.1.0: major API revision from SPEX 2.x; many more features (Cho…
Browse files Browse the repository at this point in the history
…lesky & Backslash)
  • Loading branch information
DrTimothyAldenDavis committed Jan 30, 2024
1 parent aac2fa9 commit 32caf51
Show file tree
Hide file tree
Showing 229 changed files with 60,090 additions and 7,494 deletions.
29 changes: 29 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
Feb XX, 2024: version 7.7.0

* SPEX 3.1.0: major revision to API, new methods. Added SPEX_Cholesky,
SPEX_Backslash, and python interface. MATLAB interface revised.
* Example 1.7.0: revised for change in SPEX API
* SuiteSparse_config: only version number changed to reflect update to
SPEX.
* Package versions in this release:
SuiteSparse_config 7.7.0
AMD 3.3.1
BTF 2.3.1
CAMD 3.3.1
CCOLAMD 3.3.2
CHOLMOD 5.2.0
COLAMD 3.3.2
CSparse 4.3.1
CXSparse 4.3.1
Example 1.7.0
GraphBLAS 9.0.1
KLU 2.3.2
LDL 3.3.1
LAGraph 1.1.2
SuiteSparse_Mongoose 3.3.2
ParU 0.1.2
RBio 4.3.1
SPEX 3.1.0
SPQR 4.3.2
UMFPACK 6.3.2

Jan 20, 2024: version 7.6.0

* CHOLMOD 5.2.0: bug fix (restore ABI compatibility with 5.0.x, i.e., 5.2.0
Expand Down
8 changes: 4 additions & 4 deletions Example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ message ( STATUS "MY prefix path: ${CMAKE_PREFIX_PATH}" )
#-------------------------------------------------------------------------------

# cmake inserts the date and version number into Include/my.h:
set ( MY_DATE "Jan 20, 2024" )
set ( MY_DATE "Feb XX, 2024" )
set ( MY_VERSION_MAJOR 1 )
set ( MY_VERSION_MINOR 6 )
set ( MY_VERSION_PATCH 2 )
set ( MY_VERSION_PATCH 3 )

message ( STATUS "Building MY library version: v"
${MY_VERSION_MAJOR}.
Expand Down Expand Up @@ -87,7 +87,7 @@ project ( my
#-------------------------------------------------------------------------------

# look for all SuiteSparse packages:
find_package ( SuiteSparse_config 7.6.0 REQUIRED )
find_package ( SuiteSparse_config 7.7.0 REQUIRED )
find_package ( AMD 3.3.1 REQUIRED )
find_package ( BTF 2.3.1 REQUIRED )
find_package ( CAMD 3.3.1 REQUIRED )
Expand All @@ -103,7 +103,7 @@ find_package ( LAGraph 1.1.2 )
find_package ( SuiteSparse_Mongoose 3.3.2 REQUIRED )
find_package ( ParU 0.1.2 REQUIRED )
find_package ( RBio 4.3.1 REQUIRED )
find_package ( SPEX 2.3.2 REQUIRED ) # requires GMP and MPFR
find_package ( SPEX 3.1.0 REQUIRED ) # requires GMP and MPFR
find_package ( SPQR 4.3.2 REQUIRED )
find_package ( UMFPACK 6.3.2 REQUIRED )

Expand Down
4 changes: 2 additions & 2 deletions Example/Include/my.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// file, since it is constructed from Config/my.h.in by cmake.

// version and date for example user library
#define MY_DATE "Jan 20, 2024"
#define MY_DATE "Feb XX, 2024"
#define MY_MAJOR_VERSION 1
#define MY_MINOR_VERSION 6
#define MY_PATCH_VERSION 2
#define MY_PATCH_VERSION 3

#ifdef __cplusplus
extern "C" {
Expand Down
3 changes: 2 additions & 1 deletion Example/Source/my.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ int my_function (void) // returns 0 on success, -1 on failure
//--------------------------------------------------------------------------

OK (SPEX_initialize ( ) == SPEX_OK) ;
SPEX_version (version) ;
char spex_date [128] ;
OK (SPEX_version (version, spex_date) == SPEX_OK) ;
OK (my_check_version ("SPEX",
SPEX_VERSION_MAJOR, SPEX_VERSION_MINOR, SPEX_VERSION_SUB, SPEX_DATE,
version, SPEX__VERSION)) ;
Expand Down
3 changes: 2 additions & 1 deletion Example/Source/my_cxx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ int my_function (void) // returns 0 on success, -1 on failure
//--------------------------------------------------------------------------

OK (SPEX_initialize ( ) == SPEX_OK) ;
SPEX_version (version) ;
char spex_date [128] ;
OK (SPEX_version (version, spex_date) == SPEX_OK) ;
OK (my_check_version ("SPEX",
SPEX_VERSION_MAJOR, SPEX_VERSION_MINOR, SPEX_VERSION_SUB, SPEX_DATE,
version, SPEX__VERSION)) ;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SuiteSparse: A Suite of Sparse matrix packages at http://suitesparse.com
-----------------------------------------------------------------------------

Jan 20, 2024, SuiteSparse VERSION 7.6.0
Feb XX, 2024, SuiteSparse VERSION 7.7.0

SuiteSparse is a set of sparse-matrix-related packages written or co-authored
by Tim Davis, available at https://github.com/DrTimothyAldenDavis/SuiteSparse .
Expand Down
153 changes: 133 additions & 20 deletions SPEX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SuiteSparse/SPEX/CMakeLists.txt: cmake for SPEX
#-------------------------------------------------------------------------------

# SPEX_Left_LU: (c) 2019-2024, Chris Lourenco (US Naval Academy), Jinhao Chen,
# SPEX: (c) 2019-2024, Chris Lourenco (US Naval Academy), Jinhao Chen,
# Erick Moreno-Centeno, Timothy A. Davis, Texas A&M. All Rights Reserved.
# SPDX-License-Identifier: GPL-2.0-or-later or LGPL-3.0-or-later

Expand All @@ -12,10 +12,10 @@

cmake_minimum_required ( VERSION 3.22 )

set ( SPEX_DATE "Jan 20, 2024" )
set ( SPEX_VERSION_MAJOR 2 CACHE STRING "" FORCE )
set ( SPEX_VERSION_MINOR 3 CACHE STRING "" FORCE )
set ( SPEX_VERSION_SUB 2 CACHE STRING "" FORCE )
set ( SPEX_DATE "Feb XX, 2024" ) # FIXME for 7.7.0
set ( SPEX_VERSION_MAJOR 3 CACHE STRING "" FORCE )
set ( SPEX_VERSION_MINOR 1 CACHE STRING "" FORCE )
set ( SPEX_VERSION_SUB 0 CACHE STRING "" FORCE )

message ( STATUS "Building SPEX version: v"
${SPEX_VERSION_MAJOR}.
Expand Down Expand Up @@ -45,10 +45,10 @@ include ( SuiteSparsePolicy )
#-------------------------------------------------------------------------------

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

find_package ( AMD 3.3.1
Expand Down Expand Up @@ -82,8 +82,12 @@ configure_file ( "Config/SPEX_version.tex.in"
# include directories
#-------------------------------------------------------------------------------

include_directories ( SPEX_Left_LU/Source SPEX_Util/Source Include
SPEX_Left_LU/Demo )
include_directories ( Include
SPEX_Backslash/Source SPEX_Cholesky/Source SPEX_LU/Source
SPEX_Utilities/Source
${SUITESPARSE_CONFIG_INCLUDE_DIR}
${GMP_INCLUDE_DIR} ${MPFR_INCLUDE_DIR}
${AMD_INCLUDE_DIR} ${COLAMD_INCLUDE_DIR} )

#-------------------------------------------------------------------------------
# dynamic spex library properties
Expand Down Expand Up @@ -338,6 +342,36 @@ if ( NOT MSVC )
DESTINATION ${SUITESPARSE_PKGFILEDIR}/pkgconfig )
endif ( )

#-------------------------------------------------------------------------------
# python interface
#-------------------------------------------------------------------------------

file ( GLOB SPEX_PYTHON_SOURCES "Python/SPEXpy/Source/*.c" )

add_library ( spexpython SHARED ${SPEX_PYTHON_SOURCES} )

set_target_properties ( spexpython PROPERTIES
VERSION ${SPEX_VERSION_MAJOR}.${SPEX_VERSION_MINOR}.${SPEX_VERSION_SUB}
C_STANDARD 11
C_STANDARD_REQUIRED ON
SOVERSION ${SPEX_VERSION_MAJOR}
PUBLIC_HEADER "Python/SPEXpy/Source/spex_python_connect.h" )

# MPFR:
target_link_libraries ( spexpython PUBLIC ${MPFR_LIBRARIES} )

# GMP:
# must occur after MPFR
target_link_libraries ( spexpython PUBLIC ${GMP_LIBRARIES} )

target_link_libraries ( spexpython PUBLIC SPEX )

install ( TARGETS spexpython
LIBRARY DESTINATION ${SUITESPARSE_LIBDIR}
ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR}
RUNTIME DESTINATION ${SUITESPARSE_BINDIR}
PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} )

#-------------------------------------------------------------------------------
# Demo library and programs
#-------------------------------------------------------------------------------
Expand All @@ -354,21 +388,38 @@ if ( SUITESPARSE_DEMOS )
# Demo programs
#---------------------------------------------------------------------------

add_executable ( spexlu_demo "SPEX_Left_LU/Demo/spexlu_demo.c"
"SPEX_Left_LU/Demo/demos.c" )
add_executable ( example "SPEX_Left_LU/Demo/example.c" )
add_executable ( example2 "SPEX_Left_LU/Demo/example2.c"
"SPEX_Left_LU/Demo/demos.c" )
include_directories ( Demo )
file ( GLOB SPEX_DEMO_SOURCES "Demo/Utilities/*.c" )

add_executable ( spex_demo_backslash "Demo/spex_demo_backslash.c" ${SPEX_DEMO_SOURCES} )
add_executable ( spex_demo_cholesky_extended "Demo/spex_demo_cholesky_extended.c" ${SPEX_DEMO_SOURCES} )
add_executable ( spex_demo_cholesky_simple "Demo/spex_demo_cholesky_simple.c" ${SPEX_DEMO_SOURCES} )
add_executable ( spex_demo_lu_doub "Demo/spex_demo_lu_doub.c" ${SPEX_DEMO_SOURCES} )
add_executable ( spex_demo_lu_extended "Demo/spex_demo_lu_extended.c" ${SPEX_DEMO_SOURCES} )
add_executable ( spex_demo_lu_simple1 "Demo/spex_demo_lu_simple1.c" ${SPEX_DEMO_SOURCES} )
add_executable ( spex_demo_lu_simple2 "Demo/spex_demo_lu_simple2.c" ${SPEX_DEMO_SOURCES} )
add_executable ( spex_demo_threaded "Demo/spex_demo_threaded.c" ${SPEX_DEMO_SOURCES} )

# Libraries required for Demo programs
if ( BUILD_SHARED_LIBS )
target_link_libraries ( spexlu_demo PUBLIC SPEX )
target_link_libraries ( example PUBLIC SPEX )
target_link_libraries ( example2 PUBLIC SPEX )
target_link_libraries ( spex_demo_backslash PUBLIC SPEX SuiteSparse::SuiteSparseConfig ${MPFR_LIBRARIES} ${GMP_LIBRARIES} )
target_link_libraries ( spex_demo_cholesky_extended PUBLIC SPEX SuiteSparse::SuiteSparseConfig ${MPFR_LIBRARIES} ${GMP_LIBRARIES} )
target_link_libraries ( spex_demo_cholesky_simple PUBLIC SPEX SuiteSparse::SuiteSparseConfig ${MPFR_LIBRARIES} ${GMP_LIBRARIES} )
target_link_libraries ( spex_demo_lu_doub PUBLIC SPEX SuiteSparse::SuiteSparseConfig ${MPFR_LIBRARIES} ${GMP_LIBRARIES} )
target_link_libraries ( spex_demo_lu_extended PUBLIC SPEX SuiteSparse::SuiteSparseConfig ${MPFR_LIBRARIES} ${GMP_LIBRARIES} )
target_link_libraries ( spex_demo_lu_simple1 PUBLIC SPEX SuiteSparse::SuiteSparseConfig ${MPFR_LIBRARIES} ${GMP_LIBRARIES} )
target_link_libraries ( spex_demo_lu_simple2 PUBLIC SPEX SuiteSparse::SuiteSparseConfig ${MPFR_LIBRARIES} ${GMP_LIBRARIES} )
target_link_libraries ( spex_demo_threaded PUBLIC SPEX SuiteSparse::SuiteSparseConfig ${MPFR_LIBRARIES} ${GMP_LIBRARIES} )

else ( )
target_link_libraries ( spexlu_demo PUBLIC SPEX_static )
target_link_libraries ( example PUBLIC SPEX_static )
target_link_libraries ( example2 PUBLIC SPEX_static )
target_link_libraries ( spex_demo_backslash PUBLIC SPEX_static )
target_link_libraries ( spex_demo_cholesky_extended PUBLIC SPEX_static )
target_link_libraries ( spex_demo_cholesky_simple PUBLIC SPEX_static )
target_link_libraries ( spex_demo_lu_doub PUBLIC SPEX_static )
target_link_libraries ( spex_demo_lu_extended PUBLIC SPEX_static )
target_link_libraries ( spex_demo_lu_simple1 PUBLIC SPEX_static )
target_link_libraries ( spex_demo_lu_simple2 PUBLIC SPEX_static )
target_link_libraries ( spex_demo_threaded PUBLIC SPEX_static )
endif ( )

else ( )
Expand All @@ -377,8 +428,70 @@ else ( )

endif ( )

#-------------------------------------------------------------------------------
# configure MATLAB and Tcov
#-------------------------------------------------------------------------------

# get paths to libraries
get_filename_component ( GMP_PATH ${GMP_LIBRARY} DIRECTORY )
get_filename_component ( SUITESPARSE_CONFIG_PATH ${SUITESPARSE_CONFIG_LIBRARY} DIRECTORY )
get_filename_component ( COLAMD_PATH ${COLAMD_LIBRARY} DIRECTORY )
get_filename_component ( AMD_PATH ${AMD_LIBRARY} DIRECTORY )
get_filename_component ( MPFR_PATH ${MPFR_LIBRARY} DIRECTORY )

# message ( STATUS "suitesparseconfig path ${SUITESPARSE_CONFIG_PATH}" )
# message ( STATUS "colamd path ${COLAMD_PATH}" )
# message ( STATUS "amd path ${AMD_PATH}" )
# message ( STATUS "gmp path ${GMP_PATH}" )
# message ( STATUS "mpfr path ${MPFR_PATH}" )

# construct the -I list
get_target_property ( INCS SPEX INCLUDE_DIRECTORIES )
list ( TRANSFORM INCS PREPEND " -I" )
set ( SPEX_INCS "" )
foreach ( INC ${INCS} )
# message ( STATUS "check inc: ${INC}" )
if ( NOT ${INC} MATCHES "TARGET_PROPERTY" )
# message ( STATUS "add inc: ${INC}" )
string ( APPEND SPEX_INCS " " ${INC} )
endif ( )
endforeach ( )
# message ( STATUS "Incs: ${SPEX_INCS}" )

# construct the library list for Tcov/Makefile
set ( SPEX_LIB_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}" )
get_target_property ( LIBS SPEX LINK_LIBRARIES )
string ( REPLACE "." "\\." LIBSUFFIX ${SPEX_LIB_SUFFIX} )
set ( SPEX_LIBS "" )
foreach ( LIB_NAME ${LIBS} )
# message ( STATUS "Lib: ${LIB_NAME}" )
if ( LIB_NAME MATCHES "::" )
# do nothing
elseif ( LIB_NAME MATCHES ${LIBSUFFIX} )
# message ( STATUS "has suffix" )
string ( APPEND SPEX_LIBS " " ${LIB_NAME} )
else ( )
# message ( STATUS "no suffix" )
string ( APPEND SPEX_LIBS " -l" ${LIB_NAME} )
endif ( )
endforeach ( )
# message ( STATUS "Libs: ${SPEX_LIBS}" )

configure_file (
"Config/spex_deps.m.in"
"${PROJECT_SOURCE_DIR}/MATLAB/spex_deps.m"
@ONLY
NEWLINE_STYLE LF )

configure_file (
"Config/Tcov_Makefile.in"
"${PROJECT_SOURCE_DIR}/Tcov/Makefile"
@ONLY
NEWLINE_STYLE LF )

#-------------------------------------------------------------------------------
# report status
#-------------------------------------------------------------------------------

include ( SuiteSparseReport )

Loading

0 comments on commit 32caf51

Please sign in to comment.