From 222b7ee17b9b2ce6543b5165171c74f7b641efb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 13 Dec 2023 19:36:01 +0100 Subject: [PATCH 1/4] Set RPATH for installed binaries --- .../cmake_modules/SuiteSparsePolicy.cmake | 20 ++++++++++++++++--- LAGraph/cmake_modules/SuiteSparsePolicy.cmake | 20 ++++++++++++++++--- .../cmake_modules/SuiteSparsePolicy.cmake | 20 ++++++++++++++++--- 3 files changed, 51 insertions(+), 9 deletions(-) diff --git a/GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake b/GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake index 8e64cc381..d22fb11e1 100644 --- a/GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake +++ b/GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake @@ -155,9 +155,9 @@ endif ( ) # find this one without "make install" set ( CMAKE_BUILD_RPATH ${CMAKE_BUILD_RPATH} ${CMAKE_BINARY_DIR} ) +set ( INSIDE_SUITESPARSE OFF ) 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 @@ -199,18 +199,32 @@ if ( LOCAL_INSTALL ) endif ( ) endif ( ) set ( SUITESPARSE_LIBDIR ${SUITESPARSE_LOCAL_PREFIX}/lib ) + set ( SUITESPARSE_FULL_LIBDIR ${SUITESPARSE_LIBDIR} ) set ( SUITESPARSE_INCLUDEDIR ${SUITESPARSE_LOCAL_PREFIX}/include/${SUITESPARSE_INCLUDEDIR_POSTFIX} ) set ( SUITESPARSE_BINDIR ${SUITESPARSE_LOCAL_PREFIX}/bin ) else ( ) set ( SUITESPARSE_LIBDIR ${CMAKE_INSTALL_LIBDIR} ) + set ( SUITESPARSE_FULL_LIBDIR ${CMAKE_INSTALL_FULL_LIBDIR} ) set ( SUITESPARSE_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/${SUITESPARSE_INCLUDEDIR_POSTFIX} ) 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} ) + list ( APPEND CMAKE_INSTALL_RPATH ${SUITESPARSE_FULL_LIBDIR} ) + list ( APPEND CMAKE_BUILD_RPATH ${SUITESPARSE_LIBDIR} ) +else ( ) + # Set reasonable RPATH for installed binaries + # That should be fine as long as DESTDIR isn't set when installing. + list ( FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES ${SUITESPARSE_FULL_LIBDIR} _idx ) + if ( _idx LESS 0 ) + # installation is not to a system prefix + list ( FIND CMAKE_INSTALL_RPATH ${SUITESPARSE_FULL_LIBDIR} _idx ) + if ( _idx LESS 0 ) + # RPATH is not yet included in CMAKE_INSTALL_RPATH + list ( APPEND CMAKE_INSTALL_RPATH ${SUITESPARSE_FULL_LIBDIR} ) + endif ( ) + endif ( ) endif ( ) set ( SUITESPARSE_PKGFILEDIR ${SUITESPARSE_LIBDIR} CACHE STRING diff --git a/LAGraph/cmake_modules/SuiteSparsePolicy.cmake b/LAGraph/cmake_modules/SuiteSparsePolicy.cmake index 8e64cc381..d22fb11e1 100644 --- a/LAGraph/cmake_modules/SuiteSparsePolicy.cmake +++ b/LAGraph/cmake_modules/SuiteSparsePolicy.cmake @@ -155,9 +155,9 @@ endif ( ) # find this one without "make install" set ( CMAKE_BUILD_RPATH ${CMAKE_BUILD_RPATH} ${CMAKE_BINARY_DIR} ) +set ( INSIDE_SUITESPARSE OFF ) 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 @@ -199,18 +199,32 @@ if ( LOCAL_INSTALL ) endif ( ) endif ( ) set ( SUITESPARSE_LIBDIR ${SUITESPARSE_LOCAL_PREFIX}/lib ) + set ( SUITESPARSE_FULL_LIBDIR ${SUITESPARSE_LIBDIR} ) set ( SUITESPARSE_INCLUDEDIR ${SUITESPARSE_LOCAL_PREFIX}/include/${SUITESPARSE_INCLUDEDIR_POSTFIX} ) set ( SUITESPARSE_BINDIR ${SUITESPARSE_LOCAL_PREFIX}/bin ) else ( ) set ( SUITESPARSE_LIBDIR ${CMAKE_INSTALL_LIBDIR} ) + set ( SUITESPARSE_FULL_LIBDIR ${CMAKE_INSTALL_FULL_LIBDIR} ) set ( SUITESPARSE_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/${SUITESPARSE_INCLUDEDIR_POSTFIX} ) 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} ) + list ( APPEND CMAKE_INSTALL_RPATH ${SUITESPARSE_FULL_LIBDIR} ) + list ( APPEND CMAKE_BUILD_RPATH ${SUITESPARSE_LIBDIR} ) +else ( ) + # Set reasonable RPATH for installed binaries + # That should be fine as long as DESTDIR isn't set when installing. + list ( FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES ${SUITESPARSE_FULL_LIBDIR} _idx ) + if ( _idx LESS 0 ) + # installation is not to a system prefix + list ( FIND CMAKE_INSTALL_RPATH ${SUITESPARSE_FULL_LIBDIR} _idx ) + if ( _idx LESS 0 ) + # RPATH is not yet included in CMAKE_INSTALL_RPATH + list ( APPEND CMAKE_INSTALL_RPATH ${SUITESPARSE_FULL_LIBDIR} ) + endif ( ) + endif ( ) endif ( ) set ( SUITESPARSE_PKGFILEDIR ${SUITESPARSE_LIBDIR} CACHE STRING diff --git a/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake b/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake index 8e64cc381..d22fb11e1 100644 --- a/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake +++ b/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake @@ -155,9 +155,9 @@ endif ( ) # find this one without "make install" set ( CMAKE_BUILD_RPATH ${CMAKE_BUILD_RPATH} ${CMAKE_BINARY_DIR} ) +set ( INSIDE_SUITESPARSE OFF ) 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 @@ -199,18 +199,32 @@ if ( LOCAL_INSTALL ) endif ( ) endif ( ) set ( SUITESPARSE_LIBDIR ${SUITESPARSE_LOCAL_PREFIX}/lib ) + set ( SUITESPARSE_FULL_LIBDIR ${SUITESPARSE_LIBDIR} ) set ( SUITESPARSE_INCLUDEDIR ${SUITESPARSE_LOCAL_PREFIX}/include/${SUITESPARSE_INCLUDEDIR_POSTFIX} ) set ( SUITESPARSE_BINDIR ${SUITESPARSE_LOCAL_PREFIX}/bin ) else ( ) set ( SUITESPARSE_LIBDIR ${CMAKE_INSTALL_LIBDIR} ) + set ( SUITESPARSE_FULL_LIBDIR ${CMAKE_INSTALL_FULL_LIBDIR} ) set ( SUITESPARSE_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/${SUITESPARSE_INCLUDEDIR_POSTFIX} ) 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} ) + list ( APPEND CMAKE_INSTALL_RPATH ${SUITESPARSE_FULL_LIBDIR} ) + list ( APPEND CMAKE_BUILD_RPATH ${SUITESPARSE_LIBDIR} ) +else ( ) + # Set reasonable RPATH for installed binaries + # That should be fine as long as DESTDIR isn't set when installing. + list ( FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES ${SUITESPARSE_FULL_LIBDIR} _idx ) + if ( _idx LESS 0 ) + # installation is not to a system prefix + list ( FIND CMAKE_INSTALL_RPATH ${SUITESPARSE_FULL_LIBDIR} _idx ) + if ( _idx LESS 0 ) + # RPATH is not yet included in CMAKE_INSTALL_RPATH + list ( APPEND CMAKE_INSTALL_RPATH ${SUITESPARSE_FULL_LIBDIR} ) + endif ( ) + endif ( ) endif ( ) set ( SUITESPARSE_PKGFILEDIR ${SUITESPARSE_LIBDIR} CACHE STRING From 8fd3395e01e538c176f6b36fb6bca74ede998c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 13 Dec 2023 21:02:07 +0100 Subject: [PATCH 2/4] Don't add CMAKE_BINARY_DIR to CMAKE_BUILD_RPATH more than once. --- GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake | 6 +++++- LAGraph/cmake_modules/SuiteSparsePolicy.cmake | 6 +++++- SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake b/GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake index d22fb11e1..375b849d5 100644 --- a/GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake +++ b/GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake @@ -153,7 +153,11 @@ 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} ) +list ( FIND CMAKE_BUILD_RPATH ${CMAKE_BINARY_DIR} _idx ) +if ( _idx LESS 0 ) + # not yet included in CMAKE_INSTALL_RPATH + list ( APPEND CMAKE_BUILD_RPATH ${CMAKE_BINARY_DIR} ) +endif ( ) set ( INSIDE_SUITESPARSE OFF ) if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) diff --git a/LAGraph/cmake_modules/SuiteSparsePolicy.cmake b/LAGraph/cmake_modules/SuiteSparsePolicy.cmake index d22fb11e1..375b849d5 100644 --- a/LAGraph/cmake_modules/SuiteSparsePolicy.cmake +++ b/LAGraph/cmake_modules/SuiteSparsePolicy.cmake @@ -153,7 +153,11 @@ 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} ) +list ( FIND CMAKE_BUILD_RPATH ${CMAKE_BINARY_DIR} _idx ) +if ( _idx LESS 0 ) + # not yet included in CMAKE_INSTALL_RPATH + list ( APPEND CMAKE_BUILD_RPATH ${CMAKE_BINARY_DIR} ) +endif ( ) set ( INSIDE_SUITESPARSE OFF ) if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) diff --git a/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake b/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake index d22fb11e1..375b849d5 100644 --- a/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake +++ b/SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake @@ -153,7 +153,11 @@ 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} ) +list ( FIND CMAKE_BUILD_RPATH ${CMAKE_BINARY_DIR} _idx ) +if ( _idx LESS 0 ) + # not yet included in CMAKE_INSTALL_RPATH + list ( APPEND CMAKE_BUILD_RPATH ${CMAKE_BINARY_DIR} ) +endif ( ) set ( INSIDE_SUITESPARSE OFF ) if ( NOT SUITESPARSE_ROOT_CMAKELISTS ) From fbe99823fee32b3a5e56a8939cb065ce6ddb1ab0 Mon Sep 17 00:00:00 2001 From: Tim Davis Date: Wed, 13 Dec 2023 16:35:12 -0600 Subject: [PATCH 3/4] cleanup comments --- LAGraph/src/algorithm/LG_CC_FastSV6.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/LAGraph/src/algorithm/LG_CC_FastSV6.c b/LAGraph/src/algorithm/LG_CC_FastSV6.c index 6595fe2ee..24b900141 100644 --- a/LAGraph/src/algorithm/LG_CC_FastSV6.c +++ b/LAGraph/src/algorithm/LG_CC_FastSV6.c @@ -556,7 +556,6 @@ int LG_CC_FastSV6 // SuiteSparse:GraphBLAS method, with GxB extensions bool T_jumbled, T_iso ; GRB_TRY (GxB_Matrix_unpack_CSR (T, &Tp, &Tj, &Tx, &Tp_size, &Tj_size, &Tx_size, &T_iso, &T_jumbled, NULL)) ; -// printf ("did unpack T\n") ; fflush (stdout) ; fflush (stderr) ; #pragma omp parallel for num_threads(nthreads) schedule(static) for (tid = 0 ; tid < nthreads ; tid++) { @@ -601,33 +600,15 @@ int LG_CC_FastSV6 // SuiteSparse:GraphBLAS method, with GxB extensions count [tid] = p - Tp [range [tid]] ; } -// printf ("did prune T\n") ; fflush (stdout) ; fflush (stderr) ; - // Compact empty space out of Tj not filled in from the above phase. nvals = 0 ; for (tid = 0 ; tid < nthreads ; tid++) { - // `memcpy` is not safe if src/dest are overlapping. - // Use `memmove` (or if available `memmove_s`) instead. - -// #if defined (__STDC_LIB_EXT1__) -// memmove_s (Tj + nvals, Tj_size - sizeof (GrB_Index) * nvals, -// Tj + Tp [range [tid]], sizeof (GrB_Index) * count [tid]) ; -// #else - - // memmove is safe: src/dest can overlap, but the copy will not go - // outside of the array, and Tj is never NULL at this point - // (GRB_TRY on the GxB_Matrix_unpack_CSR above would catch that - // condition). So memmove_s isn't necessary. memmove (Tj + nvals, Tj + Tp [range [tid]], sizeof (GrB_Index) * count [tid]) ; - -// #endif - nvals += count [tid] ; count [tid] = nvals - count [tid] ; } -// printf ("did compact T\n") ; fflush (stdout) ; fflush (stderr) ; // Compact empty space out of Tp #pragma omp parallel for num_threads(nthreads) schedule(static) @@ -640,8 +621,6 @@ int LG_CC_FastSV6 // SuiteSparse:GraphBLAS method, with GxB extensions } } -// printf ("did 2nd compact T\n") ; fflush (stdout) ; fflush (stderr) ; - // finalize T Tp [n] = nvals ; @@ -649,14 +628,10 @@ int LG_CC_FastSV6 // SuiteSparse:GraphBLAS method, with GxB extensions GRB_TRY (GxB_Matrix_pack_CSR (T, &Tp, &Tj, &Tx, Tp_size, Tj_size, Tx_size, T_iso, /* T is now jumbled */ true, NULL)) ; -// printf ("did pack T\n") ; fflush (stdout) ; fflush (stderr) ; - // pack A (unchanged since last unpack); this is the original G->A. GRB_TRY (GxB_Matrix_pack_CSR (A, &Ap, &Aj, &Ax, Ap_size, Aj_size, Ax_size, A_iso, A_jumbled, NULL)) ; -// printf ("did pack A\n") ; fflush (stdout) ; fflush (stderr) ; - // ]. The unpack/pack of A into Ap, Aj, Ax will not be needed, and G->A // will become truly a read-only matrix. From cc56b1b40468cbec5bf1fa584a85ed5b2ef5492e Mon Sep 17 00:00:00 2001 From: Tim Davis Date: Thu, 14 Dec 2023 08:15:51 -0600 Subject: [PATCH 4/4] macos: check time now 40 minutes --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cc761cbca..ca61e769a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -295,7 +295,7 @@ jobs: done - name: check - timeout-minutes: 20 + timeout-minutes: 40 run: | IFS=':' read -r -a libs <<< "${CHECK_LIBS}" for lib in "${libs[@]}"; do