Skip to content

Commit

Permalink
Merge branch 'GraphBLAS:stable' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
GomezGab authored Sep 13, 2024
2 parents 1f63783 + cc56ed4 commit b928465
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 48 deletions.
54 changes: 22 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: LAGraph CI
name: LAGraph CI with Builtin GraphBLAS

on:
workflow_dispatch:
Expand All @@ -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/[email protected]
- 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/[email protected]
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/
Expand All @@ -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/[email protected]
Expand All @@ -70,22 +64,18 @@ jobs:
brew tap-new libomp/cask
brew extract --version=14.0.6 libomp libomp/cask
brew install [email protected]
- 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
Expand Down
5 changes: 5 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

version: 2

build:
os: ubuntu-22.04
tools:
python: "3.12"

formats:
- pdf

Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion data/comments_full.mtx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion experimental/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ( )
Expand Down
2 changes: 1 addition & 1 deletion experimental/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ( )
Expand Down
4 changes: 2 additions & 2 deletions include/LAGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions rtdocs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx==4.0.3
sphinx_rtd_theme>=0.5.2
breathe
sphinx
sphinx_rtd_theme
breathe
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ( )
Expand Down
2 changes: 1 addition & 1 deletion src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ( )
Expand Down
14 changes: 12 additions & 2 deletions src/utility/LAGraph_MMWrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit b928465

Please sign in to comment.