-
Notifications
You must be signed in to change notification settings - Fork 84
V1.2.2 branch #414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V1.2.2 branch #414
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,13 +36,13 @@ | |
| # get the version | ||
| #------------------------------------------------------------------------------- | ||
|
|
||
| cmake_minimum_required ( VERSION 3.20 ) # LAGraph can be built stand-alone | ||
| cmake_minimum_required ( VERSION 3.23 ) | ||
|
|
||
| # version of LAGraph | ||
| set ( LAGraph_DATE "Sept 8, 2025" ) | ||
| set ( LAGraph_DATE "July 21, 2026" ) | ||
| set ( LAGraph_VERSION_MAJOR 1 CACHE STRING "" FORCE ) | ||
| set ( LAGraph_VERSION_MINOR 2 CACHE STRING "" FORCE ) | ||
| set ( LAGraph_VERSION_SUB 1 CACHE STRING "" FORCE ) | ||
| set ( LAGraph_VERSION_SUB 2 CACHE STRING "" FORCE ) | ||
|
|
||
| message ( STATUS "Building LAGraph version: v" | ||
| ${LAGraph_VERSION_MAJOR}. | ||
|
|
@@ -70,6 +70,17 @@ include ( SuiteSparsePolicy ) | |
|
|
||
| enable_language ( C ) | ||
|
|
||
| # check if stdalign.h exists | ||
| include ( CheckIncludeFile ) | ||
| check_include_file ( stdalign.h HAVE_STDALIGN_H ) | ||
| if ( HAVE_STDALIGN_H ) | ||
| set ( LAGraph_HAS_STDALIGN_H 1 ) | ||
| message ( STATUS "stdalign.h is available" ) | ||
| else ( ) | ||
| message ( STATUS "stdalign.h is not available" ) | ||
| set ( LAGraph_HAS_STDALIGN_H 0 ) | ||
| endif ( ) | ||
|
|
||
| # configure LAGraph.h with the LAGraph date and version | ||
| configure_file ( | ||
| "Config/LAGraph.h.in" | ||
|
|
@@ -152,8 +163,7 @@ else ( ) | |
| # 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. | ||
| # library can have any version number. | ||
| message ( STATUS "Looking for GraphBLAS with FindGraphBLAS.cmake" ) | ||
| find_package ( GraphBLAS MODULE REQUIRED ) | ||
|
|
||
|
|
@@ -375,6 +385,25 @@ else ( ) | |
| endif ( ) | ||
| endif ( ) | ||
|
|
||
| if ( GRAPHBLAS_VERSION ) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a fix for a very strange problem I had in GraphBLAS 10.3.2. In v10.3.1, I had 3 cmake variables, GraphBLAS_VERSION_MAJOR, *_MINOR, and *_SUB. They worked just fine, and were held in the cmake cache. Then in going to 10.3.2, the _MAJOR and _MINOR variables got "lots". They appear in the cache but are empty when used in cmake. I "fixed" it by renaming them GraphBLAS_VER_MAJOR, etc. It might be that an update to cmake causes the non-cached variables GRAPHBLAS_VERSION_MAJOR etc to clash with the cached GraphBLAS_VERSION_MAJOR variables (note the lower vs upper case). I fixed the issue in GraphBLAS but then this cmake code in LAGraph could no longer detect the right GraphBLAS version to configure its FindGraphBLAS.cmake script. It does have GRAPHBLAS_VERSION so I've added this cmake script to parse out the 3 major, minor, and update components. This script now works. |
||
| if ( ${GRAPHBLAS_VERSION} MATCHES "([0-9]+).[0-9]+.[0-9]+" ) | ||
| set ( GraphBLAS_VER_MAJOR ${CMAKE_MATCH_1} ) | ||
| endif ( ) | ||
| if ( ${GRAPHBLAS_VERSION} MATCHES "[0-9]+.([0-9]+).[0-9]+" ) | ||
| set ( GraphBLAS_VER_MINOR ${CMAKE_MATCH_1} ) | ||
| endif ( ) | ||
| if ( ${GRAPHBLAS_VERSION} MATCHES "[0-9]+.[0-9]+.([0-9]+)" ) | ||
| set ( GraphBLAS_VER_PATCH ${CMAKE_MATCH_1} ) | ||
| endif ( ) | ||
| if ( LAGRAPH_DUMP ) | ||
| message ( STATUS "major: ${GraphBLAS_VER_MAJOR}" ) | ||
| message ( STATUS "minor: ${GraphBLAS_VER_MINOR}" ) | ||
| message ( STATUS "patch: ${GraphBLAS_VER_PATCH}" ) | ||
| endif ( ) | ||
| endif ( ) | ||
|
|
||
| message (STATUS "Config with GraphBLAS version ${GraphBLAS_VER_MAJOR}.${GraphBLAS_VER_MINOR}.${GraphBLAS_VER_PATCH}" ) | ||
|
|
||
| # generate config file to be used in common build tree | ||
| set ( SUITESPARSE_IN_BUILD_TREE ON ) | ||
| configure_package_config_file ( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ | |
| #define LAGRAPH_VERSION_MAJOR @LAGraph_VERSION_MAJOR@ | ||
| #define LAGRAPH_VERSION_MINOR @LAGraph_VERSION_MINOR@ | ||
| #define LAGRAPH_VERSION_UPDATE @LAGraph_VERSION_SUB@ | ||
| #define LAGRAPH_HAS_STDALIGN_H @LAGraph_HAS_STDALIGN_H@ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MSVC is a pathetic compiler. It claims to be C11 compliant but it does not have stdalign.h. I thus check for it in the cmake script and configure LAGraph accordingly. |
||
|
|
||
| //============================================================================== | ||
| // include files and helper macros | ||
|
|
@@ -104,8 +105,8 @@ | |
|
|
||
| #if ( !LAGRAPH_VANILLA ) && defined ( GxB_SUITESPARSE_GRAPHBLAS ) | ||
| // use SuiteSparse, and its GxB* extensions | ||
| #if GxB_IMPLEMENTATION < GxB_VERSION (9,0,0) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LAGraph no longer works with GraphBLAS 9.0.0 so I took this out. |
||
| #error "If using SuiteSparse::GraphBLAS, version 9.0.0 or later is required" | ||
| #if GxB_IMPLEMENTATION < GxB_VERSION (10,0,0) | ||
| #error "SuiteSparse::GraphBLAS v10.0.0 or later is required" | ||
| #endif | ||
| #define LAGRAPH_SUITESPARSE 1 | ||
| #else | ||
|
|
@@ -2410,11 +2411,11 @@ int LAGr_SingleSourceShortestPath | |
| ) ; | ||
|
|
||
| //------------------------------------------------------------------------------ | ||
| // LAGr_Betweenness: betweeness centrality metric | ||
| // LAGr_Betweenness: betweenness centrality metric | ||
| //------------------------------------------------------------------------------ | ||
|
|
||
| /** LAGr_Betweenness: betweeness centrality metric. This methods computes an | ||
| * approximation of the betweeness-centrality metric of all nodes in the graph. | ||
| /** LAGr_Betweenness: betweenness centrality metric. This methods computes an | ||
| * approximation of the betweenness-centrality metric of all nodes in the graph. | ||
| * Only a few given source nodes are used for the approximation. This is an | ||
| * Advanced algorithm (G->AT is required). | ||
| * | ||
|
|
@@ -2442,7 +2443,7 @@ LAGRAPH_PUBLIC | |
| int LAGr_Betweenness | ||
| ( | ||
| // output: | ||
| GrB_Vector *centrality, // centrality(i): betweeness centrality of i | ||
| GrB_Vector *centrality, // centrality(i): betweenness centrality of i | ||
| // input: | ||
| const LAGraph_Graph G, // input graph | ||
| const GrB_Index *sources, // source vertices to compute shortest paths | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -271,18 +271,18 @@ string ( | |
|
|
||
| if ( GRAPHBLAS_VERSION ) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comments below about why I needed to fix this to detect the GraphBLAS version correctly. |
||
| if ( ${GRAPHBLAS_VERSION} MATCHES "([0-9]+).[0-9]+.[0-9]+" ) | ||
| set ( GraphBLAS_VERSION_MAJOR ${CMAKE_MATCH_1} ) | ||
| set ( GraphBLAS_VER_MAJOR ${CMAKE_MATCH_1} ) | ||
| endif ( ) | ||
| if ( ${GRAPHBLAS_VERSION} MATCHES "[0-9]+.([0-9]+).[0-9]+" ) | ||
| set ( GraphBLAS_VERSION_MINOR ${CMAKE_MATCH_1} ) | ||
| set ( GraphBLAS_VER_MINOR ${CMAKE_MATCH_1} ) | ||
| endif ( ) | ||
| if ( ${GRAPHBLAS_VERSION} MATCHES "[0-9]+.[0-9]+.([0-9]+)" ) | ||
| set ( GraphBLAS_VERSION_PATCH ${CMAKE_MATCH_1} ) | ||
| set ( GraphBLAS_VER_PATCH ${CMAKE_MATCH_1} ) | ||
| endif ( ) | ||
| if ( LAGRAPH_DUMP ) | ||
| message ( STATUS "major: ${GraphBLAS_VERSION_MAJOR}" ) | ||
| message ( STATUS "minor: ${GraphBLAS_VERSION_MINOR}" ) | ||
| message ( STATUS "patch: ${GraphBLAS_VERSION_PATCH}" ) | ||
| message ( STATUS "major: ${GraphBLAS_VER_MAJOR}" ) | ||
| message ( STATUS "minor: ${GraphBLAS_VER_MINOR}" ) | ||
| message ( STATUS "patch: ${GraphBLAS_VER_PATCH}" ) | ||
| endif ( ) | ||
| endif ( ) | ||
|
|
||
|
|
@@ -300,10 +300,10 @@ if ( EXISTS "${GRAPHBLAS_INCLUDE_DIR}" AND NOT GRAPHBLAS_VERSION ) | |
| message ( STATUS "minor: ${GRAPHBLAS_MINOR_STR}" ) | ||
| message ( STATUS "patch: ${GRAPHBLAS_PATCH_STR}" ) | ||
| endif ( ) | ||
| 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}") | ||
| string ( REGEX MATCH "[0-9]+" GraphBLAS_VER_MAJOR ${GRAPHBLAS_MAJOR_STR} ) | ||
| string ( REGEX MATCH "[0-9]+" GraphBLAS_VER_MINOR ${GRAPHBLAS_MINOR_STR} ) | ||
| string ( REGEX MATCH "[0-9]+" GraphBLAS_VER_PATCH ${GRAPHBLAS_PATCH_STR} ) | ||
| set (GRAPHBLAS_VERSION "${GraphBLAS_VER_MAJOR}.${GraphBLAS_VER_MINOR}.${GraphBLAS_VER_PATCH}") | ||
| endif ( ) | ||
|
|
||
| set ( GRAPHBLAS_LIBRARIES ${GRAPHBLAS_LIBRARY} ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,10 +35,10 @@ | |
| # GraphBLAS is false. | ||
| # | ||
| # SUITESPARSE_CUDA_ARCHITECTURES: a string, such as "all" or | ||
| # "35;50;75;80" that lists the CUDA architectures to use | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change to SuiteSparsePolicy.cmake has no effect on LAGraph at all, but I've included it to sync it with my upcoming release of SuiteSparse 7.12.3, which will include LAGraph v1.2.2. |
||
| # "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". | ||
| # Default: "all". | ||
| # | ||
| # BLA_VENDOR and BLA_SIZEOF_INTEGER: By default, SuiteSparse searches for | ||
| # the BLAS library in a specific order. If you wish to | ||
|
|
@@ -310,24 +310,19 @@ if ( SUITESPARSE_USE_FORTRAN ) | |
| set ( SUITESPARSE_HAS_FORTRAN ON ) | ||
| if ( NOT "${CMAKE_Fortran_COMPILER_ID}" STREQUAL "${CMAKE_C_COMPILER_ID}" OR | ||
| NOT "${CMAKE_Fortran_COMPILER_ID}" STREQUAL "${CMAKE_CXX_COMPILER_ID}" ) | ||
| message ( STATUS " " ) | ||
| message ( STATUS "Incompatible Fortran/C/C++ compilers detected:" ) | ||
| message ( STATUS " Fortran: ${CMAKE_Fortran_COMPILER}" ) | ||
| message ( STATUS " Fortran id: ${CMAKE_Fortran_COMPILER_ID}" ) | ||
| message ( STATUS " C ${CMAKE_C_COMPILER}" ) | ||
| message ( STATUS " C id: ${CMAKE_C_COMPILER_ID}" ) | ||
| message ( STATUS " C++ ${CMAKE_CXX_COMPILER}" ) | ||
| message ( STATUS " C++ id: ${CMAKE_CXX_COMPILER_ID}" ) | ||
| if ( "${CMAKE_C_COMPILER_ID}" STREQUAL "IntelLLVM" ) | ||
| message ( STATUS " " ) | ||
| message ( STATUS "Incompatible Fortran/C/C++ compilers detected:" ) | ||
| message ( STATUS " Fortran: ${CMAKE_Fortran_COMPILER}" ) | ||
| message ( STATUS " Fortran id: ${CMAKE_Fortran_COMPILER_ID}" ) | ||
| message ( STATUS " C ${CMAKE_C_COMPILER}" ) | ||
| message ( STATUS " C id: ${CMAKE_C_COMPILER_ID}" ) | ||
| message ( STATUS " C++ ${CMAKE_CXX_COMPILER}" ) | ||
| message ( STATUS " C++ id: ${CMAKE_CXX_COMPILER_ID}" ) | ||
| # icx/icpx cannot be used with gfortran: this is a fatal error | ||
| message ( FATAL_ERROR "ERROR: Using Fortran with SuiteSparse requires that " | ||
| " it has the same compiler ID as the C/C++ compilers." | ||
| " Use a compatible Fortran compiler, or set SUITESPARSE_USE_FORTRAN to OFF." ) | ||
| else ( ) | ||
| # other cases: just issue a warning and hope it works. | ||
| message ( WARNING "Warning: Using Fortran with SuiteSparse requires that " | ||
| " it has the same compiler ID as the C/C++ compilers." | ||
| " Use a compatible Fortran compiler, or set SUITESPARSE_USE_FORTRAN to OFF." ) | ||
| endif ( ) | ||
| endif ( ) | ||
| message ( STATUS "Fortran: enabled" ) | ||
|
|
@@ -401,7 +396,7 @@ endif ( ) | |
|
|
||
| if ( SUITESPARSE_HAS_CUDA ) | ||
| message ( STATUS "CUDA: enabled" ) | ||
| set ( SUITESPARSE_CUDA_ARCHITECTURES "52;75;80" CACHE STRING "CUDA architectures" ) | ||
| set ( SUITESPARSE_CUDA_ARCHITECTURES "all" CACHE STRING "CUDA architectures" ) | ||
| set ( CMAKE_CUDA_ARCHITECTURES ${SUITESPARSE_CUDA_ARCHITECTURES} ) | ||
| else ( ) | ||
| message ( STATUS "CUDA: not enabled" ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,7 +73,13 @@ | |
|
|
||
| #include <LAGraph.h> | ||
| #include <LAGraphX.h> | ||
| #include <stdalign.h> | ||
| #if LAGRAPH_HAS_STDALIGN_H | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comments about about the miserable MSVC compiler's claim to C11 compliance while not actualy being C11 compliant by not providing a stdalign.h.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I understand correctly, According to its documentation, MSVC understands the C11 keyword
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nevermind, Which version of MSVC is this fix for?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure. It's from an issue raised here: The use of stdalign.h is very minor in LAGraph, so I just disabled its use if stdalign.h is not available.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm... I'm not sure with which compiler that user was seeing that problem. They don't seem to have given any hints about that. Maybe, whichever compiler and which version of it they used, it defaulted to C23. And since in that version of C, If that is the actual problem, it might be better to check in the test whether using
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. I'll tag this as a new issue. |
||
| #include <stdalign.h> | ||
| #define ALIGNAS_64 alignas(64) | ||
| #else | ||
| // the alignas keyword/macro is not available | ||
| #define ALIGNAS_64 | ||
| #endif | ||
| #include "LG_internal.h" | ||
|
|
||
| // A Go-style slice / Lisp-style property list | ||
|
|
@@ -141,7 +147,7 @@ void counts_reducer(GrB_Index* e1, GrB_Index* c1, GrB_Index e2, GrB_Index c2) { | |
| #define bucket_shift (64llu - bucket_bits) | ||
|
|
||
| typedef struct { | ||
| alignas(64) plist buckets[nof_buckets]; | ||
| ALIGNAS_64 plist buckets[nof_buckets]; | ||
| } ptable; | ||
|
|
||
| void ptable_free(ptable* table) { | ||
|
|
@@ -187,6 +193,7 @@ void ptable_reduce(ptable* table, GrB_Index* entry, GrB_Index* count, plist_redu | |
| } | ||
|
|
||
| //**************************************************************************** | ||
|
|
||
| int LAGraph_cdlp | ||
| ( | ||
| GrB_Vector *CDLP_handle, // output vector | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmake 3.23 is now common. It's also required for the changes in SuiteSparsePolicy.cmake.