Skip to content

Commit c50b66d

Browse files
SUITESPARSE_USE_STRICT
1 parent 6150c42 commit c50b66d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+457
-178
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
cuda-pkgs: "nvidia-cuda-dev nvidia-cuda-toolkit"
5454
cuda-cmake-flags:
5555
-DSUITESPARSE_USE_CUDA=ON
56+
-DSUITESPARSE_USE_STRICT=ON
5657
-DCUDAToolkit_INCLUDE_DIR="/usr/include"
5758
-DCMAKE_CUDA_COMPILER_LAUNCHER="ccache"
5859
- compiler: gcc
@@ -72,6 +73,7 @@ jobs:
7273
cuda-pkgs: "nvidia-cuda-dev nvidia-cuda-toolkit"
7374
cuda-cmake-flags:
7475
-DSUITESPARSE_USE_CUDA=ON
76+
-DSUITESPARSE_USE_STRICT=ON
7577
-DCUDAToolkit_INCLUDE_DIR="/usr/include"
7678
-DCMAKE_CUDA_COMPILER_LAUNCHER="ccache"
7779
openmp: with

.github/workflows/root-cmakelists.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
cuda-pkgs: "nvidia-cuda-dev nvidia-cuda-toolkit"
4848
cuda-cmake-flags:
4949
-DSUITESPARSE_USE_CUDA=ON
50+
-DSUITESPARSE_USE_STRICT=ON
5051
-DCUDAToolkit_INCLUDE_DIR="/usr/include"
5152
-DCMAKE_CUDA_COMPILER_LAUNCHER="ccache"
5253
- compiler: gcc
@@ -58,6 +59,7 @@ jobs:
5859
cuda-pkgs: "nvidia-cuda-dev nvidia-cuda-toolkit"
5960
cuda-cmake-flags:
6061
-DSUITESPARSE_USE_CUDA=ON
62+
-DSUITESPARSE_USE_STRICT=ON
6163
-DCUDAToolkit_INCLUDE_DIR="/usr/include"
6264
-DCMAKE_CUDA_COMPILER_LAUNCHER="ccache"
6365
link: static
@@ -229,11 +231,6 @@ jobs:
229231
include:
230232
- openmp: without
231233
openmp-cmake-flags: "-DSUITESPARSE_USE_OPENMP=OFF"
232-
# - openmp: with
233-
# cuda: with
234-
# cuda-cmake-flags:
235-
# -DSUITESPARSE_USE_CUDA=ON
236-
# -DCMAKE_CUDA_COMPILER_LAUNCHER="ccache"
237234

238235
env:
239236
CHERE_INVOKING: 1

AMD/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ library:
4040

4141
# install only in SuiteSparse/lib and SuiteSparse/include
4242
local:
43-
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DLOCAL_INSTALL=1 .. && cmake --build . --config Release -j${JOBS} )
43+
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DSUITESPARSE_LOCAL_INSTALL=1 .. && cmake --build . --config Release -j${JOBS} )
4444

4545
# install only in /usr/local (default)
4646
global:
47-
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DLOCAL_INSTALL=0 .. && cmake --build . --config Release -j${JOBS} )
47+
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DSUITESPARSE_LOCAL_INSTALL=0 .. && cmake --build . --config Release -j${JOBS} )
4848

4949
debug:
5050
( cd build && cmake $(CMAKE_OPTIONS) -DCMAKE_BUILD_TYPE=Debug .. && cmake --build . --config Debug -j${JOBS} )

BTF/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ library:
4040

4141
# install only in SuiteSparse/lib and SuiteSparse/include
4242
local:
43-
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DLOCAL_INSTALL=1 .. && cmake --build . --config Release -j${JOBS} )
43+
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DSUITESPARSE_LOCAL_INSTALL=1 .. && cmake --build . --config Release -j${JOBS} )
4444

4545
# install only in /usr/local (default)
4646
global:
47-
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DLOCAL_INSTALL=0 .. && cmake --build . --config Release -j${JOBS} )
47+
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DSUITESPARSE_LOCAL_INSTALL=0 .. && cmake --build . --config Release -j${JOBS} )
4848

4949
debug:
5050
( cd build && cmake $(CMAKE_OPTIONS) -DCMAKE_BUILD_TYPE=Debug .. && cmake --build . --config Debug -j${JOBS} )

CAMD/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ library:
4040

