Skip to content

Commit

Permalink
Merge pull request #148 from GraphBLAS/dev
Browse files Browse the repository at this point in the history
LAGraph v1.0.1
  • Loading branch information
DrTimothyAldenDavis authored Jan 13, 2023
2 parents 81a0a77 + d79e67e commit 0c84c41
Show file tree
Hide file tree
Showing 205 changed files with 2,160 additions and 985 deletions.
17 changes: 11 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
# LAGraph/CMakeLists.txt: cmake script for LAGraph
#-------------------------------------------------------------------------------

# LAGraph, (c) 2021 by The LAGraph Contributors, All Rights Reserved.
# LAGraph, (c) 2019-2022 by The LAGraph Contributors, All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause
# See additional acknowledgments in the LICENSE file,
# or contact permission@sei.cmu.edu for the full terms.
#
# For additional details (including references to third party source code and
# other files) see the LICENSE file or contact permission@sei.cmu.edu. See
# Contributors.txt for a full list of contributors. Created, in part, with
# funding and support from the U.S. Government (see Acknowledgments.txt file).
# DM22-0790

#-------------------------------------------------------------------------------

Expand Down Expand Up @@ -45,10 +49,10 @@ cmake_policy ( SET CMP0048 NEW )
set ( CMAKE_MACOSX_RPATH TRUE )

# version of LAGraph
set ( LAGraph_DATE "Sept 20, 2022" )
set ( LAGraph_DATE "Dec 28, 2022" )
set ( LAGraph_VERSION_MAJOR 1 )
set ( LAGraph_VERSION_MINOR 0 )
set ( LAGraph_VERSION_SUB 0 )
set ( LAGraph_VERSION_SUB 1 )

project ( lagraph
VERSION "${LAGraph_VERSION_MAJOR}.${LAGraph_VERSION_MINOR}.${LAGraph_VERSION_SUB}" )
Expand Down Expand Up @@ -112,7 +116,8 @@ endif ( )
# GRAPHBLAS_ROOT=<path> cmake ..
# or uncomment the next line:
# set ( ENV{GRAPHBLAS_ROOT} ${CMAKE_SOURCE_DIR}/../GraphBLAS )
message ( STATUS "GraphBLAS root: " ${GRAPHBLAS_ROOT} )
message ( STATUS "GraphBLAS_ROOT: ${GraphBLAS_ROOT} $ENV{GraphBLAS_ROOT}" )
message ( STATUS "GRAPHBLAS_ROOT: ${GRAPHBLAS_ROOT} $ENV{GRAPHBLAS_ROOT}" )
find_package (GraphBLAS 7.0.1 REQUIRED MODULE)

#-------------------------------------------------------------------------------
Expand Down
134 changes: 134 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@

# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[https://graphblas.org][GraphBLAS.org] by contacting the GraphBLAS Steering Committee.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

3 changes: 1 addition & 2 deletions ContributionInstructions.txt → CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
File: ContributionInstructions.txt:

Thank you for your interest in contributing to the LAGraph project (“We” or
“Us”). By making any Contribution to this project, you agree to the terms
Expand Down Expand Up @@ -95,7 +94,7 @@ necessary permissions to make this Contribution.
(c) The grant of rights under Section 2 does not violate any grant of rights
which You have made to third parties, including Your employer. If You are an
employee, You warrant that Your employer has approved this Agreement. If You are
less than eighteen years old, Uour parent or guardian must sign a printed
less than eighteen years old, Your parent or guardian must sign a printed
version of this Agreement and send it to permission@sei.cmu.edu.

(d) You shall make each Contribution in full compliance with U.S. export control
Expand Down
16 changes: 16 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
Version 1.0.1: Dec 26, 2022

* bug fix: LAGraph_MMWrite incorrectly created a Matrix Market
file with "array pattern" format, which is invalid.
* header updates: with copyright info
* CONTRIBUTING.md: renamed the file
* CODE_OF_CONDUCT.md: added, from https://www.contributor-covenant.org
* FindGraphBLAS.cmake and FindLAGraph.cmake: revised to find both dynamic
and static libraries, and to find the version number from the include
file if it's not present in the filename of the library.
* LAGraph_FastGraphletTransform: now able to compile it when OpenMP
is not available.
* bug fix: LAGRAPH_VANILLA option fixed. Added "make vanilla" to the
Makefile. GxB_*_TypeName methods are required, even for a "vanilla"
GraphBLAS.

