You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CMakeLists.txt
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -158,6 +158,7 @@ endif ( )
158
158
option ( SUITESPARSE_USE_OPENMP "ON (default): Use OpenMP if available. OFF: Do not use OpenMP"ON )
159
159
option ( LAGRAPH_USE_OPENMP "ON: Use OpenMP in LAGraph if available. OFF: Do not use OpenMP. (Default: SUITESPARSE_USE_OPENMP)"${SUITESPARSE_USE_OPENMP} )
160
160
if ( COVERAGE )
161
+
set ( LAGRAPH_USE_OPENMP OFF ) # OK: test coverage is enabled
161
162
message ( STATUS"OpenMP disabled for test coverage" )
162
163
else ( )
163
164
if ( LAGRAPH_USE_OPENMP )
@@ -171,6 +172,17 @@ else ( )
171
172
endif ( )
172
173
endif ( )
173
174
175
+
if ( OpenMP_C_FOUND )
176
+
set ( LAGRAPH_HAS_OPENMP ON )
177
+
else ( )
178
+
set ( LAGRAPH_HAS_OPENMP OFF )
179
+
endif ( )
180
+
181
+
# check for strict usage
182
+
if ( SUITESPARSE_USE_STRICT AND LAGRAPH_USE_OPENMP ANDNOT LAGRAPH_HAS_OPENMP )
183
+
message ( FATAL_ERROR "OpenMP required for LAGraph but not found" )
Copy file name to clipboardExpand all lines: cmake_modules/SuiteSparsePolicy.cmake
+51-18Lines changed: 51 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -15,23 +15,23 @@
15
15
# set ( CMAKE_BUILD_TYPE Debug )
16
16
#
17
17
# SUITESPARSE_USE_CUDA: if OFF, CUDA is disabled. if ON, CUDA is enabled,
18
-
# if available.
18
+
# if available. Ignored for MSVC.
19
19
# Default: ON.
20
20
#
21
-
# LOCAL_INSTALL: if true, "cmake --install" will install
21
+
# SUITESPARSE_LOCAL_INSTALL: if true, "cmake --install" will install
22
22
# into SuiteSparse/lib and SuiteSparse/include.
23
23
# if false, "cmake --install" will install into the
24
24
# default prefix (or the one configured with
25
25
# CMAKE_INSTALL_PREFIX). Requires cmake 3.19.
26
26
# This is ignored when using the root CMakeLists.txt.
27
27
# Set CMAKE_INSTALL_PREFIX instead.
28
-
# Default: false
28
+
# Default: OFF
29
29
#
30
30
# BUILD_SHARED_LIBS: if true, shared libraries are built.
31
-
# Default: true.
31
+
# Default: ON.
32
32
#
33
33
# BUILD_STATIC_LIBS: if true, static libraries are built.
34
-
# Default: true, except for GraphBLAS, which
34
+
# Default: ON, except for GraphBLAS, which
35
35
# takes a long time to compile so the default for
36
36
# GraphBLAS is false.
37
37
#
@@ -49,10 +49,10 @@
49
49
# Both settings must appear, or neither.
50
50
# Default: neither are defined.
51
51
#
52
-
# BLA_STATIC: if true, use static linkage for BLAS and LAPACK.
53
-
# Default: false
52
+
# BLA_STATIC: if ON, use static linkage for BLAS and LAPACK.
53
+
# Default: not set (that is, the same as OFF)
54
54
#
55
-
# SUITESPARSE_ALLOW_64BIT_BLAS if true, SuiteSparse will search for both
55
+
# SUITESPARSE_USE_64BIT_BLAS if true, SuiteSparse will search for both
56
56
# 32-bit and 64-bit BLAS. If false, only 32-bit BLAS
57
57
# will be searched for. Ignored if BLA_VENDOR and
58
58
# BLA_SIZEOF_INTEGER are defined.
@@ -81,12 +81,25 @@
81
81
# installed in the subfolder `pkgconfig` of the directory
82
82
# where the (static) libraries will be installed.
83
83
# Default: CMAKE_INSTALL_PREFIX, or SuiteSparse/lib if
84
-
# LOCAL_INSTALL is enabled.
84
+
# SUITESPARSE_LOCAL_INSTALL is enabled.
85
85
#
86
86
# SUITESPARSE_INCLUDEDIR_POSTFIX : Postfix for installation target of
87
87
# header from SuiteSparse. Default: suitesparse, so the
88
88
# default include directory is:
89
89
# CMAKE_INSTALL_PREFIX/include/suitesparse
90
+
#
91
+
# SUITESPARSE_USE_STRICT: SuiteSparse has many user-definable settings of the
92
+
# form SUITESPARSE_USE_* or (package)_USE_* for some
93
+
# particular package. In general, these settings are not
94
+
# strict. For example, if SUITESPARSE_USE_OPENMP is
95
+
# ON then OpenMP is preferred, but SuiteSparse can be
96
+
# used without OpenMP so no error is generated if OpenMP
97
+
# is not found. However, if SUITESPARSE_USE_STRICT is
98
+
# ON then all *_USE_* settings are treated strictly
99
+
# and an error occurs if any are set to ON but the
100
+
# corresponding package or setting is not available. The
101
+
# *_USE_SYSTEM_* settings are always treated as strict.
102
+
# Default: OFF.
90
103
91
104
message ( STATUS"Source: ${CMAKE_SOURCE_DIR} ")
92
105
message ( STATUS"Build: ${CMAKE_BINARY_DIR} ")
@@ -108,6 +121,9 @@ include ( GNUInstallDirs )
108
121
set ( CMAKE_MODULE_PATH${CMAKE_MODULE_PATH}
109
122
${CMAKE_SOURCE_DIR}/cmake_modules )
110
123
124
+
# strict usage
125
+
option ( SUITESPARSE_USE_STRICT "ON: treat all _USE__ settings as strict if they are ON. OFF (default): consider *_USE_* as preferences, not strict"OFF )
126
+
111
127
# build the demos
112
128
option ( SUITESPARSE_DEMOS "ON: Build the demo programs. OFF (default): do not build the demo programs."OFF )
113
129
@@ -131,10 +147,10 @@ endif ( )
131
147
132
148
# installation options
133
149
if ( NOT SUITESPARSE_ROOT_CMAKELISTS AND${CMAKE_VERSION}VERSION_GREATER_EQUAL"3.19.0" )
134
-
# the LOCAL_INSTALL option requires cmake 3.19.0 or later
135
-
option ( LOCAL_INSTALL"Install in SuiteSparse/lib"OFF )
150
+
# the SUITESPARSE_LOCAL_INSTALL option requires cmake 3.19.0 or later
151
+
option ( SUITESPARSE_LOCAL_INSTALL"Install in SuiteSparse/lib"OFF )
136
152
else ( )
137
-
set ( LOCAL_INSTALLOFF )
153
+
set ( SUITESPARSE_LOCAL_INSTALLOFF )
138
154
endif ( )
139
155
140
156
if ( SUITESPARSE_SECOND_LEVEL )
@@ -150,10 +166,10 @@ endif ( )
150
166
set ( INSIDE_SUITESPARSE OFF )
151
167
if ( NOT SUITESPARSE_ROOT_CMAKELISTS )
152
168
# determine if this Package is inside the SuiteSparse folder
153
-
if ( LOCAL_INSTALL )
169
+
if ( SUITESPARSE_LOCAL_INSTALL )
154
170
# if you do not want to install local copies of SuiteSparse
155
171
# packages in SuiteSparse/lib and SuiteSparse/, set
156
-
# LOCAL_INSTALL to false in your CMake options.
172
+
# SUITESPARSE_LOCAL_INSTALL to false in your CMake options.
157
173
if ( SUITESPARSE_SECOND_LEVEL )
158
174
# the package is normally located at the 2nd level inside SuiteSparse
159
175
# (SuiteSparse/GraphBLAS/GraphBLAS/ for example)
@@ -169,7 +185,7 @@ if ( NOT SUITESPARSE_ROOT_CMAKELISTS )
169
185
endif ( )
170
186
171
187
if ( NOT INSIDE_SUITESPARSE )
172
-
message ( FATAL_ERROR "Unsupported layout for local installation. Correct the directory layout or unset LOCAL_INSTALL." )
188
+
message ( FATAL_ERROR "Unsupported layout for local installation. Correct the directory layout or unset SUITESPARSE_LOCAL_INSTALL." )
173
189
endif ( )
174
190
175
191
endif ( )
@@ -178,7 +194,7 @@ endif ( )
178
194
set ( SUITESPARSE_INCLUDEDIR_POSTFIX"suitesparse"CACHESTRING
179
195
"Postfix for installation target of header from SuiteSparse (default: \"suitesparse\")" )
180
196
181
-
if ( LOCAL_INSTALL )
197
+
if ( SUITESPARSE_LOCAL_INSTALL )
182
198
if ( INSIDE_SUITESPARSE )
183
199
# ../lib and ../include exist: the package is inside SuiteSparse.
184
200
# find ( REAL_PATH ...) requires cmake 3.19.
@@ -242,6 +258,12 @@ if ( SUITESPARSE_USE_FORTRAN )
242
258
endif ( )
243
259
else ( )
244
260
message ( STATUS"Fortran: not enabled" )
261
+
set ( SUITESPARSE_HAS_FORTRAN OFF )
262
+
endif ( )
263
+
264
+
# check for strict usage
265
+
if ( SUITESPARSE_USE_STRICT AND SUITESPARSE_USE_FORTRAN ANDNOT SUITESPARSE_HAS_FORTRAN )
266
+
message ( FATAL_ERROR "Fortran required for SuiteSparse but not found" )
245
267
endif ( )
246
268
247
269
# default C-to-Fortran name mangling if Fortran compiler not found
0 commit comments