4141
# install only in SuiteSparse/lib and SuiteSparse/include
4242
local:
43-
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DLOCAL_INSTALL=1 .. && cmake --build . --config Release -j${JOBS} )
43+
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DSUITESPARSE_LOCAL_INSTALL=1 .. && cmake --build . --config Release -j${JOBS} )
4444

4545
# install only in /usr/local (default)
4646
global:
47-
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DLOCAL_INSTALL=0 .. && cmake --build . --config Release -j${JOBS} )
47+
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DSUITESPARSE_LOCAL_INSTALL=0 .. && cmake --build . --config Release -j${JOBS} )
4848

4949
debug:
5050
( cd build && cmake $(CMAKE_OPTIONS) -DCMAKE_BUILD_TYPE=Debug .. && cmake --build . --config Debug -j${JOBS} )

CCOLAMD/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ library:
4040

4141
# install only in SuiteSparse/lib and SuiteSparse/include
4242
local:
43-
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DLOCAL_INSTALL=1 .. && cmake --build . --config Release -j${JOBS} )
43+
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DSUITESPARSE_LOCAL_INSTALL=1 .. && cmake --build . --config Release -j${JOBS} )
4444

4545
# install only in /usr/local (default)
4646
global:
47-
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DLOCAL_INSTALL=0 .. && cmake --build . --config Release -j${JOBS} )
47+
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DSUITESPARSE_LOCAL_INSTALL=0 .. && cmake --build . --config Release -j${JOBS} )
4848

4949
debug:
5050
( cd build && cmake $(CMAKE_OPTIONS) -DCMAKE_BUILD_TYPE=Debug .. && cmake --build . --config Debug -j${JOBS} )

CHOLMOD/CMakeLists.txt

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ if ( NOT HAVE_SSIZE_T )
5858
add_compile_definitions ( NO_SSIZE_T )
5959
endif ( )
6060

61+
#-------------------------------------------------------------------------------
62+
# find CUDA
63+
#-------------------------------------------------------------------------------
64+
6165
if ( SUITESPARSE_HAS_CUDA AND CHOLMOD_USE_CUDA )
6266
# CHOLMOD with CUDA
6367
enable_language ( CUDA CXX )
@@ -66,8 +70,13 @@ else ( )
6670
set ( CHOLMOD_HAS_CUDA OFF )
6771
endif ( )
6872

73+
# check for strict usage
74+
if ( SUITESPARSE_USE_STRICT AND CHOLMOD_USE_CUDA AND NOT CHOLMOD_HAS_CUDA )
75+
message ( FATAL_ERROR "CUDA required for CHOLMOD but not found" )
76+
endif ( )
77+
6978
#-------------------------------------------------------------------------------
70-
# find library dependencies
79+
# find OpenMP
7180
#-------------------------------------------------------------------------------
7281

7382
option ( SUITESPARSE_USE_OPENMP "ON (default): Use OpenMP if available. OFF: Do not use OpenMP" ON )
@@ -79,6 +88,21 @@ else ( )
7988
set ( OpenMP_C_FOUND OFF )
8089
endif ( )
8190

91+
if ( OpenMP_C_FOUND )
92+
set ( CHOLMOD_HAS_OPENMP ON )
93+
else ( )
94+
set ( CHOLMOD_HAS_OPENMP OFF )
95+
endif ( )
96+
97+
# check for strict usage
98+
if ( SUITESPARSE_USE_STRICT AND CHOLMOD_USE_OPENMP AND NOT CHOLMOD_HAS_OPENMP )
99+
message ( FATAL_ERROR "OpenMP required for CHOLMOD but not found" )
100+
endif ( )
101+
102+
#-------------------------------------------------------------------------------
103+
# find other library dependencies
104+
#-------------------------------------------------------------------------------
105+
82106
if ( NOT SUITESPARSE_ROOT_CMAKELISTS )
83107
find_package ( SuiteSparse_config 7.4.0
84108
PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH )
@@ -421,7 +445,7 @@ if ( CHOLMOD_CAMD )
421445
endif ( )
422446

423447
# OpenMP:
424-
if ( OpenMP_C_FOUND )
448+
if ( CHOLMOD_HAS_OPENMP )
425449
message ( STATUS "OpenMP C libraries: ${OpenMP_C_LIBRARIES}" )
426450
message ( STATUS "OpenMP C include: ${OpenMP_C_INCLUDE_DIRS}" )
427451
message ( STATUS "OpenMP C flags: ${OpenMP_C_FLAGS}" )

