diff --git a/AMD/CMakeLists.txt b/AMD/CMakeLists.txt index c1fabb11f..5aae66d00 100644 --- a/AMD/CMakeLists.txt +++ b/AMD/CMakeLists.txt @@ -146,6 +146,7 @@ endif ( ) # Demo library and programs #------------------------------------------------------------------------------- +option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off ) if ( DEMO ) #--------------------------------------------------------------------------- diff --git a/CAMD/CMakeLists.txt b/CAMD/CMakeLists.txt index 620d8a329..289226bda 100644 --- a/CAMD/CMakeLists.txt +++ b/CAMD/CMakeLists.txt @@ -144,6 +144,7 @@ endif ( ) # Demo library and programs #------------------------------------------------------------------------------- +option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off ) if ( DEMO ) #--------------------------------------------------------------------------- diff --git a/CCOLAMD/CMakeLists.txt b/CCOLAMD/CMakeLists.txt index d2b11ca06..d6be2a098 100644 --- a/CCOLAMD/CMakeLists.txt +++ b/CCOLAMD/CMakeLists.txt @@ -144,6 +144,7 @@ endif ( ) # Demo library and programs #------------------------------------------------------------------------------- +option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off ) if ( DEMO ) #--------------------------------------------------------------------------- diff --git a/CHOLMOD/CMakeLists.txt b/CHOLMOD/CMakeLists.txt index 5391f8b0d..fcbc5c425 100644 --- a/CHOLMOD/CMakeLists.txt +++ b/CHOLMOD/CMakeLists.txt @@ -446,6 +446,7 @@ endif ( ) # Demo library and programs #------------------------------------------------------------------------------- +option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off ) if ( DEMO ) #--------------------------------------------------------------------------- diff --git a/COLAMD/CMakeLists.txt b/COLAMD/CMakeLists.txt index 94302da0c..4878604d5 100644 --- a/COLAMD/CMakeLists.txt +++ b/COLAMD/CMakeLists.txt @@ -143,6 +143,7 @@ endif ( ) # Demo library and programs #------------------------------------------------------------------------------- +option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off ) if ( DEMO ) #--------------------------------------------------------------------------- diff --git a/CSparse/CMakeLists.txt b/CSparse/CMakeLists.txt index 31db48f0c..413ca529d 100644 --- a/CSparse/CMakeLists.txt +++ b/CSparse/CMakeLists.txt @@ -113,6 +113,7 @@ endif ( ) # Demo library and programs #------------------------------------------------------------------------------- +option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off ) if ( DEMO ) #--------------------------------------------------------------------------- diff --git a/CXSparse/CMakeLists.txt b/CXSparse/CMakeLists.txt index 38d6a4edf..e5cc0d1dd 100644 --- a/CXSparse/CMakeLists.txt +++ b/CXSparse/CMakeLists.txt @@ -143,6 +143,7 @@ endif ( ) # Demo library and programs #------------------------------------------------------------------------------- +option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off ) if ( DEMO ) #--------------------------------------------------------------------------- diff --git a/GraphBLAS/CMakeLists.txt b/GraphBLAS/CMakeLists.txt index b90a0ad5f..c0126928c 100644 --- a/GraphBLAS/CMakeLists.txt +++ b/GraphBLAS/CMakeLists.txt @@ -75,7 +75,8 @@ endif ( ) option ( NOPENMP "ON: do not use OpenMP. OFF (default): use OpenMP" off ) if ( NOPENMP ) - # OpenMP has been disabled + # OpenMP has been disabled. + set ( OPENMP_FOUND false ) else ( ) find_package ( OpenMP ) @@ -372,6 +373,17 @@ if ( OPENMP_FOUND ) message ( STATUS "CMAKE OpenMP C flags: " ${OpenMP_C_FLAGS} ) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} " ) include_directories ( ${OpenMP_C_INCLUDE_DIRS} ) +else ( ) + message ( WARNING + "WARNING: OpenMP was not found (or was disabled with NOPENMP). See the " + "GrapBLAS user guide on the consequences of compiling GraphBLAS without " + "OpenMP. GraphBLAS will work but may not be thread-safe, since it relies " + "on '#pragma omp flush' to ensure the work performed by one user thread is " + "available to another, in GrB_wait. If OpenMP is not in use, the " + "thread-safety of GrB_wait becomes the responsibilty of the user " + "application (perhaps through a pthreads construct). Compiling GraphBLAS " + "without OpenMP is not recommended for installation in a package manager " + "(Linux, conda-forge, spack, brew, vcpkg, etc). " ) endif ( ) if ( SUITESPARSE_CUDA ) @@ -391,6 +403,7 @@ message ( STATUS "CMAKE C flags: " ${CMAKE_C_FLAGS} ) # Demo library and programs #------------------------------------------------------------------------------- +option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off ) if ( DEMO ) #--------------------------------------------------------------------------- diff --git a/GraphBLAS/Doc/GraphBLAS_UserGuide.pdf b/GraphBLAS/Doc/GraphBLAS_UserGuide.pdf index 2c5b4ebc5..4e9daf939 100644 Binary files a/GraphBLAS/Doc/GraphBLAS_UserGuide.pdf and b/GraphBLAS/Doc/GraphBLAS_UserGuide.pdf differ diff --git a/GraphBLAS/Doc/GraphBLAS_UserGuide.tex b/GraphBLAS/Doc/GraphBLAS_UserGuide.tex index 99a78aa07..b57935103 100644 --- a/GraphBLAS/Doc/GraphBLAS_UserGuide.tex +++ b/GraphBLAS/Doc/GraphBLAS_UserGuide.tex @@ -8595,6 +8595,9 @@ \subsection{OpenMP parallelism} if (!have_openmp) printf ("GraphBLAS not compiled with OpenMP\n") : \end{verbatim} +Compiling GraphBLAS without OpenMP is not recommended for installation in a +package manager (Linux, conda-forge, spack, brew, vcpkg, etc). + %------------------------------------------------------------------------------- \subsection{Storing a matrix by row or by column} %------------------------------------------------------------------------------- diff --git a/KLU/CMakeLists.txt b/KLU/CMakeLists.txt index de6bfa23c..ca20ede63 100644 --- a/KLU/CMakeLists.txt +++ b/KLU/CMakeLists.txt @@ -262,6 +262,7 @@ endif ( ) # Demo library and programs #------------------------------------------------------------------------------- +option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off ) if ( DEMO ) #--------------------------------------------------------------------------- diff --git a/LDL/CMakeLists.txt b/LDL/CMakeLists.txt index cb17d2986..795a3b8d1 100644 --- a/LDL/CMakeLists.txt +++ b/LDL/CMakeLists.txt @@ -152,6 +152,7 @@ endif ( ) # Demo library and programs #------------------------------------------------------------------------------- +option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off ) if ( DEMO ) #--------------------------------------------------------------------------- diff --git a/RBio/CMakeLists.txt b/RBio/CMakeLists.txt index a052ec832..de385102b 100644 --- a/RBio/CMakeLists.txt +++ b/RBio/CMakeLists.txt @@ -144,6 +144,7 @@ endif ( ) # Demo library and programs #------------------------------------------------------------------------------- +option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off ) if ( DEMO ) #--------------------------------------------------------------------------- diff --git a/README.md b/README.md index 2dbd79130..7e8cd7b6c 100644 --- a/README.md +++ b/README.md @@ -634,6 +634,11 @@ Module. Debug mode will be used. The static libraries will not be built Note that BLAS and LAPACK may still use OpenMP internally; if you wish to disable OpenMP in an entire application, select a single-threaded BLAS/LAPACK. + WARNING: GraphBLAS may not be thread-safe if built + without OpenMP (see the User Guide for details). + + DEMO if true: build the demo programs for each package. + Default: false. Additional options are available within specific packages: diff --git a/SPEX/CMakeLists.txt b/SPEX/CMakeLists.txt index 598940b4d..efd2d6b21 100644 --- a/SPEX/CMakeLists.txt +++ b/SPEX/CMakeLists.txt @@ -190,6 +190,7 @@ endif ( ) # Demo library and programs #------------------------------------------------------------------------------- +option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off ) if ( DEMO ) #--------------------------------------------------------------------------- diff --git a/SPQR/CMakeLists.txt b/SPQR/CMakeLists.txt index 3bf04e3f0..2e9f3cb8e 100644 --- a/SPQR/CMakeLists.txt +++ b/SPQR/CMakeLists.txt @@ -271,6 +271,7 @@ endif ( ) # Demo library and programs #------------------------------------------------------------------------------- +option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off ) if ( DEMO ) #--------------------------------------------------------------------------- diff --git a/UMFPACK/CMakeLists.txt b/UMFPACK/CMakeLists.txt index f49af0126..c3a0e07d1 100644 --- a/UMFPACK/CMakeLists.txt +++ b/UMFPACK/CMakeLists.txt @@ -219,6 +219,7 @@ endif ( ) # Demo library and programs #------------------------------------------------------------------------------- +option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off ) if ( DEMO ) #---------------------------------------------------------------------------