Version 1.0.0: Sept 20, 2022

* LAGraph v1.0 released.
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ default: library
library:
( cd build && cmake $(CMAKE_OPTIONS) .. && $(MAKE) --jobs=${JOBS} )

vanilla:
( cd build && cmake $(CMAKE_OPTIONS) -DLAGRAPH_VANILLA=1 .. && $(MAKE) --jobs=${JOBS} )

# compile with -g for debugging
debug:
( cd build && cmake $(CMAKE_OPTIONS) -DCMAKE_BUILD_TYPE=Debug .. && $(MAKE) --jobs=${JOBS} )
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ LAGraph contains the following files and folders:

config: LAGraph.h.in, for constructing include/LAGraph.h

ContributionInstructions.txt: how to contributed to LAGraph
CONTRIBUTING.md: how to contributed to LAGraph

CODE_OF_CONDUCT.md: code of conduct from
https://www.contributor-covenant.org/version/2/1/code_of_conduct.html

Contributors.txt: list of contributors

Expand Down
103 changes: 82 additions & 21 deletions cmake_modules/FindGraphBLAS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
FindGraphBLAS
--------
The following copyright and license applies to just this file only, not to
the GraphBLAS library itself:
LAGraph, (c) 2019-2022 by The LAGraph Contributors, All Rights Reserved.
SPDX-License-Identifier: BSD-2-Clause
See additional acknowledgments in the LICENSE file,
Expand All @@ -23,7 +25,8 @@ This module defines the following variables:
::
GRAPHBLAS_INCLUDE_DIR - where to find GraphBLAS.h, etc.
GRAPHBLAS_LIBRARY - GraphBLAS library
GRAPHBLAS_LIBRARY - dynamic GraphBLAS library
GRAPHBLAS_STATIC - static GraphBLAS library
GRAPHBLAS_LIBRARIES - List of libraries when using GraphBLAS.
GRAPHBLAS_FOUND - True if GraphBLAS found.
Expand All @@ -32,8 +35,8 @@ This module defines the following variables:
Hints
^^^^^
A user may set ``GRAPHBLAS_ROOT`` to a GraphBLAS installation root to tell this
module where to look.
A user may set ``GRAPHBLAS_ROOT`` or ``GraphBLAS_ROOT`` to a GraphBLAS
installation root to tell this module where to look.
Otherwise, the first place searched is in ../GraphBLAS, relative to the LAGraph
source directory. That is, if GraphBLAS and LAGraph reside in the same parent
Expand All @@ -43,44 +46,96 @@ This takes precedence over the system-wide installation of GraphBLAS, which
might be an older version. This method gives the user the ability to compile
LAGraph with their own copy of GraphBLAS, ignoring the system-wide version.
If SuiteSparse:GraphBLAS is the GraphBLAS library being utilized,
all the Find*.cmake files in SuiteSparse are installed by 'make install' into
/usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the
${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands
in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt:
set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse )
#]=======================================================================]

# NB: this is built around assumptions about one particular GraphBLAS
# installation (SuiteSparse:GraphBLAS). As other installations become available
# changes to this will likely be required.

