From 2f670f6fe3eb8c8da87d63c02c9a040ce40ee1b2 Mon Sep 17 00:00:00 2001 From: Tim Davis Date: Wed, 29 Nov 2023 03:20:41 -0600 Subject: [PATCH 01/21] GraphBLAS/Tcov testing --- .../PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2.c | 2 +- .../PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c | 2 +- .../PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c | 2 +- GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c | 2 +- .../PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c | 2 +- .../PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c | 2 +- .../PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c | 2 +- .../PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c | 2 +- GraphBLAS/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2.c index 2765e4091..a166d9ec2 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2.c @@ -123,7 +123,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0xa7db05133c25c170 ; - v [0] = 8 ; v [1] = 0 ; v [2] = 0 ; + v [0] = 8 ; v [1] = 0 ; v [2] = 0 ; // intentionally stale version defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c index 754c66d6d..78be305c4 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c @@ -123,7 +123,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x31aff911c5850713 ; - v [0] = 8 ; v [1] = 2 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 3 ; v [2] = 0 ; // keep at current version defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c index fcdab4322..ef6d00339 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c @@ -123,7 +123,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x227f98d0b09e286f ; - v [0] = 8 ; v [1] = 2 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 3 ; v [2] = 0 ; // keep at current version defn [0] = NULL ; defn [1] = GB_my_rdiv_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c index 6bb82de35..47dbe76db 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c @@ -105,7 +105,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0xdf8cbb0c0ac7ce22 ; - v [0] = 8 ; v [1] = 2 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 3 ; v [2] = 0 ; // keep at current version defn [0] = NULL ; defn [1] = NULL ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c index 0c875d343..ea5c911a3 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c @@ -123,7 +123,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x422f36dae3aeca51 ; - v [0] = 8 ; v [1] = 2 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 3 ; v [2] = 0 ; // keep at current version defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c index 483620b6d..1b968125e 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c @@ -123,7 +123,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x654ba0e0a34027e9 ; - v [0] = 8 ; v [1] = 2 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 3 ; v [2] = 0 ; // keep at current version defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c index 29a11cd6d..2f3fb7e33 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c @@ -123,7 +123,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x98afaa59c37fb8bb ; - v [0] = 8 ; v [1] = 2 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 3 ; v [2] = 0 ; // keep at current version defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c index 2997ba748..0f994de01 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c @@ -123,7 +123,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0xfaa3c6cd7f90ec16 ; - v [0] = 8 ; v [1] = 2 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 3 ; v [2] = 0 ; // keep at current version defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c b/GraphBLAS/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c index 3d24e8db4..fc95d0ee6 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c @@ -37,7 +37,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0xa98ff14e387744fe ; - v [0] = 8 ; v [1] = 2 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 3 ; v [2] = 0 ; // keep at current version defn [0] = GB_my_rdiv_USER_DEFN ; defn [1] = NULL ; defn [2] = NULL ; From e261422fdbd6539e02fa9c221211a87cdca7c41c Mon Sep 17 00:00:00 2001 From: Tim Davis Date: Wed, 29 Nov 2023 04:08:25 -0600 Subject: [PATCH 02/21] GraphBLAS/Tcov, test11 for compiler flags --- GraphBLAS/Test/GB_mex_test11.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/GraphBLAS/Test/GB_mex_test11.c b/GraphBLAS/Test/GB_mex_test11.c index b02083d74..a9ae2cc94 100644 --- a/GraphBLAS/Test/GB_mex_test11.c +++ b/GraphBLAS/Test/GB_mex_test11.c @@ -161,8 +161,12 @@ if (jit_enabled) mxFree (save_c) ; save_c = NULL ; + // test compiler flags OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_COMPILER_FLAGS, &s)) ; printf ("default flags [%s]\n", s) ; + len = strlen (s) ; + char *save_flags = mxMalloc (len+2) ; + strcpy (save_flags, s) ; OK (GxB_set (GxB_JIT_C_COMPILER_FLAGS, "-g")) ; OK (GxB_get (GxB_JIT_C_COMPILER_FLAGS, &s)) ; CHECK (MATCH (s, "-g")) ; @@ -171,7 +175,11 @@ if (jit_enabled) OK (GxB_Global_Option_set_CHAR (GxB_JIT_C_COMPILER_FLAGS, "-O0")) ; OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_COMPILER_FLAGS, &t)) ; CHECK (MATCH (t, "-O0")) ; + OK (GxB_Global_Option_set_CHAR (GxB_JIT_C_COMPILER_FLAGS, save_flags)) ; + mxFree (save_flags) ; + save_flags = NULL ; + // test libraries for cmake OK (GxB_get (GxB_JIT_C_CMAKE_LIBS, &s)) ; printf ("default C cmake libs [%s]\n", s) ; printf ("set cmake libs:\n") ; @@ -227,6 +235,7 @@ if (jit_enabled) OK (GxB_Global_Option_get_CHAR (GxB_JIT_C_PREFACE, &t)) ; CHECK (MATCH (t, "// more stuff here")) ; + OK (GxB_Type_new (&MyType, 0, "mytype", "typedef double mytype ;")) ; OK (GxB_Type_size (&mysize, MyType)) ; CHECK (mysize == sizeof (double)) ; From 41166cee176eea84ebd6709496ee2295ee0fd53f Mon Sep 17 00:00:00 2001 From: Tim Davis Date: Wed, 29 Nov 2023 04:30:20 -0600 Subject: [PATCH 03/21] CHOLMOD: horzcat, check if A and B dtype mismatch --- CHOLMOD/MatrixOps/cholmod_horzcat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHOLMOD/MatrixOps/cholmod_horzcat.c b/CHOLMOD/MatrixOps/cholmod_horzcat.c index cd8c68a4e..f8ff46e11 100644 --- a/CHOLMOD/MatrixOps/cholmod_horzcat.c +++ b/CHOLMOD/MatrixOps/cholmod_horzcat.c @@ -89,7 +89,7 @@ cholmod_sparse *CHOLMOD(horzcat) // return C = [A B] ERROR (CHOLMOD_INVALID, "A and B must have same # rows") ; return (NULL) ; } - if (mode != 0 && (A->xtype != B->xtype || A->dtype != A->dtype)) + if (mode != 0 && (A->xtype != B->xtype || A->dtype != B->dtype)) { // A and B must have the same xtype and dtype if mode is 0 ERROR (CHOLMOD_INVALID, "A and B must have same xtype and dtype") ; From c53fafbe8fafdc9af44076e52922977f0065ee43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 29 Nov 2023 10:09:09 +0100 Subject: [PATCH 04/21] Absorb CHOLMOD_CUDA module into CHOLMOD library --- CHOLMOD/CMakeLists.txt | 75 ++--------- CHOLMOD/Config/CHOLMODConfig.cmake.in | 21 --- CHOLMOD/Config/CHOLMOD_CUDA.pc.in | 17 --- CHOLMOD/Config/CHOLMOD_CUDAConfig.cmake.in | 141 --------------------- CHOLMOD/GPU/CMakeLists.txt | 127 +++---------------- KLU/CMakeLists.txt | 3 - SPQR/CMakeLists.txt | 21 +-- SPQR/GPUQREngine/CMakeLists.txt | 2 +- UMFPACK/CMakeLists.txt | 3 - 9 files changed, 32 insertions(+), 378 deletions(-) delete mode 100644 CHOLMOD/Config/CHOLMOD_CUDA.pc.in delete mode 100644 CHOLMOD/Config/CHOLMOD_CUDAConfig.cmake.in diff --git a/CHOLMOD/CMakeLists.txt b/CHOLMOD/CMakeLists.txt index 3c9140b98..680ce0529 100644 --- a/CHOLMOD/CMakeLists.txt +++ b/CHOLMOD/CMakeLists.txt @@ -262,18 +262,6 @@ endif ( ) include ( SuiteSparseLAPACK ) # requires cmake 3.22 endif ( ) -#------------------------------------------------------------------------------- -# find CUDA -#------------------------------------------------------------------------------- - -if ( SUITESPARSE_CUDA ) - # with CUDA - add_subdirectory ( GPU ) - message ( STATUS "CUDA libraries: " ${CUDA_LIBRARIES} ) - include_directories ( GPU ${CUDAToolkit_INCLUDE_DIRS} ) - link_directories ( "GPU" "${CUDA_LIBRARIES}" "/usr/local/cuda/lib64/stubs" "/usr/local/cuda/lib64" ) -endif ( ) - #------------------------------------------------------------------------------- # configure files #------------------------------------------------------------------------------- @@ -493,13 +481,10 @@ endif ( ) # CHOLMOD_CUDA if ( SUITESPARSE_CUDA ) if ( BUILD_SHARED_LIBS ) - target_link_libraries ( CHOLMOD PRIVATE CHOLMOD_CUDA ${CUDA_LIBRARIES} ) target_compile_definitions ( CHOLMOD PUBLIC "SUITESPARSE_CUDA" ) endif ( ) - set ( CHOLMOD_STATIC_MODULES "${CHOLMOD_STATIC_MODULES} CHOLMOD_CUDA" ) set ( CHOLMOD_CFLAGS "${CHOLMOD_CFLAGS} -DSUITESPARSE_CUDA" ) if ( BUILD_STATIC_LIBS ) - target_link_libraries ( CHOLMOD_static PUBLIC CHOLMOD_CUDA_static ${CUDA_LIBRARIES} ) target_compile_definitions ( CHOLMOD_static PUBLIC "SUITESPARSE_CUDA" ) endif ( ) if ( BUILD_SHARED_LIBS ) @@ -529,6 +514,18 @@ if ( SUITESPARSE_CUDA ) endif ( ) +#------------------------------------------------------------------------------- +# find CUDA +#------------------------------------------------------------------------------- + +if ( SUITESPARSE_CUDA ) + # with CUDA + add_subdirectory ( GPU ) + message ( STATUS "CUDA libraries: " ${CUDA_LIBRARIES} ) + include_directories ( GPU ${CUDAToolkit_INCLUDE_DIRS} ) + link_directories ( "GPU" "${CUDA_LIBRARIES}" "/usr/local/cuda/lib64/stubs" "/usr/local/cuda/lib64" ) +endif ( ) + #------------------------------------------------------------------------------- # CHOLMOD installation location #------------------------------------------------------------------------------- @@ -662,41 +659,17 @@ if ( DEMO ) # link the demos with shared libraries target_link_libraries ( cholmod_di_simple PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_di_simple PUBLIC CHOLMOD_CUDA ) - endif ( ) target_link_libraries ( cholmod_si_simple PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_si_simple PUBLIC CHOLMOD_CUDA ) - endif ( ) target_link_libraries ( cholmod_dl_simple PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_dl_simple PUBLIC CHOLMOD_CUDA ) - endif ( ) target_link_libraries ( cholmod_sl_simple PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_sl_simple PUBLIC CHOLMOD_CUDA ) - endif ( ) else ( ) # link the demos with static libraries target_link_libraries ( cholmod_di_simple PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_di_simple PUBLIC CHOLMOD_CUDA_static ) - endif ( ) target_link_libraries ( cholmod_si_simple PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_si_simple PUBLIC CHOLMOD_CUDA_static ) - endif ( ) target_link_libraries ( cholmod_dl_simple PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_dl_simple PUBLIC CHOLMOD_CUDA_static ) - endif ( ) target_link_libraries ( cholmod_sl_simple PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_sl_simple PUBLIC CHOLMOD_CUDA_static ) - endif ( ) endif ( ) @@ -718,41 +691,17 @@ if ( BUILD_SHARED_LIBS ) # link the tests with shared libraries target_link_libraries ( cholmod_di_demo PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_di_demo PUBLIC CHOLMOD_CUDA ) - endif ( ) target_link_libraries ( cholmod_si_demo PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_si_demo PUBLIC CHOLMOD_CUDA ) - endif ( ) target_link_libraries ( cholmod_dl_demo PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_dl_demo PUBLIC CHOLMOD_CUDA ) - endif ( ) target_link_libraries ( cholmod_sl_demo PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_sl_demo PUBLIC CHOLMOD_CUDA ) - endif ( ) else ( ) # link the tests with static libraries target_link_libraries ( cholmod_di_demo PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_di_demo PUBLIC CHOLMOD_CUDA_static ) - endif ( ) target_link_libraries ( cholmod_si_demo PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_si_demo PUBLIC CHOLMOD_CUDA_static ) - endif ( ) target_link_libraries ( cholmod_dl_demo PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_dl_demo PUBLIC CHOLMOD_CUDA_static ) - endif ( ) target_link_libraries ( cholmod_sl_demo PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig ) - if ( SUITESPARSE_CUDA ) - target_link_libraries ( cholmod_sl_demo PUBLIC CHOLMOD_CUDA_static ) - endif ( ) endif ( ) diff --git a/CHOLMOD/Config/CHOLMODConfig.cmake.in b/CHOLMOD/Config/CHOLMODConfig.cmake.in index 9782bbf26..9e9db04c7 100644 --- a/CHOLMOD/Config/CHOLMODConfig.cmake.in +++ b/CHOLMOD/Config/CHOLMODConfig.cmake.in @@ -38,27 +38,6 @@ set ( CHOLMOD_VERSION "@CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_ include ( CMakeFindDependencyMacro ) set ( _dependencies_found ON ) -if ( @SUITESPARSE_CUDA@ ) - # Look for imported targets of additional dependency if CHOLMOD was built with CUDA - - if ( NOT CHOLMOD_CUDA_FOUND ) - if ( @SUITESPARSE_IN_BUILD_TREE@ ) - # First check in a common build tree - find_dependency ( CHOLMOD_CUDA @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@ - PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) - # Then, check in the currently active CMAKE_MODULE_PATH - if ( NOT CHOLMOD_CUDA_FOUND ) - find_dependency ( CHOLMOD_CUDA @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@ ) - endif ( ) - else ( ) - find_dependency ( CHOLMOD_CUDA @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@ ) - endif ( ) - endif ( ) - if ( NOT CHOLMOD_CUDA_FOUND ) - set ( _dependencies_found OFF ) - endif ( ) -endif ( ) - # Look for SuiteSparse_config, COLAMD, and AMD targets if ( @SUITESPARSE_IN_BUILD_TREE@ ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) diff --git a/CHOLMOD/Config/CHOLMOD_CUDA.pc.in b/CHOLMOD/Config/CHOLMOD_CUDA.pc.in deleted file mode 100644 index 552f784ce..000000000 --- a/CHOLMOD/Config/CHOLMOD_CUDA.pc.in +++ /dev/null @@ -1,17 +0,0 @@ -# CHOLMOD_CUDA, Copyright (c) 2005-2023, Timothy A. Davis. -# All Rights Reserved. -# SPDX-License-Identifier: GPL-2.0-or-later - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -# FIXME: Which flags do we need for static linking? - -Name: CHOLMOD_CUDA -URL: https://github.com/DrTimothyAldenDavis/SuiteSparse -Description: CHOLMOD/GPU module in SuiteSparse -Version: @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@ -Libs: -L${libdir} -lcholmod_cuda -Cflags: -I${includedir} -DSUITESPARSE_CUDA diff --git a/CHOLMOD/Config/CHOLMOD_CUDAConfig.cmake.in b/CHOLMOD/Config/CHOLMOD_CUDAConfig.cmake.in deleted file mode 100644 index e00f138b1..000000000 --- a/CHOLMOD/Config/CHOLMOD_CUDAConfig.cmake.in +++ /dev/null @@ -1,141 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/CHOLMOD/cmake_modules/CHOLMOD_CUDAConfig.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# CHOLMOD_CUDAConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the CHOLMOD_CUDA include file and compiled library. -# The following targets are defined: -# SuiteSparse::CHOLMOD_CUDA - for the shared library (if available) -# SuiteSparse::CHOLMOD_CUDA_static - for the static library (if available) - -# For backward compatibility the following variables are set: - -# CHOLMOD_CUDA_LIBRARY - dynamic CHOLMOD_CUDA library -# CHOLMOD_CUDA_STATIC - static CHOLMOD_CUDA library -# CHOLMOD_CUDA_LIBRARIES - libraries when using CHOLMOD_CUDA -# CHOLMOD_CUDA_FOUND - true if CHOLMOD_CUDA found - -# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is -# installed. - -#------------------------------------------------------------------------------- - -@PACKAGE_INIT@ - -set ( CHOLMOD_CUDA_DATE "@CHOLMOD_DATE@" ) -set ( CHOLMOD_CUDA_VERSION_MAJOR @CHOLMOD_VERSION_MAJOR@ ) -set ( CHOLMOD_CUDA_VERSION_MINOR @CHOLMOD_VERSION_MINOR@ ) -set ( CHOLMOD_CUDA_VERSION_PATCH @CHOLMOD_VERSION_SUB@ ) -set ( CHOLMOD_CUDA_VERSION "@CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@" ) - -# Check for dependent targets -include ( CMakeFindDependencyMacro ) -set ( _dependencies_found ON ) - -# Look for NVIDIA CUDA toolkit -if ( NOT CUDAToolkit_FOUND ) - find_dependency ( CUDAToolkit @CUDAToolkit_VERSION_MAJOR@ ) - if ( NOT CUDAToolkit_FOUND ) - set ( _dependencies_found OFF ) - endif ( ) -endif ( ) - -if ( NOT _dependencies_found ) - set ( CHOLMOD_CUDA_FOUND OFF ) - return ( ) -endif ( ) - -# Import target -include ( ${CMAKE_CURRENT_LIST_DIR}/CHOLMOD_CUDATargets.cmake ) - -# The following is only for backward compatibility with FindCHOLMOD_CUDA. - -set ( _target_shared SuiteSparse::CHOLMOD_CUDA ) -set ( _target_static SuiteSparse::CHOLMOD_CUDA_static ) -set ( _var_prefix "CHOLMOD_CUDA" ) - -if ( NOT @BUILD_SHARED_LIBS@ AND NOT TARGET ${_target_shared} ) - # make sure there is always an import target without suffix ) - add_library ( ${_target_shared} ALIAS ${_target_static} ) -endif ( ) - -get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) -if ( ${_var_prefix}_INCLUDE_DIR ) - # First item in SuiteSparse targets contains the "main" header directory. - list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) -endif ( ) -get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) -if ( NOT ${_var_prefix}_LIBRARY ) - get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) - if ( EXISTS ${_library_chk} ) - set ( ${_var_prefix}_LIBRARY ${_library_chk} ) - endif ( ) -endif ( ) -if ( TARGET ${_target_static} ) - get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) -endif ( ) - -# Check for most common build types -set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" "None" ) - -get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) -if ( _isMultiConfig ) - # For multi-configuration generators (e.g., Visual Studio), prefer those - # configurations. - list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) -else ( ) - # For single-configuration generators, prefer the current configuration. - list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) -endif ( ) - -list ( REMOVE_DUPLICATES _config_types ) - -foreach ( _config ${_config_types} ) - string ( TOUPPER ${_config} _uc_config ) - if ( NOT ${_var_prefix}_LIBRARY ) - get_target_property ( _library_chk ${_target_shared} - IMPORTED_IMPLIB_${_uc_config} ) - if ( EXISTS ${_library_chk} ) - set ( ${_var_prefix}_LIBRARY ${_library_chk} ) - endif ( ) - endif ( ) - if ( NOT ${_var_prefix}_LIBRARY ) - get_target_property ( _library_chk ${_target_shared} - IMPORTED_LOCATION_${_uc_config} ) - if ( EXISTS ${_library_chk} ) - set ( ${_var_prefix}_LIBRARY ${_library_chk} ) - endif ( ) - endif ( ) - if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) - get_target_property ( _library_chk ${_target_static} - IMPORTED_LOCATION_${_uc_config} ) - if ( EXISTS ${_library_chk} ) - set ( ${_var_prefix}_STATIC ${_library_chk} ) - endif ( ) - endif ( ) -endforeach ( ) - -set ( CHOLMOD_CUDA_LIBRARIES ${CHOLMOD_CUDA_LIBRARY} ) - -macro ( suitesparse_check_exist _var _files ) - # ignore generator expressions - string ( GENEX_STRIP "${_files}" _files2 ) - - foreach ( _file ${_files2} ) - if ( NOT EXISTS "${_file}" ) - message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) - endif ( ) - endforeach () -endmacro ( ) - -suitesparse_check_exist ( CHOLMOD_CUDA_LIBRARY ${CHOLMOD_CUDA_LIBRARY} ) - -message ( STATUS "CHOLMOD_CUDA version: ${CHOLMOD_CUDA_VERSION}" ) -message ( STATUS "CHOLMOD_CUDA library: ${CHOLMOD_CUDA_LIBRARY}" ) -message ( STATUS "CHOLMOD_CUDA static: ${CHOLMOD_CUDA_STATIC}" ) diff --git a/CHOLMOD/GPU/CMakeLists.txt b/CHOLMOD/GPU/CMakeLists.txt index 1df828643..d04670e55 100644 --- a/CHOLMOD/GPU/CMakeLists.txt +++ b/CHOLMOD/GPU/CMakeLists.txt @@ -20,9 +20,7 @@ message ( STATUS "Building CHOLMOD_CUDA version: v" include ( SuiteSparsePolicy ) -project ( cholmod_cuda - VERSION "${CHOLMOD_VERSION_MAJOR}.${CHOLMOD_VERSION_MINOR}.${CHOLMOD_VERSION_SUB}" - LANGUAGES C CXX CUDA ) +enable_language ( CUDA ) set ( CMAKE_CUDA_FLAGS "-cudart=static -lineinfo -DSUITESPARSE_CUDA" ) set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSUITESPARSE_CUDA" ) message ( STATUS "C++ flags for CUDA: ${CMAKE_CXX_FLAGS}" ) @@ -31,32 +29,11 @@ file ( GLOB CHOLMOD_CUDA_SOURCES "cholmod_gpu.c" "cholmod_l_gpu.c" "cholmod_gpu_kernels.cu" ) if ( BUILD_SHARED_LIBS ) - add_library ( CHOLMOD_CUDA SHARED ${CHOLMOD_CUDA_SOURCES} ) - - set_target_properties ( CHOLMOD_CUDA PROPERTIES - VERSION ${CHOLMOD_VERSION_MAJOR}.${CHOLMOD_VERSION_MINOR}.${CHOLMOD_VERSION_SUB} - CXX_STANDARD_REQUIRED ON - CXX_STANDARD 17 - C_STANDARD_REQUIRED ON - C_STANDARD 11 - OUTPUT_NAME cholmod_cuda - SOVERSION ${CHOLMOD_VERSION_MAJOR} ) + target_sources ( CHOLMOD PRIVATE ${CHOLMOD_CUDA_SOURCES} ) endif ( ) if ( BUILD_STATIC_LIBS ) - add_library ( CHOLMOD_CUDA_static STATIC ${CHOLMOD_CUDA_SOURCES} ) - - set_target_properties ( CHOLMOD_CUDA_static PROPERTIES - CXX_STANDARD_REQUIRED ON - CXX_STANDARD 17 - C_STANDARD_REQUIRED ON - C_STANDARD 11 - OUTPUT_NAME cholmod_cuda ) - - if ( MSVC ) - set_target_properties ( CHOLMOD_CUDA_static PROPERTIES - OUTPUT_NAME cholmod_cuda_static ) - endif ( ) + target_sources ( CHOLMOD_static PRIVATE ${CHOLMOD_CUDA_SOURCES} ) endif ( ) set ( CHOLMOD_CUDA_INCLUDES @@ -71,102 +48,28 @@ set ( CHOLMOD_CUDA_INCLUDES include_directories ( ${CHOLMOD_CUDA_INCLUDES} ${CUDAToolkit_INCLUDE_DIRS} ) if ( BUILD_SHARED_LIBS ) - target_include_directories ( CHOLMOD_CUDA PRIVATE + target_include_directories ( CHOLMOD PRIVATE ${CUDAToolkit_INCLUDE_DIRS} ${CHOLMOD_CUDA_INCLUDES} ) - set_target_properties ( CHOLMOD_CUDA PROPERTIES POSITION_INDEPENDENT_CODE ON ) - set_target_properties ( CHOLMOD_CUDA PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) - target_compile_definitions ( CHOLMOD_CUDA PUBLIC "SUITESPARSE_CUDA" ) + set_target_properties ( CHOLMOD PROPERTIES POSITION_INDEPENDENT_CODE ON ) + set_target_properties ( CHOLMOD PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) + target_compile_definitions ( CHOLMOD PUBLIC "SUITESPARSE_CUDA" ) endif ( ) if ( BUILD_STATIC_LIBS ) - target_include_directories ( CHOLMOD_CUDA_static PRIVATE + target_include_directories ( CHOLMOD_static PRIVATE ${CUDAToolkit_INCLUDE_DIRS} ${CHOLMOD_CUDA_INCLUDES} ) - set_target_properties ( CHOLMOD_CUDA_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) - set_target_properties ( CHOLMOD_CUDA_static PROPERTIES POSITION_INDEPENDENT_CODE on ) - target_compile_definitions ( CHOLMOD_CUDA_static PUBLIC "SUITESPARSE_CUDA" ) -endif ( ) - -if ( BUILD_SHARED_LIBS ) - target_link_libraries ( CHOLMOD_CUDA PRIVATE CUDA::nvrtc CUDA::cudart_static - CUDA::nvtx3 CUDA::cublas ) + set_target_properties ( CHOLMOD_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) + set_target_properties ( CHOLMOD_static PROPERTIES POSITION_INDEPENDENT_CODE on ) + target_compile_definitions ( CHOLMOD_static PUBLIC "SUITESPARSE_CUDA" ) endif ( ) -if ( BUILD_STATIC_LIBS ) - target_link_libraries ( CHOLMOD_CUDA_static PUBLIC CUDA::nvrtc CUDA::cudart_static - CUDA::nvtx3 CUDA::cublas ) -endif ( ) - -#------------------------------------------------------------------------------- -# installation location -#------------------------------------------------------------------------------- - -include ( CMakePackageConfigHelpers ) if ( BUILD_SHARED_LIBS ) - install ( TARGETS CHOLMOD_CUDA - EXPORT CHOLMOD_CUDATargets - LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} - ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} - RUNTIME DESTINATION ${SUITESPARSE_BINDIR} - PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) + target_link_libraries ( CHOLMOD PRIVATE + CUDA::nvrtc CUDA::cudart_static CUDA::nvtx3 CUDA::cublas ) endif ( ) if ( BUILD_STATIC_LIBS ) - install ( TARGETS CHOLMOD_CUDA_static - EXPORT CHOLMOD_CUDATargets - ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} - PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -endif ( ) - -# create (temporary) export target file during build -export ( EXPORT CHOLMOD_CUDATargets - NAMESPACE SuiteSparse:: - FILE ${CMAKE_CURRENT_BINARY_DIR}/../CHOLMOD_CUDATargets.cmake ) - -# install export target, config and version files for find_package -install ( EXPORT CHOLMOD_CUDATargets - NAMESPACE SuiteSparse:: - DESTINATION ${SUITESPARSE_PKGFILEDIR}/cmake/CHOLMOD_CUDA ) - -configure_package_config_file ( - ../Config/CHOLMOD_CUDAConfig.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/../CHOLMOD_CUDAConfig.cmake - INSTALL_DESTINATION ${SUITESPARSE_PKGFILEDIR}/cmake/CHOLMOD_CUDA ) - -write_basic_package_version_file ( - ${CMAKE_CURRENT_BINARY_DIR}/../CHOLMOD_CUDAConfigVersion.cmake - COMPATIBILITY SameMajorVersion ) - -install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/../CHOLMOD_CUDAConfig.cmake - ${CMAKE_CURRENT_BINARY_DIR}/../CHOLMOD_CUDAConfigVersion.cmake - DESTINATION ${SUITESPARSE_PKGFILEDIR}/cmake/CHOLMOD_CUDA ) - -#------------------------------------------------------------------------------- -# create pkg-config file -#------------------------------------------------------------------------------- - -if ( NOT MSVC ) - set ( prefix "${CMAKE_INSTALL_PREFIX}" ) - set ( exec_prefix "\${prefix}" ) - cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) - if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) - set ( libdir "${SUITESPARSE_LIBDIR}") - else ( ) - set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") - endif ( ) - cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) - if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) - set ( includedir "${SUITESPARSE_INCLUDEDIR}") - else ( ) - set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") - endif ( ) - configure_file ( - ../Config/CHOLMOD_CUDA.pc.in - CHOLMOD_CUDA.pc - @ONLY - NEWLINE_STYLE LF ) - install ( FILES - ${CMAKE_CURRENT_BINARY_DIR}/CHOLMOD_CUDA.pc - DESTINATION ${SUITESPARSE_PKGFILEDIR}/pkgconfig ) + target_link_libraries ( CHOLMOD_static PUBLIC + CUDA::nvrtc CUDA::cudart_static CUDA::nvtx3 CUDA::cublas ) endif ( ) diff --git a/KLU/CMakeLists.txt b/KLU/CMakeLists.txt index be275be72..53e388808 100644 --- a/KLU/CMakeLists.txt +++ b/KLU/CMakeLists.txt @@ -89,9 +89,6 @@ if ( NOT SUITESPARSE_ROOT_CMAKELISTS AND NOT NCHOLMOD ) # CHOLMOD not found so disable it set ( NCHOLMOD true ) endif ( ) - if ( SUITESPARSE_CUDA AND NOT CHOLMOD_CUDA_FOUND ) - set ( NCHOLMOD true ) - endif ( ) endif ( ) if ( NCHOLMOD ) diff --git a/SPQR/CMakeLists.txt b/SPQR/CMakeLists.txt index 404888df3..67b8e0b47 100644 --- a/SPQR/CMakeLists.txt +++ b/SPQR/CMakeLists.txt @@ -68,14 +68,6 @@ if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) endif ( ) endif ( ) -if ( NOT SUITESPARSE_ROOT_CMAKELISTS AND SUITESPARSE_CUDA ) - find_package ( CHOLMOD_CUDA 5.1.0 - PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) - if ( NOT TARGET SuiteSparse::CHOLMOD_CUDA ) - find_package ( CHOLMOD_CUDA 5.1.0 REQUIRED ) - endif ( ) -endif ( ) - include ( SuiteSparseBLAS ) # requires cmake 3.22 include ( SuiteSparseLAPACK ) # requires cmake 3.22 @@ -230,16 +222,11 @@ if ( SUITESPARSE_CUDA ) # CUDA if ( BUILD_SHARED_LIBS ) target_link_libraries ( SPQR PRIVATE - SuiteSparse::CHOLMOD_CUDA SPQR_CUDA GPUQREngine GPURuntime ) + SPQR_CUDA GPUQREngine GPURuntime ) target_compile_definitions ( SPQR PUBLIC "SUITESPARSE_CUDA" ) endif ( ) set ( SPQR_CFLAGS "-DSUITESPARSE_CUDA" ) if ( BUILD_STATIC_LIBS ) - if ( TARGET SuiteSparse::CHOLMOD_CUDA_static ) - target_link_libraries ( SPQR_static PUBLIC SuiteSparse::CHOLMOD_CUDA_static ) - else ( ) - target_link_libraries ( SPQR_static PUBLIC SuiteSparse::CHOLMOD_CUDA ) - endif ( ) target_link_libraries ( SPQR_static PUBLIC SPQR_CUDA_static GPUQREngine_static GPURuntime_static ) target_compile_definitions ( SPQR_static PUBLIC "SUITESPARSE_CUDA" ) @@ -431,11 +418,11 @@ if ( DEMO ) target_link_libraries ( qrdemo_gpu3 PUBLIC SPQR_static SPQR_CUDA_static ) endif ( ) target_link_libraries ( qrdemo_gpu - PUBLIC SuiteSparse::CHOLMOD SuiteSparse::CHOLMOD_CUDA SuiteSparse::SuiteSparseConfig ) + PUBLIC SuiteSparse::CHOLMOD SuiteSparse::SuiteSparseConfig ) target_link_libraries ( qrdemo_gpu2 - PUBLIC SuiteSparse::CHOLMOD SuiteSparse::CHOLMOD_CUDA SuiteSparse::SuiteSparseConfig ) + PUBLIC SuiteSparse::CHOLMOD SuiteSparse::SuiteSparseConfig ) target_link_libraries ( qrdemo_gpu3 - PUBLIC SuiteSparse::CHOLMOD SuiteSparse::CHOLMOD_CUDA SuiteSparse::SuiteSparseConfig ) + PUBLIC SuiteSparse::CHOLMOD SuiteSparse::SuiteSparseConfig ) endif ( ) else ( ) diff --git a/SPQR/GPUQREngine/CMakeLists.txt b/SPQR/GPUQREngine/CMakeLists.txt index 5592914f8..cdceb5c59 100644 --- a/SPQR/GPUQREngine/CMakeLists.txt +++ b/SPQR/GPUQREngine/CMakeLists.txt @@ -247,7 +247,7 @@ if ( DEMO AND DEMO_OK ) PUBLIC GPUQREngine_static GPURuntime_static ) endif ( ) target_link_libraries ( gpuqrengine_demo - PUBLIC SuiteSparse::CHOLMOD SuiteSparse::CHOLMOD_CUDA SuiteSparse::SuiteSparseConfig ) + PUBLIC SuiteSparse::CHOLMOD SuiteSparse::SuiteSparseConfig ) else ( ) diff --git a/UMFPACK/CMakeLists.txt b/UMFPACK/CMakeLists.txt index adb678903..cdd80ecfe 100644 --- a/UMFPACK/CMakeLists.txt +++ b/UMFPACK/CMakeLists.txt @@ -110,9 +110,6 @@ if ( NOT SUITESPARSE_ROOT_CMAKELISTS AND NOT NCHOLMOD ) # CHOLMOD not found so disable it set ( NCHOLMOD true ) endif ( ) - if ( SUITESPARSE_CUDA AND NOT CHOLMOD_CUDA_FOUND ) - set ( NCHOLMOD true ) - endif ( ) endif ( ) if ( NCHOLMOD ) From 8de49f47325826300c02ceec13e6ce9c78ca34d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 29 Nov 2023 16:15:16 +0100 Subject: [PATCH 05/21] LAGraph: Also look for GraphBLAS import target in common build tree That is needed when using the root CMakeLists.txt. --- LAGraph/cmake_modules/FindGraphBLAS.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LAGraph/cmake_modules/FindGraphBLAS.cmake b/LAGraph/cmake_modules/FindGraphBLAS.cmake index e7c7f1a38..6b7b42784 100644 --- a/LAGraph/cmake_modules/FindGraphBLAS.cmake +++ b/LAGraph/cmake_modules/FindGraphBLAS.cmake @@ -65,7 +65,7 @@ in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: ## New versions of SuiteSparse GraphBLAS (8.0.3 and newer) ## find_package ( GraphBLAS ${GraphBLAS_FIND_VERSION} CONFIG - PATHS ${PROJECT_SOURCE_DIR}/../GraphBLAS/build NO_DEFAULT_PATH ) + PATHS ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/../GraphBLAS/build NO_DEFAULT_PATH ) if ( NOT TARGET SuiteSparse::GraphBLAS ) find_package ( GraphBLAS ${GraphBLAS_FIND_VERSION} CONFIG ) endif ( ) From eb2809103b76ef907807a7c63c57038d26e5fb3a Mon Sep 17 00:00:00 2001 From: Tim Davis Date: Wed, 29 Nov 2023 11:15:37 -0600 Subject: [PATCH 06/21] ParU: failed to compile if CUDA enabled in CHOLMOD; need to set ENABLE_CUDA in ParU/CMakeLists as well --- ParU/CMakeLists.txt | 7 +++++++ SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ParU/CMakeLists.txt b/ParU/CMakeLists.txt index 6fc512ffb..653a47448 100644 --- a/ParU/CMakeLists.txt +++ b/ParU/CMakeLists.txt @@ -38,8 +38,15 @@ set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) +option ( ENABLE_CUDA "Enable CUDA acceleration" on ) + include ( SuiteSparsePolicy ) +if ( SUITESPARSE_CUDA ) + # ParU with CHOLMOD (which can use CUDA) + enable_language ( CUDA ) +endif ( ) + #------------------------------------------------------------------------------- # find library dependencies #------------------------------------------------------------------------------- diff --git a/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake b/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake index f80b1a32a..30da8ce15 100644 --- a/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake +++ b/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake @@ -15,9 +15,9 @@ # set ( CMAKE_BUILD_TYPE Debug ) # # ENABLE_CUDA: if set to true, CUDA is enabled for the project. -# Default: true for CHOLMOD and SPQR, false for GraphBLAS -# (for which CUDA is in progress and not ready for -# production use). +# Default: true for CHOLMOD, SPQR, and ParU (which uses +# CHOLMOD); false for GraphBLAS (for which CUDA is in +# progress and not ready for production use). # # LOCAL_INSTALL: if true, "cmake --install" will install # into SuiteSparse/lib and SuiteSparse/include. From 3ccc632b4af496c2bddb423453bf596c85f02cca Mon Sep 17 00:00:00 2001 From: Tim Davis Date: Wed, 29 Nov 2023 11:37:06 -0600 Subject: [PATCH 07/21] more comments about ENABLE_CUDA in SuiteSparsePolicy.cmake --- .../cmake_modules/SuiteSparsePolicy.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake b/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake index 30da8ce15..fe7f1697d 100644 --- a/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake +++ b/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake @@ -15,9 +15,13 @@ # set ( CMAKE_BUILD_TYPE Debug ) # # ENABLE_CUDA: if set to true, CUDA is enabled for the project. -# Default: true for CHOLMOD, SPQR, and ParU (which uses -# CHOLMOD); false for GraphBLAS (for which CUDA is in -# progress and not ready for production use). +# Default: true for CHOLMOD and SPQR, which use the GPU +# for their numerical factorizsation. It is also enabled +# for UMFPACK, KLU, and ParU (which use CHOLMOD and this +# require this flag if CHOLMOD has been compiled with +# ENABLE_CUDA). The flag is false for false for +# GraphBLAS since CUDA for that package is in progress +# and not ready for production use. # # LOCAL_INSTALL: if true, "cmake --install" will install # into SuiteSparse/lib and SuiteSparse/include. From da9f318227fabb989b396f6c3f8bc7ba062fc07d Mon Sep 17 00:00:00 2001 From: Tim Davis Date: Wed, 29 Nov 2023 11:40:50 -0600 Subject: [PATCH 08/21] CHOLMOD: vertcat, fix test for A and B dtype --- CHOLMOD/MatrixOps/cholmod_vertcat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHOLMOD/MatrixOps/cholmod_vertcat.c b/CHOLMOD/MatrixOps/cholmod_vertcat.c index a99aaa522..a321a74e3 100644 --- a/CHOLMOD/MatrixOps/cholmod_vertcat.c +++ b/CHOLMOD/MatrixOps/cholmod_vertcat.c @@ -89,7 +89,7 @@ cholmod_sparse *CHOLMOD(vertcat) ERROR (CHOLMOD_INVALID, "A and B must have same # of columns") ; return (NULL) ; } - if (mode != 0 && (A->xtype != B->xtype || A->dtype != A->dtype)) + if (mode != 0 && (A->xtype != B->xtype || A->dtype != B->dtype)) { // A and B must have the same xtype and dtype if mode is 0 ERROR (CHOLMOD_INVALID, "A and B must have same xtype and dtype") ; From 69bd6096a3b324c9c6592cc6457d9e538fbfacdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 29 Nov 2023 18:51:07 +0100 Subject: [PATCH 09/21] CHOLMOD: Automatically import CUDA targets if needed. --- CHOLMOD/Config/CHOLMODConfig.cmake.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHOLMOD/Config/CHOLMODConfig.cmake.in b/CHOLMOD/Config/CHOLMODConfig.cmake.in index 9e9db04c7..d37f3ede3 100644 --- a/CHOLMOD/Config/CHOLMODConfig.cmake.in +++ b/CHOLMOD/Config/CHOLMODConfig.cmake.in @@ -38,6 +38,19 @@ set ( CHOLMOD_VERSION "@CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_ include ( CMakeFindDependencyMacro ) set ( _dependencies_found ON ) +# Look for NVIDIA CUDA toolkit +if ( @SUITESPARSE_CUDA@ AND NOT CUDAToolkit_FOUND ) + find_dependency ( CUDAToolkit @CUDAToolkit_VERSION_MAJOR@ ) + if ( NOT CUDAToolkit_FOUND ) + set ( _dependencies_found OFF ) + endif ( ) +endif ( ) + +if ( NOT _dependencies_found ) + set ( CHOLMOD_FOUND OFF ) + return ( ) +endif ( ) + # Look for SuiteSparse_config, COLAMD, and AMD targets if ( @SUITESPARSE_IN_BUILD_TREE@ ) if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) From 654f0b08cd916e183b4ef0c742f5e5f5195ddcbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 29 Nov 2023 18:55:50 +0100 Subject: [PATCH 10/21] Revert "ParU: failed to compile if CUDA enabled in CHOLMOD; need to set ENABLE_CUDA in ParU/CMakeLists as well" This reverts commit eb2809103b76ef907807a7c63c57038d26e5fb3a. --- ParU/CMakeLists.txt | 7 ------- SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake | 9 +++------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/ParU/CMakeLists.txt b/ParU/CMakeLists.txt index 653a47448..6fc512ffb 100644 --- a/ParU/CMakeLists.txt +++ b/ParU/CMakeLists.txt @@ -38,15 +38,8 @@ set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) -option ( ENABLE_CUDA "Enable CUDA acceleration" on ) - include ( SuiteSparsePolicy ) -if ( SUITESPARSE_CUDA ) - # ParU with CHOLMOD (which can use CUDA) - enable_language ( CUDA ) -endif ( ) - #------------------------------------------------------------------------------- # find library dependencies #------------------------------------------------------------------------------- diff --git a/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake b/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake index fe7f1697d..a9d2c4c8d 100644 --- a/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake +++ b/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake @@ -16,12 +16,9 @@ # # ENABLE_CUDA: if set to true, CUDA is enabled for the project. # Default: true for CHOLMOD and SPQR, which use the GPU -# for their numerical factorizsation. It is also enabled -# for UMFPACK, KLU, and ParU (which use CHOLMOD and this -# require this flag if CHOLMOD has been compiled with -# ENABLE_CUDA). The flag is false for false for -# GraphBLAS since CUDA for that package is in progress -# and not ready for production use. +# for their numerical factorizsation. The flag is false +# for GraphBLAS since CUDA for that package is in +# progress and not ready for production use. # # LOCAL_INSTALL: if true, "cmake --install" will install # into SuiteSparse/lib and SuiteSparse/include. From 7bcb80a0a07315fafa2e526d0e0f16aac82789b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 29 Nov 2023 20:45:55 +0100 Subject: [PATCH 11/21] LAGraph: Remove hardcoded include directory --- LAGraph/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/LAGraph/CMakeLists.txt b/LAGraph/CMakeLists.txt index 57a99c80d..87b5ed009 100644 --- a/LAGraph/CMakeLists.txt +++ b/LAGraph/CMakeLists.txt @@ -195,7 +195,6 @@ message ( STATUS "CMAKE have OpenMP: " ${OPENMP_C_FOUND} ) include_directories ( ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src/utility ${PROJECT_SOURCE_DIR}/test/include ) -include_directories ( "/usr/local/include" ) # tell LAGraph where to find its own source (for LAGraph/data files) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLGDIR=${PROJECT_SOURCE_DIR}" ) From 5e4e5df0725ea033d1e6a498c11dcf19fe5e4850 Mon Sep 17 00:00:00 2001 From: Tim Davis Date: Wed, 29 Nov 2023 13:57:11 -0600 Subject: [PATCH 12/21] allow LAGraph to be used stand-alone, outside of SuiteSparse --- LAGraph/CMakeLists.txt | 6 +- LAGraph/cmake_modules/SuiteSparsePolicy.cmake | 292 ++++++++++++++++++ 2 files changed, 297 insertions(+), 1 deletion(-) create mode 100644 LAGraph/cmake_modules/SuiteSparsePolicy.cmake diff --git a/LAGraph/CMakeLists.txt b/LAGraph/CMakeLists.txt index 87b5ed009..c61632e30 100644 --- a/LAGraph/CMakeLists.txt +++ b/LAGraph/CMakeLists.txt @@ -146,7 +146,7 @@ else ( ) message ( STATUS "GraphBLAS_ROOT: ${GraphBLAS_ROOT} $ENV{GraphBLAS_ROOT}" ) message ( STATUS "GRAPHBLAS_ROOT: ${GRAPHBLAS_ROOT} $ENV{GRAPHBLAS_ROOT}" ) - find_package ( GraphBLAS 8.3.0 MODULE REQUIRED ) + find_package ( GraphBLAS 7.1.0 MODULE REQUIRED ) endif ( ) @@ -196,6 +196,10 @@ include_directories ( ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src/utility ${PROJECT_SOURCE_DIR}/test/include ) +if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) + include_directories ( ${GRAPHBLAS_INCLUDE_DIR} ) +endif ( ) + # tell LAGraph where to find its own source (for LAGraph/data files) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLGDIR=${PROJECT_SOURCE_DIR}" ) # set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O" ) diff --git a/LAGraph/cmake_modules/SuiteSparsePolicy.cmake b/LAGraph/cmake_modules/SuiteSparsePolicy.cmake new file mode 100644 index 000000000..a9d2c4c8d --- /dev/null +++ b/LAGraph/cmake_modules/SuiteSparsePolicy.cmake @@ -0,0 +1,292 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake +#------------------------------------------------------------------------------- + +# Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# SuiteSparse CMake policies. The following parameters can be defined prior +# to including this file: +# +# CMAKE_BUILD_TYPE: if not set, it is set below to "Release". +# To use the "Debug" policy, precede this with +# set ( CMAKE_BUILD_TYPE Debug ) +# +# ENABLE_CUDA: if set to true, CUDA is enabled for the project. +# Default: true for CHOLMOD and SPQR, which use the GPU +# for their numerical factorizsation. The flag is false +# for GraphBLAS since CUDA for that package is in +# progress and not ready for production use. +# +# LOCAL_INSTALL: if true, "cmake --install" will install +# into SuiteSparse/lib and SuiteSparse/include. +# if false, "cmake --install" will install into the +# default prefix (or the one configured with +# CMAKE_INSTALL_PREFIX). Requires cmake 3.19. +# This is ignored when using the root CMakeLists.txt. +# Set CMAKE_INSTALL_PREFIX instead. +# Default: false +# +# BUILD_SHARED_LIBS: if true, shared libraries are built. +# Default: true. +# +# BUILD_STATIC_LIBS: if true, static libraries are built. +# Default: true, except for GraphBLAS, which +# takes a long time to compile so the default for +# GraphBLAS is false. +# +# SUITESPARSE_CUDA_ARCHITECTURES: a string, such as "all" or +# "35;50;75;80" that lists the CUDA architectures to use +# when compiling CUDA kernels with nvcc. The "all" +# option requires cmake 3.23 or later. +# Default: "52;75;80". +# +# BLA_VENDOR and BLA_SIZEOF_INTEGER: By default, SuiteSparse searches for +# the BLAS library in a specific order. If you wish to +# use a specific BLAS library, set both of these with +# (for example): +# -DBLA_VENDOR=Intel10_64lp -DBLA_SIZEOF_INTEGER=4 +# Both settings must appear, or neither. +# Default: neither are defined. +# +# BLA_STATIC: if true, use static linkage for BLAS and LAPACK. +# Default: false +# +# ALLOW_64BIT_BLAS if true, SuiteSparse will search for both 32-bit and +# 64-bit BLAS. If false, only 32-bit BLAS will be +# searched for. Ignored if BLA_VENDOR and +# BLA_SIZEOF_INTEGER are defined. +# +# SUITESPARSE_C_TO_FORTRAN: a string that defines how C calls Fortran. +# Defaults to "(name,NAME) name" for Windows (lower case, +# no underscore appended to the name), which is the +# system that is most likely not to have a Fortran +# compiler. Defaults to "(name,NAME) name##_" otherwise. +# This setting is only used if no Fortran compiler is +# found. +# +# NFORTRAN: if true, no Fortan files are compiled, and the Fortran +# language is not enabled in any cmake scripts. The +# built-in cmake script FortranCInterface is skipped. +# This will require SUITESPARSE_C_TO_FORTRAN to be defined +# explicitly, if the defaults are not appropriate for your +# system. +# Default: false + +message ( STATUS "Source: ${CMAKE_SOURCE_DIR} ") +message ( STATUS "Build: ${CMAKE_BINARY_DIR} ") + +cmake_policy ( SET CMP0042 NEW ) # enable MACOSX_RPATH by default +cmake_policy ( SET CMP0048 NEW ) # VERSION variable policy +cmake_policy ( SET CMP0054 NEW ) # if ( expression ) handling policy +if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.18.0" ) + cmake_policy ( SET CMP0104 NEW ) # initialize CUDA architectures +endif ( ) + +if ( WIN32 ) + set ( CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS true ) + add_compile_definitions ( _CRT_SECURE_NO_WARNINGS ) +endif ( ) + +set ( CMAKE_MACOSX_RPATH TRUE ) +enable_language ( C ) +include ( GNUInstallDirs ) + +# add the cmake_modules folder for this package to the module path +set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} + ${CMAKE_SOURCE_DIR}/cmake_modules ) + +# BUILD_SHARED_LIBS and BUILD_STATIC_LIBS options +option ( BUILD_SHARED_LIBS "OFF: do not build shared libraries. ON (default): build shared libraries" ON ) + +if ( BUILD_STATIC_LIBS_DEFAULT_OFF ) + option ( BUILD_STATIC_LIBS "OFF (default): do not build static libraries. ON: build static libraries" OFF ) +else ( ) + # For backwards compatibility, use NSTATIC if it is set. + if ( NSTATIC ) + option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" OFF ) + else ( ) + option ( BUILD_STATIC_LIBS "OFF: do not build static libraries. ON (default): build static libraries" ON ) + endif ( ) +endif ( ) + +if ( NOT BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS ) + message ( FATAL_ERROR "At least one of BUILD_SHARED_LIBS or BUILD_STATIC_LIBS must be set to ON." ) +endif ( ) + +# installation options +if ( NOT SUITESPARSE_ROOT_CMAKELISTS AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19.0" ) + # the LOCAL_INSTALL option requires cmake 3.19.0 or later + option ( LOCAL_INSTALL "Install in SuiteSparse/lib" OFF ) +else ( ) + set ( LOCAL_INSTALL OFF ) +endif ( ) + +if ( SUITESPARSE_SECOND_LEVEL ) + # some packages in SuiteSparse are in SuiteSparse/Package/Package + set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} + ${CMAKE_SOURCE_DIR}/../../lib/cmake ) +else ( ) + # most packages in SuiteSparse are located in SuiteSparse/Package + set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} + ${CMAKE_SOURCE_DIR}/../lib/cmake ) +endif ( ) + +# add the ./build folder to the runpath so other SuiteSparse packages can +# find this one without "make install" +set ( CMAKE_BUILD_RPATH ${CMAKE_BUILD_RPATH} ${CMAKE_BINARY_DIR} ) + +if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) + # determine if this Package is inside the SuiteSparse folder + set ( INSIDE_SUITESPARSE false ) + if ( LOCAL_INSTALL ) + # if you do not want to install local copies of SuiteSparse + # packages in SuiteSparse/lib and SuiteSparse/, set + # LOCAL_INSTALL to false in your CMake options. + if ( SUITESPARSE_SECOND_LEVEL ) + # the package is normally located at the 2nd level inside SuiteSparse + # (SuiteSparse/GraphBLAS/GraphBLAS/ for example) + if ( EXISTS ${CMAKE_SOURCE_DIR}/../../SuiteSparse_config ) + set ( INSIDE_SUITESPARSE true ) + endif ( ) + else ( ) + # typical case, the package is at the 1st level inside SuiteSparse + # (SuiteSparse/AMD for example) + if ( EXISTS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config ) + set ( INSIDE_SUITESPARSE true ) + endif ( ) + endif ( ) + + if ( NOT INSIDE_SUITESPARSE ) + message ( FATAL_ERROR "Unsupported layout for local installation. Correct the directory layout or unset LOCAL_INSTALL." ) + endif ( ) + + endif ( ) +endif ( ) + +if ( LOCAL_INSTALL ) + if ( INSIDE_SUITESPARSE ) + # ../lib and ../include exist: the package is inside SuiteSparse. + # find ( REAL_PATH ...) requires cmake 3.19. + if ( SUITESPARSE_SECOND_LEVEL ) + file ( REAL_PATH ${CMAKE_SOURCE_DIR}/../.. + SUITESPARSE_LOCAL_PREFIX ) + else ( ) + file ( REAL_PATH ${CMAKE_SOURCE_DIR}/.. + SUITESPARSE_LOCAL_PREFIX ) + endif ( ) + endif ( ) + set ( SUITESPARSE_LIBDIR ${SUITESPARSE_LOCAL_PREFIX}/lib ) + set ( SUITESPARSE_INCLUDEDIR ${SUITESPARSE_LOCAL_PREFIX}/include ) + set ( SUITESPARSE_BINDIR ${SUITESPARSE_LOCAL_PREFIX}/bin ) +else ( ) + set ( SUITESPARSE_LIBDIR ${CMAKE_INSTALL_LIBDIR} ) + set ( SUITESPARSE_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR} ) + set ( SUITESPARSE_BINDIR ${CMAKE_INSTALL_BINDIR} ) +endif ( ) + +if ( INSIDE_SUITESPARSE ) + # append ../lib to the install and build runpaths + set ( CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH} ${SUITESPARSE_LIBDIR} ) + set ( CMAKE_BUILD_RPATH ${CMAKE_BUILD_RPATH} ${SUITESPARSE_LIBDIR} ) +endif ( ) + +set ( SUITESPARSE_PKGFILEDIR ${SUITESPARSE_LIBDIR} CACHE STRING + "Directory where CMake Config and pkg-config files will be installed" ) + +message ( STATUS "Install lib: ${SUITESPARSE_LIBDIR}" ) +message ( STATUS "Install include: ${SUITESPARSE_INCLUDEDIR}" ) +message ( STATUS "Install bin: ${SUITESPARSE_BINDIR}" ) +message ( STATUS "Install pkg-file: ${SUITESPARSE_PKGFILEDIR}" ) +message ( STATUS "Install rpath: ${CMAKE_INSTALL_RPATH}" ) +message ( STATUS "Build rpath: ${CMAKE_BUILD_RPATH}" ) + +if ( NOT CMAKE_BUILD_TYPE ) + set ( CMAKE_BUILD_TYPE Release ) +endif ( ) + +message ( STATUS "Build type: ${CMAKE_BUILD_TYPE} ") + +set ( CMAKE_INCLUDE_CURRENT_DIR ON ) + +#------------------------------------------------------------------------------- +# check if Fortran is available and enabled +#------------------------------------------------------------------------------- + +include ( CheckLanguage ) +option ( NFORTRAN "ON: do not try to use Fortran. OFF (default): try Fortran" off ) +if ( NFORTRAN ) + message ( STATUS "Fortran: not enabled" ) +else ( ) + check_language ( Fortran ) + if ( CMAKE_Fortran_COMPILER ) + enable_language ( Fortran ) + message ( STATUS "Fortran: ${CMAKE_Fortran_COMPILER}" ) + else ( ) + # Fortran not available: + set ( NFORTRAN true ) + message ( STATUS "Fortran: not available" ) + endif ( ) +endif ( ) + +# default C-to-Fortran name mangling if Fortran compiler not found +if ( MSVC ) + # MS Visual Studio Fortran compiler does not mangle the Fortran name + set ( SUITESPARSE_C_TO_FORTRAN "(name,NAME) name" + CACHE STRING "C to Fortan name mangling" ) +else ( ) + # Other systems (Linux, Mac) typically append an underscore + set ( SUITESPARSE_C_TO_FORTRAN "(name,NAME) name##_" + CACHE STRING "C to Fortan name mangling" ) +endif ( ) + +#------------------------------------------------------------------------------- +# find CUDA +#------------------------------------------------------------------------------- + +if ( ENABLE_CUDA ) + + # try finding CUDA + check_language ( CUDA ) + message ( STATUS "Looking for CUDA" ) + if ( CMAKE_CUDA_COMPILER ) + # with CUDA: + message ( STATUS "Find CUDA tool kit:" ) + # FindCUDAToolKit needs to have C or CXX enabled first (see above) + include ( FindCUDAToolkit ) + message ( STATUS "CUDA toolkit found: " ${CUDAToolkit_FOUND} ) + message ( STATUS "CUDA toolkit version: " ${CUDAToolkit_VERSION} ) + message ( STATUS "CUDA toolkit include: " ${CUDAToolkit_INCLUDE_DIRS} ) + message ( STATUS "CUDA toolkit lib dir: " ${CUDAToolkit_LIBRARY_DIR} ) + if ( CUDAToolkit_VERSION VERSION_LESS "11.2" ) + # CUDA is present but too old + message ( STATUS "CUDA: not enabled (CUDA 11.2 or later required)" ) + set ( SUITESPARSE_CUDA off ) + else ( ) + # CUDA 11.2 or later present + enable_language ( CUDA ) + set ( SUITESPARSE_CUDA on ) + endif ( ) + else ( ) + # without CUDA: + message ( STATUS "CUDA: not found" ) + set ( SUITESPARSE_CUDA off ) + endif ( ) + +else ( ) + + # CUDA is disabled + set ( SUITESPARSE_CUDA off ) + +endif ( ) + +if ( SUITESPARSE_CUDA ) + message ( STATUS "CUDA: enabled" ) + set ( SUITESPARSE_CUDA_ARCHITECTURES "52;75;80" CACHE STRING "CUDA architectures" ) + set ( CMAKE_CUDA_ARCHITECTURES ${SUITESPARSE_CUDA_ARCHITECTURES} ) +else ( ) + message ( STATUS "CUDA: not enabled" ) +endif ( ) + From d189df3aeeb9047ad9b276937876060c17de49ff Mon Sep 17 00:00:00 2001 From: Tim Davis Date: Wed, 29 Nov 2023 17:50:31 -0600 Subject: [PATCH 13/21] LAGraph: change project name (for test_coverage) and change range of GraphBLAS version --- LAGraph/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LAGraph/CMakeLists.txt b/LAGraph/CMakeLists.txt index c61632e30..c02ed1e7c 100644 --- a/LAGraph/CMakeLists.txt +++ b/LAGraph/CMakeLists.txt @@ -52,7 +52,7 @@ set ( LAGraph_VERSION_SUB 0 CACHE STRING "" FORCE ) # define the project #------------------------------------------------------------------------------- -project ( lagraph +project ( LAGraph VERSION "${LAGraph_VERSION_MAJOR}.${LAGraph_VERSION_MINOR}.${LAGraph_VERSION_SUB}" ) #------------------------------------------------------------------------------- @@ -146,7 +146,7 @@ else ( ) message ( STATUS "GraphBLAS_ROOT: ${GraphBLAS_ROOT} $ENV{GraphBLAS_ROOT}" ) message ( STATUS "GRAPHBLAS_ROOT: ${GRAPHBLAS_ROOT} $ENV{GRAPHBLAS_ROOT}" ) - find_package ( GraphBLAS 7.1.0 MODULE REQUIRED ) + find_package ( GraphBLAS 7.1.0...9.0.1 MODULE REQUIRED ) endif ( ) From b47079cd2dd3d6c8b7a95e9fa0d87e45853dce7b Mon Sep 17 00:00:00 2001 From: Tim Davis Date: Wed, 29 Nov 2023 20:37:40 -0600 Subject: [PATCH 14/21] LAGraph: handle version range --- LAGraph/CMakeLists.txt | 2 +- LAGraph/cmake_modules/FindGraphBLAS.cmake | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/LAGraph/CMakeLists.txt b/LAGraph/CMakeLists.txt index c02ed1e7c..9ad13cbaa 100644 --- a/LAGraph/CMakeLists.txt +++ b/LAGraph/CMakeLists.txt @@ -36,7 +36,7 @@ # get the version #------------------------------------------------------------------------------- -cmake_minimum_required ( VERSION 3.13 ) +cmake_minimum_required ( VERSION 3.20 ) cmake_policy ( SET CMP0042 NEW ) cmake_policy ( SET CMP0048 NEW ) diff --git a/LAGraph/cmake_modules/FindGraphBLAS.cmake b/LAGraph/cmake_modules/FindGraphBLAS.cmake index 6b7b42784..f1c58cf20 100644 --- a/LAGraph/cmake_modules/FindGraphBLAS.cmake +++ b/LAGraph/cmake_modules/FindGraphBLAS.cmake @@ -176,6 +176,7 @@ find_package_handle_standard_args( GraphBLAS REQUIRED_VARS GRAPHBLAS_LIBRARIES GRAPHBLAS_INCLUDE_DIR VERSION_VAR GRAPHBLAS_VERSION + HANDLE_VERSION_RANGE ) mark_as_advanced( From 60141bb25a43805464063db89b642bce88d525d0 Mon Sep 17 00:00:00 2001 From: Tim Davis Date: Wed, 29 Nov 2023 21:54:44 -0600 Subject: [PATCH 15/21] LAGraph: remove ranges from find_package; check in LAGraph.h instead --- LAGraph/CMakeLists.txt | 11 ++++++++--- LAGraph/Makefile | 4 ++++ LAGraph/config/LAGraph.h.in | 3 +++ LAGraph/include/LAGraph.h | 3 +++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/LAGraph/CMakeLists.txt b/LAGraph/CMakeLists.txt index 9ad13cbaa..7bc4fc0c6 100644 --- a/LAGraph/CMakeLists.txt +++ b/LAGraph/CMakeLists.txt @@ -143,10 +143,15 @@ else ( ) # or uncomment the next line: # set ( ENV{GRAPHBLAS_ROOT} ${PROJECT_SOURCE_DIR}/../GraphBLAS ) - message ( STATUS "GraphBLAS_ROOT: ${GraphBLAS_ROOT} $ENV{GraphBLAS_ROOT}" ) - message ( STATUS "GRAPHBLAS_ROOT: ${GRAPHBLAS_ROOT} $ENV{GRAPHBLAS_ROOT}" ) + # The ../GraphBLAS folder is considered by default, if it exists. - find_package ( GraphBLAS 7.1.0...9.0.1 MODULE REQUIRED ) +# message ( STATUS "GraphBLAS_ROOT: ${GraphBLAS_ROOT} $ENV{GraphBLAS_ROOT}" ) +# message ( STATUS "GRAPHBLAS_ROOT: ${GRAPHBLAS_ROOT} $ENV{GRAPHBLAS_ROOT}" ) + + # No package version is explicitly stated here; an arbitrary GraphBLAS + # library can have any version number. For SuiteSparse:GraphBLAS, LAGraph + # requires v7.1.0 or later, which is checked in LAGraph.h. + find_package ( GraphBLAS MODULE REQUIRED ) endif ( ) diff --git a/LAGraph/Makefile b/LAGraph/Makefile index 2c885fa6a..06cb5aa68 100644 --- a/LAGraph/Makefile +++ b/LAGraph/Makefile @@ -53,6 +53,10 @@ default: library library: ( cd build && cmake $(CMAKE_OPTIONS) .. && cmake --build . --config Release -j${JOBS} ) +# install only in SuiteSparse/lib and SuiteSparse/include +local: + ( cd build && cmake $(CMAKE_OPTIONS) -DLOCAL_INSTALL=1 .. && cmake --build . --config Release -j${JOBS} ) + vanilla: ( cd build && cmake $(CMAKE_OPTIONS) -DLAGRAPH_VANILLA=1 .. && cmake --build . --config Release -j${JOBS} ) diff --git a/LAGraph/config/LAGraph.h.in b/LAGraph/config/LAGraph.h.in index 87d5965da..b506c7e14 100644 --- a/LAGraph/config/LAGraph.h.in +++ b/LAGraph/config/LAGraph.h.in @@ -98,6 +98,9 @@ #if ( !LAGRAPH_VANILLA ) && defined ( GxB_SUITESPARSE_GRAPHBLAS ) // use SuiteSparse, and its GxB* extensions + #if GxB_IMPLEMENTATION < GxB_VERSION (7,1,0) + #error "If using SuiteSparse::GraphBLAS, version 7.1.0 or later s required" + #endif #define LAGRAPH_SUITESPARSE 1 #else // use any GraphBLAS library (possibly SuiteSparse) but with no GxB* diff --git a/LAGraph/include/LAGraph.h b/LAGraph/include/LAGraph.h index 7df649c1b..6d7f2d49b 100644 --- a/LAGraph/include/LAGraph.h +++ b/LAGraph/include/LAGraph.h @@ -98,6 +98,9 @@ #if ( !LAGRAPH_VANILLA ) && defined ( GxB_SUITESPARSE_GRAPHBLAS ) // use SuiteSparse, and its GxB* extensions + #if GxB_IMPLEMENTATION < GxB_VERSION (7,1,0) + #error "If using SuiteSparse::GraphBLAS, version 7.1.0 or later s required" + #endif #define LAGRAPH_SUITESPARSE 1 #else // use any GraphBLAS library (possibly SuiteSparse) but with no GxB* From 616d583100f20327be93da99106e08d8b004c3d4 Mon Sep 17 00:00:00 2001 From: Tim Davis Date: Wed, 29 Nov 2023 22:07:14 -0600 Subject: [PATCH 16/21] remove HANDLE_VERSION_RANGE: cannot handle 7.1.0...9.0.1 --- LAGraph/cmake_modules/FindGraphBLAS.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/LAGraph/cmake_modules/FindGraphBLAS.cmake b/LAGraph/cmake_modules/FindGraphBLAS.cmake index f1c58cf20..6b7b42784 100644 --- a/LAGraph/cmake_modules/FindGraphBLAS.cmake +++ b/LAGraph/cmake_modules/FindGraphBLAS.cmake @@ -176,7 +176,6 @@ find_package_handle_standard_args( GraphBLAS REQUIRED_VARS GRAPHBLAS_LIBRARIES GRAPHBLAS_INCLUDE_DIR VERSION_VAR GRAPHBLAS_VERSION - HANDLE_VERSION_RANGE ) mark_as_advanced( From 48b72531e5d2992289d5a37d2e58d591091ad0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 29 Nov 2023 22:51:27 +0100 Subject: [PATCH 17/21] LAGraph: Use same variable names for version in FindGraphBLAS and LAGraphConfig --- LAGraph/cmake_modules/FindGraphBLAS.cmake | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/LAGraph/cmake_modules/FindGraphBLAS.cmake b/LAGraph/cmake_modules/FindGraphBLAS.cmake index 6b7b42784..31464b640 100644 --- a/LAGraph/cmake_modules/FindGraphBLAS.cmake +++ b/LAGraph/cmake_modules/FindGraphBLAS.cmake @@ -150,6 +150,21 @@ string ( ${GRAPHBLAS_FILENAME} ) +if ( GRAPHBLAS_VERSION ) + if ( ${GRAPHBLAS_VERSION} MATCHES "([0-9]+).[0-9]+.[0-9]+" ) + set ( GraphBLAS_VERSION_MAJOR ${CMAKE_MATCH_1} ) + endif ( ) + if ( ${GRAPHBLAS_VERSION} MATCHES "[0-9]+.([0-9]+).[0-9]+" ) + set ( GraphBLAS_VERSION_MINOR ${CMAKE_MATCH_1} ) + endif ( ) + if ( ${GRAPHBLAS_VERSION} MATCHES "[0-9]+.[0-9]+.([0-9]+)" ) + set ( GraphBLAS_VERSION_PATCH ${CMAKE_MATCH_1} ) + endif ( ) + message ( STATUS "major: ${GraphBLAS_VERSION_MAJOR}" ) + message ( STATUS "minor: ${GraphBLAS_VERSION_MINOR}" ) + message ( STATUS "patch: ${GraphBLAS_VERSION_PATCH}" ) +endif ( ) + # set ( GRAPHBLAS_VERSION "" ) if ( EXISTS "${GRAPHBLAS_INCLUDE_DIR}" AND NOT GRAPHBLAS_VERSION ) # if the version does not appear in the filename, read the include file @@ -162,10 +177,10 @@ if ( EXISTS "${GRAPHBLAS_INCLUDE_DIR}" AND NOT GRAPHBLAS_VERSION ) message ( STATUS "major: ${GRAPHBLAS_MAJOR_STR}" ) message ( STATUS "minor: ${GRAPHBLAS_MINOR_STR}" ) message ( STATUS "patch: ${GRAPHBLAS_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" GRAPHBLAS_MAJOR ${GRAPHBLAS_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" GRAPHBLAS_MINOR ${GRAPHBLAS_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" GRAPHBLAS_PATCH ${GRAPHBLAS_PATCH_STR} ) - set (GRAPHBLAS_VERSION "${GRAPHBLAS_MAJOR}.${GRAPHBLAS_MINOR}.${GRAPHBLAS_PATCH}") + string ( REGEX MATCH "[0-9]+" GraphBLAS_VERSION_MAJOR ${GRAPHBLAS_MAJOR_STR} ) + string ( REGEX MATCH "[0-9]+" GraphBLAS_VERSION_MINOR ${GRAPHBLAS_MINOR_STR} ) + string ( REGEX MATCH "[0-9]+" GraphBLAS_VERSION_PATCH ${GRAPHBLAS_PATCH_STR} ) + set (GRAPHBLAS_VERSION "${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_PATCH}") endif ( ) set ( GRAPHBLAS_LIBRARIES ${GRAPHBLAS_LIBRARY} ) From 91a2efa5e1577d6dbcc82dd722df39fa240ceab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 29 Nov 2023 23:01:17 +0100 Subject: [PATCH 18/21] Use correct namespace for GraphBLAS target in LAGraph --- LAGraph/experimental/test/CMakeLists.txt | 4 ++-- LAGraph/src/test/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LAGraph/experimental/test/CMakeLists.txt b/LAGraph/experimental/test/CMakeLists.txt index 8125c5ebb..ccd335f0b 100644 --- a/LAGraph/experimental/test/CMakeLists.txt +++ b/LAGraph/experimental/test/CMakeLists.txt @@ -110,10 +110,10 @@ foreach( testsourcefile ${TEST_SOURCES} ) if (WIN32) if ( BUILD_SHARED_LIBS ) set_tests_properties ( ${ctestname} PROPERTIES - ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$;PATH=path_list_prepend:$" ) + ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$;PATH=path_list_prepend:$" ) else ( ) set_tests_properties ( ${ctestname} PROPERTIES - ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$" ) + ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$" ) endif ( ) endif ( ) endforeach( testsourcefile ${TEST_SOURCES} ) diff --git a/LAGraph/src/test/CMakeLists.txt b/LAGraph/src/test/CMakeLists.txt index 70b33d33f..8a8076237 100644 --- a/LAGraph/src/test/CMakeLists.txt +++ b/LAGraph/src/test/CMakeLists.txt @@ -109,10 +109,10 @@ foreach( testsourcefile ${TEST_SOURCES} ) if (WIN32) if ( BUILD_SHARED_LIBS ) set_tests_properties ( ${ctestname} PROPERTIES - ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$;PATH=path_list_prepend:$" ) + ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$;PATH=path_list_prepend:$" ) else ( ) set_tests_properties ( ${ctestname} PROPERTIES - ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$>" ) + ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$>" ) endif ( ) endif ( ) endforeach( testsourcefile ${TEST_SOURCES} ) From 050d77d66322c68f90ade4f43849754081a9e5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Thu, 30 Nov 2023 10:50:52 +0100 Subject: [PATCH 19/21] FindGraphBLAS: Try to make sure GRAPHBLAS_STATIC is really a static library --- LAGraph/cmake_modules/FindGraphBLAS.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/LAGraph/cmake_modules/FindGraphBLAS.cmake b/LAGraph/cmake_modules/FindGraphBLAS.cmake index 31464b640..f72fc07ea 100644 --- a/LAGraph/cmake_modules/FindGraphBLAS.cmake +++ b/LAGraph/cmake_modules/FindGraphBLAS.cmake @@ -120,16 +120,14 @@ find_library ( GRAPHBLAS_LIBRARY ) if ( MSVC ) - set ( STATIC_SUFFIX .lib ) set ( STATIC_NAME graphblas_static ) else ( ) - set ( STATIC_SUFFIX .a ) set ( STATIC_NAME graphblas ) endif ( ) # static SuiteSparse:GraphBLAS library set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -set ( CMAKE_FIND_LIBRARY_SUFFIXES ${STATIC_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) +set ( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX} ) find_library ( GRAPHBLAS_STATIC NAMES ${STATIC_NAME} HINTS ${GRAPHBLAS_ROOT} @@ -140,6 +138,9 @@ find_library ( GRAPHBLAS_STATIC PATH_SUFFIXES lib build alternative ) set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) +if ( MINGW AND GRAPHBLAS_STATIC MATCHES ".*\.dll\.a" ) + set ( GRAPHBLAS_STATIC "" ) +endif ( ) # get version of the library from the dynamic library name get_filename_component ( GRAPHBLAS_LIBRARY ${GRAPHBLAS_LIBRARY} REALPATH ) @@ -214,13 +215,13 @@ else ( ) endif ( ) # Create target from information found -if ( NOT "${GRAPHBLAS_LIBRARY}" STREQUAL "" ) +if ( GRAPHBLAS_LIBRARY ) add_library ( GraphBLAS::GraphBLAS UNKNOWN IMPORTED ) set_target_properties ( GraphBLAS::GraphBLAS PROPERTIES IMPORTED_LOCATION "${GRAPHBLAS_LIBRARY}" IMPORTED_INCLUDE_DIRECTORIES "${GRAPHBLAS_INCLUDE_DIR}" ) endif ( ) -if ( NOT "${GRAPHBLAS_STATIC}" STREQUAL "" ) +if ( GRAPHBLAS_STATIC ) add_library ( GraphBLAS::GraphBLAS_static UNKNOWN IMPORTED ) set_target_properties ( GraphBLAS::GraphBLAS_static PROPERTIES IMPORTED_LOCATION "${GRAPHBLAS_STATIC}" From b02ef0b3be0da6c494eddc0a189dac60e95d03a4 Mon Sep 17 00:00:00 2001 From: Tim Davis Date: Thu, 30 Nov 2023 07:20:25 -0600 Subject: [PATCH 20/21] CXSparse: date. Example: add LAGraph. LAGraph: *.h for C++ --- CXSparse/Config/cs.h.in | 4 +- CXSparse/Include/cs.h | 4 +- Example/CMakeLists.txt | 56 ++++++++++- Example/Demo/mydemo.out | 183 ---------------------------------- Example/Include/my.h | 6 +- Example/Include/my_internal.h | 4 + Example/README.md | 35 +++---- Example/Source/my.c | 20 +++- Example/Source/my_cxx.cc | 25 ++++- LAGraph/config/LAGraph.h.in | 13 +++ LAGraph/include/LAGraph.h | 13 +++ LAGraph/include/LAGraphX.h | 13 +++ 12 files changed, 161 insertions(+), 215 deletions(-) delete mode 100644 Example/Demo/mydemo.out diff --git a/CXSparse/Config/cs.h.in b/CXSparse/Config/cs.h.in index 6280e7467..db21c6a05 100644 --- a/CXSparse/Config/cs.h.in +++ b/CXSparse/Config/cs.h.in @@ -2,7 +2,7 @@ // CXSparse/Include/cs.h: include file for CXSparse //------------------------------------------------------------------------------ -// CXSparse, Copyright (c) 2006-2022, Timothy A. Davis, All Rights Reserved +// CXSparse, Copyright (c) 2006-2023, Timothy A. Davis, All Rights Reserved // SPDX-License-Identifier: LGPL-2.1+ //------------------------------------------------------------------------------ @@ -39,7 +39,7 @@ #define CS_SUBVER @CXSPARSE_VERSION_MINOR@ #define CS_SUBSUB @CXSPARSE_VERSION_SUB@ #define CS_DATE "@CXSPARSE_DATE@" /* CXSparse release date */ -#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2022" +#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2023" #define CXSPARSE #include "SuiteSparse_config.h" diff --git a/CXSparse/Include/cs.h b/CXSparse/Include/cs.h index fe5061350..1919a5a17 100644 --- a/CXSparse/Include/cs.h +++ b/CXSparse/Include/cs.h @@ -2,7 +2,7 @@ // CXSparse/Include/cs.h: include file for CXSparse //------------------------------------------------------------------------------ -// CXSparse, Copyright (c) 2006-2022, Timothy A. Davis, All Rights Reserved +// CXSparse, Copyright (c) 2006-2023, Timothy A. Davis, All Rights Reserved // SPDX-License-Identifier: LGPL-2.1+ //------------------------------------------------------------------------------ @@ -39,7 +39,7 @@ #define CS_SUBVER 3 #define CS_SUBSUB 0 #define CS_DATE "Dec 30, 2023" /* CXSparse release date */ -#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2022" +#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2023" #define CXSPARSE #include "SuiteSparse_config.h" diff --git a/Example/CMakeLists.txt b/Example/CMakeLists.txt index 35ad1d293..2bb1cc172 100644 --- a/Example/CMakeLists.txt +++ b/Example/CMakeLists.txt @@ -5,16 +5,53 @@ # Copyright (c) 2022-2023, Timothy A. Davis, All Rights Reserved. # SPDX-License-Identifier: BSD-3-clause +# See the section below, "help with building this Example ..." for how to tell +# this Example library where to find SuiteSparse. + +cmake_minimum_required ( VERSION 3.20 ) + +#------------------------------------------------------------------------------- +# help with building this Example package and finding SuiteSparse +#------------------------------------------------------------------------------- + # To build this example, add the location of the CMake config files to -# CMAKE_PREFIX_PATH if the SuiteSparse libraries aren't installed at a -# default location. +# CMAKE_PREFIX_PATH if the SuiteSparse libraries aren't installed at a default +# location. For example, on Linux or Mac, if you have your own a compiled copy +# of SuiteSparse in /home/me/SuiteSparse that was compiled and installed with +# LOCAL_INSTALL set to ON, use the following: +# +# export CMAKE_PREFIX_PATH /home/me/SuiteSparse +# +# or uncomment and revise one of these examples, on any platform: +# +# set ( CMAKE_PREFIX_PATH /home/me/SuiteSparse ) +# set ( CMAKE_PREFIX_PATH /opt/SuiteSparse ) +# +# The following is added, just to simplify building this Example if it is +# located inside SuiteSparse itself and compiled with LOCAL_INSTALL set to ON. +# Normally you would not use this in a stand-alone library that relies on +# SuiteSparse: + + set ( CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${CMAKE_SOURCE_DIR}/.. ) + +# Next, to build and install this Example library, do the following: +# +# cd Example/build +# cmake .. +# cmake --build . --config Release +# sudo cmake --install . +# +# Alternatively, if you have "make", just do this in this directory: +# +# make +# sudo make install + +message ( STATUS "MY prefix path: ${CMAKE_PREFIX_PATH}" ) #------------------------------------------------------------------------------- # get the version #------------------------------------------------------------------------------- -cmake_minimum_required ( VERSION 3.20 ) - # cmake inserts the date and version number into Include/my.h: set ( MY_DATE "Dec 30, 2023" ) set ( MY_VERSION_MAJOR 1 ) @@ -596,3 +633,14 @@ if ( BUILD_STATIC_LIBS ) add_executable ( my_cxx_demo_static "Demo/my_demo.c" ) target_link_libraries ( my_cxx_demo_static PUBLIC my_cxx_static ) endif ( ) + +#------------------------------------------------------------------------------- +# report +#------------------------------------------------------------------------------- + +message ( STATUS "MY source: ${CMAKE_SOURCE_DIR} ") +message ( STATUS "MY build: ${CMAKE_BINARY_DIR} ") +message ( STATUS "MY install prefix: ${CMAKE_INSTALL_PREFIX}" ) +message ( STATUS "MY install rpath: ${CMAKE_INSTALL_RPATH}" ) +message ( STATUS "MY build rpath: ${CMAKE_BUILD_RPATH}" ) + diff --git a/Example/Demo/mydemo.out b/Example/Demo/mydemo.out deleted file mode 100644 index ac55d6f2e..000000000 --- a/Example/Demo/mydemo.out +++ /dev/null @@ -1,183 +0,0 @@ -My demo -Date from #include 'my.h': Sept 18, 2023 -Date from compiled library: Sept 18, 2023 -version from #include 'my.h.': 1.4.1 -version from compiled library: 1.4.1 -SuiteSparse: v7.2.1 (Sept 18, 2023) -SuiteSparse: v7.2.1 (in library) -CXSparse: v4.2.1 (Sept 18, 2023) -CXSparse Version 4.2.1, Sept 18, 2023. Copyright (c) Timothy A. Davis, 2006-2022 -2-by-2, nzmax: 4 nnz: 4, 1-norm: 34 - col 0 : locations 0 to 1 - 0 : 11 - 1 : 21 - col 1 : locations 2 to 3 - 0 : 12 - 1 : 22 -AMD: v3.2.1 (Sept 18, 2023) -P [0] = 0 -P [1] = 1 -BTF: v2.2.1 (Sept 18, 2023) -P [0] = 0 -P [1] = 1 -Q [0] = 0 -Q [1] = 1 -nblocks 1 -CAMD: v3.2.1 (Sept 18, 2023) -P [0] = 0 -P [1] = 1 -CCOLAMD: v3.2.1 (Sept 18, 2023) -P [0] = 0 -P [1] = 1 -COLAMD: v3.2.1 (Sept 18, 2023) -P [0] = 0 -P [1] = 1 -CHOLMOD: v4.2.1 (Sept 18, 2023) -CHOLMOD: v4.2.1 (in library) -GraphBLAS: v8.2.1 (Sept 18, 2023) -GraphBLAS: v8.2.1 (in library) -KLU: v2.2.1 (Sept 18, 2023) -x [0] = 36.4 -x [1] = -32.7 -error: 7.10543e-14 -LDL: v3.2.1 (Sept 18, 2023) -x2 [0] = 36.4 -x2 [1] = -32.7 -error: 0 -RBio: v4.2.1 (Sept 18, 2023) -njumbled 0, nzeros 0 -result 0 -mtype: iua -2-by-2 matrix |simple - 3 1 1 1 -iua 2 2 4 0 -(40I2) (40I2) (26I3) - 1 3 5 - 1 2 1 2 - 11 21 12 22 -SPEX: v2.2.1 (Sept 18, 2023) -SPQR: v4.2.1 (Sept 18, 2023) - -CHOLMOD dense: X from QR: 2-by-1, - leading dimension 2, nzmax 2, real, double - col 0: - 0: 36.4 - 1: -32.7 - OK - -UMFPACK: v6.2.1 (Sept 18, 2023) -UMFPACK V6.2.1 (Sept 18, 2023) -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. - -UMFPACK License: SPDX-License-Identifier: GPL-2.0+ - UMFPACK is available under alternate licenses, - contact T. Davis for details. -BLAS used: Intel MKL 64lp BLAS (32-bit integers) -BLAS integer size: 4 bytes -x [0] = 36.4 -x [1] = -32.7 -error: 5.68434e-14 - -UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. - - -UMFPACK License: SPDX-License-Identifier: GPL-2.0+ - UMFPACK is available under alternate licenses, - contact T. Davis for details. - - -Availability: http://www.suitesparse.com -UMFPACK V6.2.1 (Sept 18, 2023): OK - -UMFPACK V6.2.1 (Sept 18, 2023), Info: - matrix entry defined as: double - Int (generic integer) defined as: int64_t - BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 - MATLAB: no. - CPU timer: SuiteSparse_time ( ) routine. - number of rows in matrix A: 2 - number of columns in matrix A: 2 - entries in matrix A: 4 - memory usage reported in: 16-byte Units - size of int32_t: 4 bytes - size of int64_t: 8 bytes - size of pointer: 8 bytes - size of numerical entry: 8 bytes - - strategy used: symmetric - ordering used: amd on A+A' - modify Q during factorization: no - prefer diagonal pivoting: yes - pivots with zero Markowitz cost: 0 - submatrix S after removing zero-cost pivots: - number of "dense" rows: 0 - number of "dense" columns: 0 - number of empty rows: 0 - number of empty columns 0 - submatrix S square and diagonal preserved - pattern of square submatrix S: - number rows and columns 2 - symmetry of nonzero pattern: 1.000000 - nz in S+S' (excl. diagonal): 2 - nz on diagonal of matrix S: 2 - fraction of nz on diagonal: 1.000000 - ordering statistics, for strict diagonal pivoting: - est. flops for LU factorization: 3.00000e+00 - est. nz in L+U (incl. diagonal): 4 - est. largest front (# entries): 4 - est. max nz in any column of L: 2 - number of "dense" rows/columns in S+S': 0 - symbolic factorization defragmentations: 0 - symbolic memory usage (Units): 81 - symbolic memory usage (MBytes): 0.0 - Symbolic size (Units): 40 - Symbolic size (MBytes): 0 - symbolic factorization wallclock time(sec): 0.00 - - matrix scaled: yes (divided each row by sum of abs values in each row) - minimum sum (abs (rows of A)): 2.30000e+01 - maximum sum (abs (rows of A)): 4.30000e+01 - - symbolic/numeric factorization: upper bound actual % - variable-sized part of Numeric object: - initial size (Units) 45 40 89% - peak size (Units) 638 636 100% - final size (Units) 3 5 167% - Numeric final size (Units) 50 51 102% - Numeric final size (MBytes) 0.0 0.0 102% - peak memory usage (Units) 758 756 100% - peak memory usage (MBytes) 0.0 0.0 100% - numeric factorization flops 3.00000e+00 3.00000e+00 100% - nz in L (incl diagonal) 3 3 100% - nz in U (incl diagonal) 3 3 100% - nz in L+U (incl diagonal) 4 4 100% - largest front (# entries) 6 4 67% - largest # rows in front 3 2 67% - largest # columns in front 2 2 100% - - initial allocation ratio used: 1.2 - # of forced updates due to frontal growth: 0 - number of off-diagonal pivots: 0 - nz in L (incl diagonal), if none dropped 3 - nz in U (incl diagonal), if none dropped 3 - number of small entries dropped 0 - nonzeros on diagonal of U: 2 - min abs. value on diagonal of U: 2.11e-02 - max abs. value on diagonal of U: 4.78e-01 - estimate of reciprocal of condition number: 4.42e-02 - indices in compressed pattern: 2 - numerical values stored in Numeric object: 4 - numeric factorization defragmentations: 0 - numeric factorization reallocations: 0 - costly numeric factorization reallocations: 0 - numeric factorization wallclock time (sec): 0.00 - - solve flops: 4.20000e+01 - iterative refinement steps taken: 0 - iterative refinement steps attempted: 0 - sparse backward error omega1: 7.44e-17 - sparse backward error omega2: 0.00e+00 - solve wall clock time (sec): 0.00 - - total symbolic + numeric + solve flops: 4.50000e+01 - diff --git a/Example/Include/my.h b/Example/Include/my.h index 71272afde..3366eb880 100644 --- a/Example/Include/my.h +++ b/Example/Include/my.h @@ -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 "Nov 30, 2023" +#define MY_DATE "Dec 30, 2023" #define MY_MAJOR_VERSION 1 -#define MY_MINOR_VERSION 4 -#define MY_PATCH_VERSION 4 +#define MY_MINOR_VERSION 5 +#define MY_PATCH_VERSION 0 #ifdef __cplusplus extern "C" { diff --git a/Example/Include/my_internal.h b/Example/Include/my_internal.h index e78d149cb..54acc778b 100644 --- a/Example/Include/my_internal.h +++ b/Example/Include/my_internal.h @@ -20,6 +20,10 @@ #if ! defined (NO_GRAPHBLAS) # include "GraphBLAS.h" #endif +#if ! defined (NO_LAGRAPH) +# include "LAGraph.h" +#endif +#include "klu.h" #include "klu.h" #include "ldl.h" #include "RBio.h" diff --git a/Example/README.md b/Example/README.md index f6263e9ad..db9e20cc5 100644 --- a/Example/README.md +++ b/Example/README.md @@ -6,30 +6,28 @@ SPDX-License-Identifier: BSD-3-clause An example of how to use the SuiteSparse `Find*.cmake` files in cmake to build a library that depends on SuiteSparse libraries. - README.md this file - CMakeLists.txt primary method for building the package - Makefile optional; relies on cmake to do the work - Include/my.h created by cmake from Config/my.h.in - Config/my.h.in input file for Include/my.h - Demo/my_demo.c demo program that uses 'my' package - Demo/mydemo.out output of my_demo - Source/my.c library source code - build where the 'my' package is built - cmake_modules/FindGMP.cmake how to find the GMP library - cmake_modules/FindMPFR.cmake how to find the MPFR library + README.md this file + License.txt license + CMakeLists.txt primary method for building the package + Makefile optional; relies on cmake to do the work + Include/my.h created by cmake from Config/my.h.in + Include/my_internal.h internal include file + Config/my.h.in input file for Include/my.h + Demo/my_demo.c demo program that uses 'my' package + Demo/my_demo.out output of my_demo + Source/my.c library source code (C) + Source/my_cxx.cc library source code (C++) + build where the 'my' package is built The 'my' library relies on the following SuiteSparse libraries, each of which has a cmake module to use in `find_package` that is installed alongside the compiled libraries (/usr/local/lib/cmake/SuiteSparse) `AMD`, `BTF`, `CAMD`, -`CCOLAMD`, `CHOLMOD`, `CHOLMOD_CUDA`, `COLAMD`, `CXSparse`, `GPUQREngine`, -`GraphBLAS`, `KLU`, `KLU_CHOLMOD`, `LDL`, `Mongoose`, `RBio`, `SPEX`, `SPQR`, +`CCOLAMD`, `CHOLMOD`, `COLAMD`, `CXSparse`, `GPUQREngine`, `GraphBLAS`, `KLU`, +`KLU_CHOLMOD`, `LAGraph`, `LDL`, `Mongoose`, `RBio`, `SPEX`, `SPQR`, `SPQR_CUDA`, `SuiteSparse_GPURuntime`, `SuiteSparse_config`, and `UMFPACK`. In addition, the 'my' package relies on the following external libraries: -`BLAS`, `LAPACK`, `OpenMP`, `GMP`, and `MPFR`. The latter two (GMP and MPFR) -do not have cmake `find_package` modules. These can be found in -`SuiteSparse/Example/cmake_modules`, or in `SuiteSparse/SPEX/cmake_modules`. -They are not installed in /usr/local/lib/cmake/SuiteSparse. +`BLAS`, `LAPACK`, `OpenMP`, `GMP`, and `MPFR`. To compile the `my` package and run a demo program: @@ -46,3 +44,6 @@ To remove all compiled files and folders, delete the contents of Example/build make clean +See the instructions in CMakeLists.txt for additional instructions (in +particular, if SuiteSparse is not found). + diff --git a/Example/Source/my.c b/Example/Source/my.c index c2bcd3714..73a9a9595 100644 --- a/Example/Source/my.c +++ b/Example/Source/my.c @@ -144,11 +144,11 @@ void my_function (void) cholmod_common cc ; OK (cholmod_l_start (&cc)) ; -#if ! defined (NO_GRAPHBLAS) //-------------------------------------------------------------------------- // GraphBLAS //-------------------------------------------------------------------------- + #if ! defined (NO_GRAPHBLAS) OK (GrB_init (GrB_NONBLOCKING) == GrB_SUCCESS) ; printf ("GraphBLAS: v%d.%d.%d (%s)\n", GxB_IMPLEMENTATION_MAJOR, GxB_IMPLEMENTATION_MINOR, @@ -157,7 +157,23 @@ void my_function (void) printf ("GraphBLAS: v%d.%d.%d (in library)\n", version [0], version [1], version [2]) ; OK (GrB_finalize ( ) == GrB_SUCCESS) ; -#endif + #endif + + //-------------------------------------------------------------------------- + // LAGraph + //-------------------------------------------------------------------------- + + #if ! defined (NO_LAGRAPH) + char msg [LAGRAPH_MSG_LEN], verstring [LAGRAPH_MSG_LEN] ; + printf ("LAGraph: v%d.%d.%d (%s)\n", + LAGRAPH_VERSION_MAJOR, LAGRAPH_VERSION_MINOR, LAGRAPH_VERSION_UPDATE, + LAGRAPH_DATE) ; + OK (LAGraph_Init (msg) == GrB_SUCCESS) ; + OK (LAGraph_Version (version, verstring, msg) == GrB_SUCCESS) ; + printf ("LAGraph: v%d.%d.%d (%s) (in library)\n", + version [0], version [1], version [2], verstring) ; + OK (LAGraph_Finalize (msg) == GrB_SUCCESS) ; + #endif //-------------------------------------------------------------------------- // KLU diff --git a/Example/Source/my_cxx.cc b/Example/Source/my_cxx.cc index f72ac8c28..f2935b6ec 100644 --- a/Example/Source/my_cxx.cc +++ b/Example/Source/my_cxx.cc @@ -176,11 +176,11 @@ void my_function (void) cholmod_common cc ; OK (cholmod_l_start (&cc)) ; -#if ! defined (NO_GRAPHBLAS) //-------------------------------------------------------------------------- // GraphBLAS //-------------------------------------------------------------------------- + #if ! defined (NO_GRAPHBLAS) std::cout << "GraphBLAS: v" << GxB_IMPLEMENTATION_MAJOR << "." << GxB_IMPLEMENTATION_MINOR << "." @@ -194,7 +194,28 @@ void my_function (void) << version[2] << " " << "(in library)" << std::endl; OK (GrB_finalize ( ) == GrB_SUCCESS) ; -#endif + #endif + + //-------------------------------------------------------------------------- + // LAGraph + //-------------------------------------------------------------------------- + + #if ! defined (NO_LAGRAPH) + char msg [LAGRAPH_MSG_LEN], verstring [LAGRAPH_MSG_LEN] ; + std::cout << "LAGraph: v" + << LAGRAPH_VERSION_MAJOR << "." + << LAGRAPH_VERSION_MINOR << "." + << LAGRAPH_VERSION_UPDATE << " " + << "(" << LAGRAPH_DATE << ")" << std::endl; + OK (LAGraph_Init (msg) == GrB_SUCCESS) ; + OK (LAGraph_Version (version, verstring, msg) == GrB_SUCCESS) ; + std::cout << "LAGraph: v" + << version[0] << "." + << version[1] << "." + << version[2] << " " + << "(in library)" << std::endl; + OK (LAGraph_Finalize (msg) == GrB_SUCCESS) ; + #endif //-------------------------------------------------------------------------- // KLU diff --git a/LAGraph/config/LAGraph.h.in b/LAGraph/config/LAGraph.h.in index b506c7e14..7ef78c2c5 100644 --- a/LAGraph/config/LAGraph.h.in +++ b/LAGraph/config/LAGraph.h.in @@ -370,6 +370,15 @@ } \ } +//============================================================================== +// for C++ applications: +//============================================================================== + +#if defined ( __cplusplus ) +extern "C" +{ +#endif + //============================================================================== // LAGraph memory management //============================================================================== @@ -2506,4 +2515,8 @@ int LAGr_TriangleCount char *msg ) ; +#if defined ( __cplusplus ) +} +#endif + #endif diff --git a/LAGraph/include/LAGraph.h b/LAGraph/include/LAGraph.h index 6d7f2d49b..7bc41bdaa 100644 --- a/LAGraph/include/LAGraph.h +++ b/LAGraph/include/LAGraph.h @@ -370,6 +370,15 @@ } \ } +//============================================================================== +// for C++ applications: +//============================================================================== + +#if defined ( __cplusplus ) +extern "C" +{ +#endif + //============================================================================== // LAGraph memory management //============================================================================== @@ -2506,4 +2515,8 @@ int LAGr_TriangleCount char *msg ) ; +#if defined ( __cplusplus ) +} +#endif + #endif diff --git a/LAGraph/include/LAGraphX.h b/LAGraph/include/LAGraphX.h index c17b2fbbe..fe3b29a9c 100644 --- a/LAGraph/include/LAGraphX.h +++ b/LAGraph/include/LAGraphX.h @@ -32,6 +32,15 @@ #define LAGRAPHX_PUBLIC #endif +//============================================================================== +// for C++ applications: +//============================================================================== + +#if defined ( __cplusplus ) +extern "C" +{ +#endif + //============================================================================== // Experimental methods: in experimental/algorithm and experimental/utility //============================================================================== @@ -882,4 +891,8 @@ int LAGraph_HelloWorld // a simple algorithm, just for illustration char *msg ) ; +#if defined ( __cplusplus ) +} +#endif + #endif From d01e6e5fed316cda7baee4956c4ec94cc434a26d Mon Sep 17 00:00:00 2001 From: Tim Davis Date: Thu, 30 Nov 2023 07:26:38 -0600 Subject: [PATCH 21/21] Example: demo output --- Example/Demo/mydemo.out | 185 ++++++++++++++++++++++++++++++++++++++++ Example/README.md | 2 +- 2 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 Example/Demo/mydemo.out diff --git a/Example/Demo/mydemo.out b/Example/Demo/mydemo.out new file mode 100644 index 000000000..0520b1ffa --- /dev/null +++ b/Example/Demo/mydemo.out @@ -0,0 +1,185 @@ +My demo +Date from #include 'my.h': Dec 30, 2023 +Date from compiled library: Dec 30, 2023 +version from #include 'my.h.': 1.5.0 +version from compiled library: 1.5.0 +SuiteSparse: v7.4.0 (Dec 30, 2023) +SuiteSparse: v7.4.0 (in library) +CXSparse: v4.3.0 (Dec 30, 2023) +CXSparse Version 4.3.0, Dec 30, 2023. Copyright (c) Timothy A. Davis, 2006-2023 +2-by-2, nzmax: 4 nnz: 4, 1-norm: 34 + col 0 : locations 0 to 1 + 0 : 11 + 1 : 21 + col 1 : locations 2 to 3 + 0 : 12 + 1 : 22 +AMD: v3.3.0 (Dec 30, 2023) +P [0] = 0 +P [1] = 1 +BTF: v2.3.0 (Dec 30, 2023) +P [0] = 0 +P [1] = 1 +Q [0] = 0 +Q [1] = 1 +nblocks 1 +CAMD: v3.3.0 (Dec 30, 2023) +P [0] = 0 +P [1] = 1 +CCOLAMD: v3.3.0 (Dec 30, 2023) +P [0] = 0 +P [1] = 1 +COLAMD: v3.3.0 (Dec 30, 2023) +P [0] = 0 +P [1] = 1 +CHOLMOD: v5.1.0 (Dec 30, 2023) +CHOLMOD: v5.1.0 (in library) +GraphBLAS: v8.3.0 (Dec 30, 2023) +GraphBLAS: v8.3.0 (in library) +LAGraph: v1.1.0 (Dec 30, 2023) +LAGraph: v1.1.0 (Dec 30, 2023) (in library) +KLU: v2.3.0 (Dec 30, 2023) +x [0] = 36.4 +x [1] = -32.7 +error: 7.10543e-14 +LDL: v3.3.0 (Dec 30, 2023) +x2 [0] = 36.4 +x2 [1] = -32.7 +error: 0 +RBio: v4.3.0 (Dec 30, 2023) +njumbled 0, nzeros 0 +result 0 +mtype: iua +2-by-2 matrix |simple + 3 1 1 1 +iua 2 2 4 0 +(40I2) (40I2) (26I3) + 1 3 5 + 1 2 1 2 + 11 21 12 22 +SPEX: v2.3.0 (Dec 30, 2023) +SPQR: v4.3.0 (Dec 30, 2023) + +CHOLMOD dense: X from QR: 2-by-1, + leading dimension 2, nzmax 2, real, double + col 0: + 0: 36.4 + 1: -32.7 + OK + +UMFPACK: v6.3.0 (Dec 30, 2023) +UMFPACK V6.3.0 (Dec 30, 2023) +UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. + +UMFPACK License: SPDX-License-Identifier: GPL-2.0+ + UMFPACK is available under alternate licenses, + contact T. Davis for details. +BLAS used: Intel MKL 64lp BLAS (32-bit integers) +BLAS integer size: 4 bytes +x [0] = 36.4 +x [1] = -32.7 +error: 5.68434e-14 + +UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. + + +UMFPACK License: SPDX-License-Identifier: GPL-2.0+ + UMFPACK is available under alternate licenses, + contact T. Davis for details. + + +Availability: http://www.suitesparse.com +UMFPACK V6.3.0 (Dec 30, 2023): OK + +UMFPACK V6.3.0 (Dec 30, 2023), Info: + matrix entry defined as: double + Int (generic integer) defined as: int64_t + BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 + MATLAB: no. + CPU timer: SuiteSparse_time ( ) routine. + number of rows in matrix A: 2 + number of columns in matrix A: 2 + entries in matrix A: 4 + memory usage reported in: 16-byte Units + size of int32_t: 4 bytes + size of int64_t: 8 bytes + size of pointer: 8 bytes + size of numerical entry: 8 bytes + + strategy used: symmetric + ordering used: amd on A+A' + modify Q during factorization: no + prefer diagonal pivoting: yes + pivots with zero Markowitz cost: 0 + submatrix S after removing zero-cost pivots: + number of "dense" rows: 0 + number of "dense" columns: 0 + number of empty rows: 0 + number of empty columns 0 + submatrix S square and diagonal preserved + pattern of square submatrix S: + number rows and columns 2 + symmetry of nonzero pattern: 1.000000 + nz in S+S' (excl. diagonal): 2 + nz on diagonal of matrix S: 2 + fraction of nz on diagonal: 1.000000 + ordering statistics, for strict diagonal pivoting: + est. flops for LU factorization: 3.00000e+00 + est. nz in L+U (incl. diagonal): 4 + est. largest front (# entries): 4 + est. max nz in any column of L: 2 + number of "dense" rows/columns in S+S': 0 + symbolic factorization defragmentations: 0 + symbolic memory usage (Units): 81 + symbolic memory usage (MBytes): 0.0 + Symbolic size (Units): 40 + Symbolic size (MBytes): 0 + symbolic factorization wallclock time(sec): 0.00 + + matrix scaled: yes (divided each row by sum of abs values in each row) + minimum sum (abs (rows of A)): 2.30000e+01 + maximum sum (abs (rows of A)): 4.30000e+01 + + symbolic/numeric factorization: upper bound actual % + variable-sized part of Numeric object: + initial size (Units) 45 40 89% + peak size (Units) 638 636 100% + final size (Units) 3 5 167% + Numeric final size (Units) 50 51 102% + Numeric final size (MBytes) 0.0 0.0 102% + peak memory usage (Units) 758 756 100% + peak memory usage (MBytes) 0.0 0.0 100% + numeric factorization flops 3.00000e+00 3.00000e+00 100% + nz in L (incl diagonal) 3 3 100% + nz in U (incl diagonal) 3 3 100% + nz in L+U (incl diagonal) 4 4 100% + largest front (# entries) 6 4 67% + largest # rows in front 3 2 67% + largest # columns in front 2 2 100% + + initial allocation ratio used: 1.2 + # of forced updates due to frontal growth: 0 + number of off-diagonal pivots: 0 + nz in L (incl diagonal), if none dropped 3 + nz in U (incl diagonal), if none dropped 3 + number of small entries dropped 0 + nonzeros on diagonal of U: 2 + min abs. value on diagonal of U: 2.11e-02 + max abs. value on diagonal of U: 4.78e-01 + estimate of reciprocal of condition number: 4.42e-02 + indices in compressed pattern: 2 + numerical values stored in Numeric object: 4 + numeric factorization defragmentations: 0 + numeric factorization reallocations: 0 + costly numeric factorization reallocations: 0 + numeric factorization wallclock time (sec): 0.00 + + solve flops: 4.20000e+01 + iterative refinement steps taken: 0 + iterative refinement steps attempted: 0 + sparse backward error omega1: 7.44e-17 + sparse backward error omega2: 0.00e+00 + solve wall clock time (sec): 0.00 + + total symbolic + numeric + solve flops: 4.50000e+01 + diff --git a/Example/README.md b/Example/README.md index db9e20cc5..3d5238834 100644 --- a/Example/README.md +++ b/Example/README.md @@ -14,7 +14,7 @@ to build a library that depends on SuiteSparse libraries. Include/my_internal.h internal include file Config/my.h.in input file for Include/my.h Demo/my_demo.c demo program that uses 'my' package - Demo/my_demo.out output of my_demo + Demo/mydemo.out output of my_demo Source/my.c library source code (C) Source/my_cxx.cc library source code (C++) build where the 'my' package is built