CHOLMOD/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ library:
4343

4444
# install only in SuiteSparse/lib and SuiteSparse/include
4545
local:
46-
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DLOCAL_INSTALL=1 .. && cmake --build . --config Release -j${JOBS} )
46+
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DSUITESPARSE_LOCAL_INSTALL=1 .. && cmake --build . --config Release -j${JOBS} )
4747

4848
# install only in /usr/local (default)
4949
global:
50-
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DLOCAL_INSTALL=0 .. && cmake --build . --config Release -j${JOBS} )
50+
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DSUITESPARSE_LOCAL_INSTALL=0 .. && cmake --build . --config Release -j${JOBS} )
5151

5252
# enable CUDA (this is the default, if CUDA is available)
5353
cuda:

CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ include ( SuiteSparsePolicy )
110110

111111
if ( SUITESPARSE_USE_SYSTEM_GRAPHBLAS )
112112
list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "graphblas" )
113-
find_package ( GraphBLAS REQUIRED )
113+
find_package ( GraphBLAS 8.3.1 REQUIRED )
114114
else ( )
115115
if ( "lagraph" IN_LIST SUITESPARSE_ENABLE_PROJECTS )
116116
# LAGraph requires GraphBLAS.
@@ -123,7 +123,7 @@ endif ( )
123123

124124
if ( SUITESPARSE_USE_SYSTEM_BTF )
125125
list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "btf" )
126-
find_package ( BTF REQUIRED )
126+
find_package ( BTF 2.3.0 REQUIRED )
127127
else ( )
128128
if ( "klu" IN_LIST SUITESPARSE_ENABLE_PROJECTS )
129129
# KLU requires BTF.
@@ -136,7 +136,7 @@ endif ( )
136136

137137
if ( SUITESPARSE_USE_SYSTEM_CHOLMOD )
138138
list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "cholmod" )
139-
find_package ( CHOLMOD REQUIRED )
139+
find_package ( CHOLMOD 5.1.0 REQUIRED )
140140
else ( )
141141
if ( ( KLU_USE_CHOLMOD AND "klu" IN_LIST SUITESPARSE_ENABLE_PROJECTS )
142142
OR ( UMFPACK_USE_CHOLMOD AND "umfpack" IN_LIST SUITESPARSE_ENABLE_PROJECTS )
@@ -154,7 +154,7 @@ endif ( )
154154

155155
if ( SUITESPARSE_USE_SYSTEM_AMD )
156156
list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "amd" )
157-
find_package ( AMD REQUIRED )
157+
find_package ( AMD 3.3.0 REQUIRED )
158158
else ( )
159159
if ( "cholmod" IN_LIST SUITESPARSE_ENABLE_PROJECTS
160160
OR "ldl" IN_LIST SUITESPARSE_ENABLE_PROJECTS
@@ -170,7 +170,7 @@ endif ( )
170170

171171
if ( SUITESPARSE_USE_SYSTEM_COLAMD )
172172
list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "colamd" )
173-
find_package ( COLAMD REQUIRED )
173+
find_package ( COLAMD 3.3.0 REQUIRED )
174174
else ( )
175175
if ( "cholmod" IN_LIST SUITESPARSE_ENABLE_PROJECTS
176176
OR "spex" IN_LIST SUITESPARSE_ENABLE_PROJECTS )
@@ -184,7 +184,7 @@ endif ( )
184184

185185
if ( SUITESPARSE_USE_SYSTEM_CAMD )
186186
list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "camd" )
187-
find_package ( CAMD REQUIRED )
187+
find_package ( CAMD 3.3.0 REQUIRED )
188188
else ( )
189189
if ( CHOLMOD_CAMD AND "cholmod" IN_LIST SUITESPARSE_ENABLE_PROJECTS )
190190
# CHOLMOD can optionally use CAMD.
@@ -197,7 +197,7 @@ endif ( )
197197

198198
if ( SUITESPARSE_USE_SYSTEM_CCOLAMD )
199199
list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "ccolamd" )
200-
find_package ( CCOLAMD REQUIRED )
200+
find_package ( CCOLAMD 3.3.0 REQUIRED )
201201
else ( )
202202
if ( CHOLMOD_CAMD AND "cholmod" IN_LIST SUITESPARSE_ENABLE_PROJECTS )
203203
# CHOLMOD can optionally use CCOLAMD.
@@ -210,7 +210,7 @@ endif ( )
210210