# "Include" for SuiteSparse:GraphBLAS
find_path(
GRAPHBLAS_INCLUDE_DIR
find_path ( GRAPHBLAS_INCLUDE_DIR
NAMES GraphBLAS.h
HINTS ${GRAPHBLAS_ROOT}
HINTS ENV GRAPHBLAS_ROOT
HINTS ${CMAKE_SOURCE_DIR}/..
HINTS ${CMAKE_SOURCE_DIR}/../GraphBLAS
HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/GraphBLAS
PATHS GRAPHBLAS_ROOT ENV GRAPHBLAS_ROOT
PATH_SUFFIXES include Include
)

# "build" for SuiteSparse:GraphBLAS
find_library(
GRAPHBLAS_LIBRARY
# dynamic SuiteSparse:GraphBLAS library
find_library ( GRAPHBLAS_LIBRARY
NAMES graphblas
HINTS ${GRAPHBLAS_ROOT}
HINTS ENV GRAPHBLAS_ROOT
HINTS ${CMAKE_SOURCE_DIR}/..
HINTS ${CMAKE_SOURCE_DIR}/../GraphBLAS
HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/GraphBLAS
PATHS GRAPHBLAS_ROOT ENV GRAPHBLAS_ROOT
PATH_SUFFIXES lib build alternative
)

# get version of .so using REALPATH
get_filename_component(GRAPHBLAS_LIBRARY ${GRAPHBLAS_LIBRARY} REALPATH)
string(
REGEX MATCH "[0-9]+.[0-9]+.[0-9]+"
GRAPHBLAS_VERSION
${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} )
find_library ( GRAPHBLAS_STATIC
NAMES ${STATIC_NAME}
HINTS ${GRAPHBLAS_ROOT}
HINTS ENV GRAPHBLAS_ROOT
HINTS ${CMAKE_SOURCE_DIR}/..
HINTS ${CMAKE_SOURCE_DIR}/../GraphBLAS
HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/GraphBLAS
PATH_SUFFIXES lib build alternative
)
set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} )

# get version of the library from the dynamic library name
get_filename_component ( GRAPHBLAS_LIBRARY ${GRAPHBLAS_LIBRARY} REALPATH )
get_filename_component ( GRAPHBLAS_FILENAME ${GRAPHBLAS_LIBRARY} NAME )
string (
REGEX MATCH "[0-9]+.[0-9]+.[0-9]+"
GRAPHBLAS_VERSION
${GRAPHBLAS_FILENAME}
)
set(GRAPHBLAS_LIBRARIES ${GRAPHBLAS_LIBRARY})

include(FindPackageHandleStandardArgs)
# 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
file ( STRINGS ${GRAPHBLAS_INCLUDE_DIR}/GraphBLAS.h GRAPHBLAS_MAJOR_STR
REGEX "define GxB_IMPLEMENTATION_MAJOR" )
file ( STRINGS ${GRAPHBLAS_INCLUDE_DIR}/GraphBLAS.h GRAPHBLAS_MINOR_STR
REGEX "define GxB_IMPLEMENTATION_MINOR" )
file ( STRINGS ${GRAPHBLAS_INCLUDE_DIR}/GraphBLAS.h GRAPHBLAS_PATCH_STR
REGEX "define GxB_IMPLEMENTATION_SUB" )
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}")
endif ( )

set ( GRAPHBLAS_LIBRARIES ${GRAPHBLAS_LIBRARY} )

include ( FindPackageHandleStandardArgs )

find_package_handle_standard_args(
GraphBLAS
REQUIRED_VARS GRAPHBLAS_LIBRARIES GRAPHBLAS_INCLUDE_DIR
Expand All @@ -90,14 +145,20 @@ find_package_handle_standard_args(
mark_as_advanced(
GRAPHBLAS_INCLUDE_DIR
GRAPHBLAS_LIBRARY
GRAPHBLAS_STATIC
GRAPHBLAS_LIBRARIES
)

if ( GRAPHBLAS_FOUND )
message ( STATUS "GraphBLAS include dir: " ${GRAPHBLAS_INCLUDE_DIR} )
message ( STATUS "GraphBLAS library: " ${GRAPHBLAS_LIBRARY} )
message ( STATUS "GraphBLAS version: " ${GRAPHBLAS_VERSION} )
message ( STATUS "GraphBLAS version: ${GRAPHBLAS_VERSION}" )
message ( STATUS "GraphBLAS include: ${GRAPHBLAS_INCLUDE_DIR}" )
message ( STATUS "GraphBLAS library: ${GRAPHBLAS_LIBRARY}" )
message ( STATUS "GraphBLAS static: ${GRAPHBLAS_STATIC}" )
else ( )
message ( STATUS "GraphBLAS not found" )
set ( GRAPHBLAS_INCLUDE_DIR "" )
set ( GRAPHBLAS_LIBRARIES "" )
set ( GRAPHBLAS_LIBRARY "" )
set ( GRAPHBLAS_STATIC "" )
endif ( )

Loading

0 comments on commit 0c84c41

Please sign in to comment.