diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26fa99157e..f1562e1b0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: LAGraph CI +name: LAGraph CI with Builtin GraphBLAS on: workflow_dispatch: @@ -13,38 +13,34 @@ jobs: strategy: matrix: config: - - {grb_version: 7.1.0, conda_grb_package_hash: h27087fc, conda_extension: tar.bz2} - - {grb_version: 7.3.0, conda_grb_package_hash: h27087fc, conda_extension: tar.bz2} - - {grb_version: 7.4.1, conda_grb_package_hash: hcb278e6, conda_extension: conda} + # if there are multiple items in this list, only use should + # deployit=true for just one of them. + - {grb_version: 9.3.1, deployit: true} steps: - name: Checkout uses: actions/checkout@v2.0.0 - name: Install tools for build run: | sudo apt install -y lcov - - name: Get GraphBLAS binaries + - name: Build GraphBLAS run: | - mkdir graphblas-binaries - cd graphblas-binaries - wget --quiet https://anaconda.org/conda-forge/graphblas/${{ matrix.config.grb_version }}/download/linux-64/graphblas-${{ matrix.config.grb_version }}-${{ matrix.config.conda_grb_package_hash }}_0.${{ matrix.config.conda_extension }} - if [ ${{ matrix.config.conda_extension }} == "tar.bz2" ]; then - tar xf graphblas-${{ matrix.config.grb_version }}-${{ matrix.config.conda_grb_package_hash }}_0.${{ matrix.config.conda_extension }} - else - unzip graphblas-${{ matrix.config.grb_version }}-${{ matrix.config.conda_grb_package_hash }}_0.${{ matrix.config.conda_extension }} - tar xf pkg-graphblas-${{ matrix.config.grb_version }}-${{ matrix.config.conda_grb_package_hash }}_0.tar.zst - fi + git clone https://github.com/DrTimothyAldenDavis/GraphBLAS.git + cd GraphBLAS + git checkout tags/v${{ matrix.config.grb_version }} + make compact + sudo make install cd .. - name: Build project run: | - export GRAPHBLAS_INCLUDE_DIR=`pwd`/graphblas-binaries/include - export GRAPHBLAS_LIBRARY=`pwd`/graphblas-binaries/lib/libgraphblas.so + export GRAPHBLAS_INCLUDE_DIR=`pwd`/GraphBLAS/include/suitesparse + export GRAPHBLAS_LIBRARY=`pwd`/GraphBLAS/lib/libgraphblas.so cd build cmake .. -DCOVERAGE=1 -DGRAPHBLAS_INCLUDE_DIR=${GRAPHBLAS_INCLUDE_DIR} -DGRAPHBLAS_LIBRARY=${GRAPHBLAS_LIBRARY} JOBS=2 make make test_coverage - name: Deploy uses: JamesIves/github-pages-deploy-action@4.1.1 - if: matrix.config.grb_version == '7.4.1' && github.event_name == 'push' && github.ref == 'refs/heads/stable' + if: matrix.config.deployit && github.event_name == 'push' && github.ref == 'refs/heads/stable' with: branch: gh-pages folder: build/test_coverage/ @@ -59,9 +55,7 @@ jobs: strategy: matrix: config: - - {grb_version: 7.1.0, conda_grb_package_hash: h7881ed4, conda_extension: tar.bz2} - - {grb_version: 7.3.0, conda_grb_package_hash: ha894c9a, conda_extension: tar.bz2} - - {grb_version: 7.4.1, conda_grb_package_hash: ha894c9a, conda_extension: conda} + - {grb_version: 9.3.1} steps: - name: Checkout uses: actions/checkout@v2.0.0 @@ -70,22 +64,18 @@ jobs: brew tap-new libomp/cask brew extract --version=14.0.6 libomp libomp/cask brew install libomp@14.0.6 - - name: Get GraphBLAS binaries + - name: Build GraphBLAS run: | - mkdir graphblas-binaries - cd graphblas-binaries - wget --quiet https://anaconda.org/conda-forge/graphblas/${{ matrix.config.grb_version }}/download/osx-64/graphblas-${{ matrix.config.grb_version }}-${{ matrix.config.conda_grb_package_hash }}_0.${{ matrix.config.conda_extension }} - if [ ${{ matrix.config.conda_extension }} == "tar.bz2" ]; then - tar xf graphblas-${{ matrix.config.grb_version }}-${{ matrix.config.conda_grb_package_hash }}_0.${{ matrix.config.conda_extension }} - else - unzip graphblas-${{ matrix.config.grb_version }}-${{ matrix.config.conda_grb_package_hash }}_0.${{ matrix.config.conda_extension }} - tar xf pkg-graphblas-${{ matrix.config.grb_version }}-${{ matrix.config.conda_grb_package_hash }}_0.tar.zst - fi + git clone https://github.com/DrTimothyAldenDavis/GraphBLAS.git + cd GraphBLAS + git checkout tags/v${{ matrix.config.grb_version }} + make compact + sudo make install cd .. - name: Build project run: | - export GRAPHBLAS_INCLUDE_DIR=`pwd`/graphblas-binaries/include - export GRAPHBLAS_LIBRARY=`pwd`/graphblas-binaries/lib/libgraphblas.dylib + export GRAPHBLAS_INCLUDE_DIR=`pwd`/GraphBLAS/include/suitesparse + export GRAPHBLAS_LIBRARY=`pwd`/GraphBLAS/lib/libgraphblas.dylib # adding an extra line to the CMakeLists.txt file to locate the libomp instance installed by brew echo 'include_directories("/usr/local/opt/libomp/include")' | cat - CMakeLists.txt cd build diff --git a/CMakeLists.txt b/CMakeLists.txt index c62160797c..90a9350697 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,10 +39,10 @@ cmake_minimum_required ( VERSION 3.20 ) # LAGraph can be built stand-alone # version of LAGraph -set ( LAGraph_DATE "Jan 20, 2024" ) +set ( LAGraph_DATE "Aug 20, 2024" ) set ( LAGraph_VERSION_MAJOR 1 CACHE STRING "" FORCE ) set ( LAGraph_VERSION_MINOR 1 CACHE STRING "" FORCE ) -set ( LAGraph_VERSION_SUB 2 CACHE STRING "" FORCE ) +set ( LAGraph_VERSION_SUB 4 CACHE STRING "" FORCE ) message ( STATUS "Building LAGraph version: v" ${LAGraph_VERSION_MAJOR}. @@ -247,13 +247,13 @@ elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "Intel" ) #if ( CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0 ) # message ( FATAL_ERROR "icc version must be at least 18.0" ) #endif ( ) -elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" ) +elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" AND NOT "${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC" ) # options for clang set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 " ) #if ( CMAKE_C_COMPILER_VERSION VERSION_LESS 3.3 ) # message ( FATAL_ERROR "clang version must be at least 3.3" ) #endif ( ) -elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC" ) +elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC" ) # options for MicroSoft Visual Studio elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "PGI" ) # options for PGI pgcc compiler diff --git a/ChangeLog b/ChangeLog index f7a0f454a3..758ed824e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Aug 20, 2024: version 1.1.4 + + * fix MMWrite when matrix is dense + +Mar 22, 2024: version 1.1.3 + + * minor updates to build system + Jan 20, 2024: version 1.1.2 * minor update to build system diff --git a/data/comments_full.mtx b/data/comments_full.mtx index 430b7756bb..097bb7a77a 100644 --- a/data/comments_full.mtx +++ b/data/comments_full.mtx @@ -2,7 +2,7 @@ %%GraphBLAS type double % comments for full.mtx % this file was created by test_MMRead.c -3 3 9 +3 3 .646 .709 .754 diff --git a/experimental/CMakeLists.txt b/experimental/CMakeLists.txt index 2caaa1c6d9..217abb9b92 100644 --- a/experimental/CMakeLists.txt +++ b/experimental/CMakeLists.txt @@ -61,7 +61,7 @@ if ( BUILD_STATIC_LIBS ) C_STANDARD 11 PUBLIC_HEADER "include/LAGraphX.h" ) - if ( MSVC ) + if ( MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC") ) set_target_properties ( LAGraphX_static PROPERTIES OUTPUT_NAME lagraphx_static ) endif ( ) diff --git a/experimental/test/CMakeLists.txt b/experimental/test/CMakeLists.txt index 3f72d74b9e..0df29008ae 100644 --- a/experimental/test/CMakeLists.txt +++ b/experimental/test/CMakeLists.txt @@ -62,7 +62,7 @@ if ( BUILD_STATIC_LIBS ) C_STANDARD_REQUIRED ON C_STANDARD 11 ) - if ( MSVC ) + if ( MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC") ) set_target_properties ( lagraphxtest_static PROPERTIES OUTPUT_NAME lagraphxtest_static ) endif ( ) diff --git a/include/LAGraph.h b/include/LAGraph.h index 6eed809cb9..8357c8bdb5 100644 --- a/include/LAGraph.h +++ b/include/LAGraph.h @@ -37,10 +37,10 @@ // See also the LAGraph_Version utility method, which returns these values. // These definitions are derived from LAGraph/CMakeLists.txt. -#define LAGRAPH_DATE "Jan 20, 2024" +#define LAGRAPH_DATE "Aug 20, 2024" #define LAGRAPH_VERSION_MAJOR 1 #define LAGRAPH_VERSION_MINOR 1 -#define LAGRAPH_VERSION_UPDATE 2 +#define LAGRAPH_VERSION_UPDATE 4 //============================================================================== // include files and helper macros diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 09177c73ee..451f0bd2ba 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -63,7 +63,7 @@ if ( BUILD_STATIC_LIBS ) C_STANDARD 11 PUBLIC_HEADER "include/LAGraph.h" ) - if ( MSVC ) + if ( MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC") ) set_target_properties ( LAGraph_static PROPERTIES OUTPUT_NAME lagraph_static ) endif ( ) diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 37e56418ae..db36bd3581 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -64,7 +64,7 @@ if ( BUILD_STATIC_LIBS ) C_STANDARD_REQUIRED ON C_STANDARD 11 ) - if ( MSVC ) + if ( MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC") ) set_target_properties ( lagraphtest_static PROPERTIES OUTPUT_NAME lagraphtest_static ) endif ( ) diff --git a/src/utility/LAGraph_MMWrite.c b/src/utility/LAGraph_MMWrite.c index 51bd5841c2..4c4c8828f9 100644 --- a/src/utility/LAGraph_MMWrite.c +++ b/src/utility/LAGraph_MMWrite.c @@ -459,8 +459,18 @@ int LAGraph_MMWrite nvals_to_print = nself_edges + (nvals - nself_edges) / 2 ; } - FPRINTF (f, "%" PRIu64 " %" PRIu64 " %" PRIu64 "\n", - nrows, ncols, nvals_to_print) ; + if (MM_fmt == MM_array) + { + // write `nrows ncols` if the array format is used + FPRINTF (f, "%" PRIu64 " %" PRIu64 "\n", + nrows, ncols) ; + } + else + { + // otherwise write `nrows ncols nvals` for the coordinate format + FPRINTF (f, "%" PRIu64 " %" PRIu64 " %" PRIu64 "\n", + nrows, ncols, nvals_to_print) ; + } if (nvals_to_print == 0) {