211211
if ( SUITESPARSE_USE_SYSTEM_SUITESPARSE_CONFIG )
212212
list ( REMOVE_ITEM SUITESPARSE_ENABLE_PROJECTS "suitesparse_config" )
213-
find_package ( SuiteSparse_config REQUIRED )
213+
find_package ( SuiteSparse_config 7.4.0 REQUIRED )
214214
else ( )
215215
if ( "mongoose" IN_LIST SUITESPARSE_ENABLE_PROJECTS
216216
OR "amd" IN_LIST SUITESPARSE_ENABLE_PROJECTS

COLAMD/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ library:
4040

4141
# install only in SuiteSparse/lib and SuiteSparse/include
4242
local:
43-
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DLOCAL_INSTALL=1 .. && cmake --build . --config Release -j${JOBS} )
43+
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DSUITESPARSE_LOCAL_INSTALL=1 .. && cmake --build . --config Release -j${JOBS} )
4444

4545
# install only in /usr/local (default)
4646
global:
47-
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DLOCAL_INSTALL=0 .. && cmake --build . --config Release -j${JOBS} )
47+
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DSUITESPARSE_LOCAL_INSTALL=0 .. && cmake --build . --config Release -j${JOBS} )
4848

4949
debug:
5050
( cd build && cmake $(CMAKE_OPTIONS) -DCMAKE_BUILD_TYPE=Debug .. && cmake --build . --config Debug -j${JOBS} )

CXSparse/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ else ( )
6060
set ( CXSPARSE_HAS_COMPLEX 0 )
6161
endif ( )
6262

63+
# check for strict usage
64+
if ( SUITESPARSE_USE_STRICT AND CXSPARSE_USE_COMPLEX AND NOT CXSPARSE_HAS_COMPLEX )
65+
message ( FATAL_ERROR "complex types required for CXSparse but not available" )
66+
endif ( )
67+
6368
#-------------------------------------------------------------------------------
6469
# find library dependencies
6570
#-------------------------------------------------------------------------------

CXSparse/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ library:
4343

4444
# install only in SuiteSparse/lib and SuiteSparse/include
4545
local:
46-
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DLOCAL_INSTALL=1 .. && cmake --build . --config Release -j${JOBS} )
46+
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DSUITESPARSE_LOCAL_INSTALL=1 .. && cmake --build . --config Release -j${JOBS} )
4747

4848
# install only in /usr/local (default)
4949
global:
50-
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DLOCAL_INSTALL=0 .. && cmake --build . --config Release -j${JOBS} )
50+
( cd build && cmake $(CMAKE_OPTIONS) -USUITESPARSE_PKGFILEDIR -DSUITESPARSE_LOCAL_INSTALL=0 .. && cmake --build . --config Release -j${JOBS} )
5151

5252
debug:
5353
( cd build && cmake $(CMAKE_OPTIONS) -DCMAKE_BUILD_TYPE=Debug .. && cmake --build . --config Debug -j${JOBS} )

Example/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cmake_minimum_required ( VERSION 3.22 )
1818
# CMAKE_PREFIX_PATH if the SuiteSparse libraries aren't installed at a default
1919
# location. For example, on Linux or Mac, if you have your own a compiled copy
2020
# of SuiteSparse in /home/me/SuiteSparse that was compiled and installed with
21-
# LOCAL_INSTALL set to ON, use the following:
21+
# SUITESPARSE_LOCAL_INSTALL set to ON, use the following:
2222
#
2323
# export CMAKE_PREFIX_PATH /home/me/SuiteSparse
2424
#
@@ -28,7 +28,7 @@ cmake_minimum_required ( VERSION 3.22 )
2828
# set ( CMAKE_PREFIX_PATH /opt/SuiteSparse )
2929
#
3030
# The following is added, just to simplify building this Example if it is
31-
# located inside SuiteSparse itself and compiled with LOCAL_INSTALL set to ON.
31+
# located inside SuiteSparse itself and compiled with SUITESPARSE_LOCAL_INSTALL set to ON.
3232
# Normally you would not use this in a stand-alone library that relies on
3333
# SuiteSparse:
3434

GraphBLAS/CMakeLists.txt

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ if ( NOT GRAPHBLAS_BUILD_STATIC_LIBS AND BUILD_SHARED_LIBS )
5252
set ( BUILD_STATIC_LIBS OFF )
5353
endif ( )
5454

