Skip to content

Commit

Permalink
add SUITESPARSE_CONFIG_USE_OPENMP
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed Dec 23, 2023
1 parent 4264066 commit 038bca2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions SuiteSparse_config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,32 @@ endif ( )
# find OpenMP
#-------------------------------------------------------------------------------

if ( SUITESPARSE_USE_OPENMP )
option ( SUITESPARSE_CONFIG_USE_OPENMP "ON: Use OpenMP in SuiteSparse_config if available. OFF: Do not use OpenMP. (Default: SUITESPARSE_USE_OPENMP)" ${SUITESPARSE_USE_OPENMP} )
if ( NOT SUITESPARSE_USE_OPENMP )
set ( SUITESPARSE_CONFIG_USE_OPENMP "OFF" CACHE STRING "" FORCE )
endif ( )
if ( SUITESPARSE_CONFIG_USE_OPENMP OR SUITESPARSE_USE_OPENMP )
find_package ( OpenMP GLOBAL )
else ( )
# OpenMP has been disabled
message ( STATUS "OpenMP disabled" )
set ( OpenMP_C_FOUND OFF )
endif ( )

if ( OpenMP_C_FOUND )
set ( SUITESPARSE_HAS_OPENMP ON )
set ( SUITESPARSE_CONFIG_HAS_OPENMP ON )
else ( )
set ( SUITESPARSE_HAS_OPENMP OFF )
set ( SUITESPARSE_CONFIG_HAS_OPENMP OFF )
endif ( )

# check for strict usage
if ( SUITESPARSE_USE_STRICT AND SUITESPARSE_USE_OPENMP AND NOT SUITESPARSE_HAS_OPENMP )
message ( FATAL_ERROR "OpenMP required for SuiteSparse but not found" )
endif ( )
if ( SUITESPARSE_USE_STRICT AND SUITESPARSE_CONFIG_USE_OPENMP AND NOT SUITESPARSE_CONFIG_HAS_OPENMP )
message ( FATAL_ERROR "OpenMP required for SuiteSparse_config but not found" )
endif ( )

#-------------------------------------------------------------------------------
# find the BLAS
Expand Down Expand Up @@ -163,7 +171,7 @@ if ( NOT WIN32 )
endif ( )

# OpenMP:
if ( OpenMP_C_FOUND )
if ( SUITESPARSE_CONFIG_USE_OPENMP )
message ( STATUS "OpenMP C libraries: ${OpenMP_C_LIBRARIES} ")
message ( STATUS "OpenMP C include: ${OpenMP_C_INCLUDE_DIRS} ")
message ( STATUS "OpenMP C flags: ${OpenMP_C_FLAGS} ")
Expand Down

0 comments on commit 038bca2

Please sign in to comment.