55+
#-------------------------------------------------------------------------------
56+
# find CUDA
57+
#-------------------------------------------------------------------------------
58+
5559
if ( SUITESPARSE_HAS_CUDA AND GRAPHBLAS_USE_CUDA )
5660
# FOR NOW: do not compile FactoryKernels when developing the CUDA kernels
5761
set ( GRAPHBLAS_COMPACT ON )
@@ -63,13 +67,14 @@ else ( )
6367
set ( GRAPHBLAS_HAS_CUDA OFF )
6468
endif ( )
6569

66-
include ( GraphBLAS_JIT_paths )
70+
# check for strict usage
71+
if ( SUITESPARSE_USE_STRICT AND GRAPHBLAS_USE_CUDA AND NOT GRAPHBLAS_HAS_CUDA )
72+
message ( FATAL_ERROR "CUDA required for GraphBLAS but not found" )
73+
endif ( )
6774

68-
#-------------------------------------------------------------------------------
69-
# find OpenMP, CUDA, RMM, and cpu_features
70-
#-------------------------------------------------------------------------------
75+
include ( GraphBLAS_JIT_paths )
7176

72-
if ( SUITESPARSE_HAS_CUDA AND GRAPHBLAS_USE_CUDA )
77+
if ( GRAPHBLAS_HAS_CUDA )
7378
# with CUDA and RMM
7479
add_subdirectory ( CUDA )
7580
set ( GB_CUDA GraphBLAS_CUDA ${CUDA_LIBRARIES} )
@@ -86,6 +91,9 @@ else ( )
8691
set ( GB_RMM )
8792
endif ( )
8893

94+
#-------------------------------------------------------------------------------
95+
# find OpenMP
96+
#-------------------------------------------------------------------------------
8997

9098
option ( SUITESPARSE_USE_OPENMP "ON (default): Use OpenMP if available. OFF: Do not use OpenMP" ON )
9199
option ( GRAPHBLAS_USE_OPENMP "ON: Use OpenMP in GraphBLAS if available. OFF: Do not use OpenMP. (Default: SUITESPARSE_USE_OPENMP)" ${SUITESPARSE_USE_OPENMP} )
@@ -96,6 +104,21 @@ else ( )
96104
set ( OpenMP_C_FOUND OFF )
97105
endif ( )
98106

107+
if ( OpenMP_C_FOUND )
108+
set ( GRAPHBLAS_HAS_OPENMP ON )
109+
else ( )
110+
set ( GRAPHBLAS_HAS_OPENMP OFF )
111+
endif ( )
112+
113+
# check for strict usage
114+
if ( SUITESPARSE_USE_STRICT AND GRAPHBLAS_USE_OPENMP AND NOT GRAPHBLAS_HAS_OPENMP )
115+
message ( FATAL_ERROR "OpenMP required for GraphBLAS but not found" )
116+
endif ( )
117+
118+
#-------------------------------------------------------------------------------
119+
# find cpu_features
120+
#-------------------------------------------------------------------------------
121+
99122
if ( NOT GBNCPUFEAT )
100123
# default: enable Google's cpu_features package
101124
message ( STATUS "cpu_features (by google.com): enabled " )
@@ -417,7 +440,7 @@ if ( NOT GB_CMAKE_LIBRARIES )
417440
set ( GB_CMAKE_LIBRARIES "" )
418441
endif ( )
419442

420-
if ( OpenMP_C_FOUND )
443+
if ( GRAPHBLAS_HAS_OPENMP )
421444
message ( STATUS "CMAKE OpenMP libraries: ${OpenMP_C_LIBRARIES}" )
422445
message ( STATUS "CMAKE OpenMP include: ${OpenMP_C_INCLUDE_DIRS}" )
423446
list ( APPEND GB_CMAKE_LIBRARIES ${OpenMP_C_LIBRARIES} )
@@ -529,7 +552,7 @@ if ( SUITESPARSE_DEMOS )
529552
target_link_libraries ( context_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} )
530553
target_link_libraries ( gauss_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} )
531554

532-
if ( OpenMP_C_FOUND )
555+
if ( GRAPHBLAS_HAS_OPENMP )
533556
target_link_libraries ( openmp_demo PUBLIC OpenMP::OpenMP_C )
534557
target_link_libraries ( openmp2_demo PUBLIC OpenMP::OpenMP_C )
535558
target_link_libraries ( reduce_demo PUBLIC OpenMP::OpenMP_C )

0 commit comments

Comments
 (0)