Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: Find only required OpenMP components. #658

Merged
merged 1 commit into from
Dec 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHOLMOD/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ if ( NOT SUITESPARSE_USE_OPENMP )
set ( CHOLMOD_USE_OPENMP "OFF" CACHE STRING "" FORCE )
endif ( )
if ( CHOLMOD_USE_OPENMP )
find_package ( OpenMP GLOBAL )
find_package ( OpenMP COMPONENTS C GLOBAL )
else ( )
# OpenMP has been disabled
set ( OpenMP_C_FOUND OFF )
Expand Down
2 changes: 1 addition & 1 deletion CHOLMOD/Config/CHOLMODConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ endif ( )

# Look for OpenMP
if ( @CHOLMOD_HAS_OPENMP@ AND NOT OpenMP_C_FOUND )
find_dependency ( OpenMP )
find_dependency ( OpenMP COMPONENTS C )
if ( NOT OpenMP_C_FOUND )
set ( _dependencies_found OFF )
endif ( )
Expand Down
2 changes: 1 addition & 1 deletion GraphBLAS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ if ( NOT SUITESPARSE_USE_OPENMP )
set ( GRAPHBLAS_USE_OPENMP "OFF" CACHE STRING "" FORCE )
endif ( )
if ( GRAPHBLAS_USE_OPENMP )
find_package ( OpenMP GLOBAL )
find_package ( OpenMP COMPONENTS C GLOBAL )
else ( )
# OpenMP has been disabled.
set ( OpenMP_C_FOUND OFF )
Expand Down
2 changes: 1 addition & 1 deletion GraphBLAS/Config/GraphBLASConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ endif ( )

# Look for OpenMP
if ( @GRAPHBLAS_HAS_OPENMP@ AND NOT OpenMP_C_FOUND )
find_dependency ( OpenMP )
find_dependency ( OpenMP COMPONENTS C )
if ( NOT OpenMP_C_FOUND )
set ( _dependencies_found OFF )
endif ( )
Expand Down
2 changes: 1 addition & 1 deletion GraphBLAS/GraphBLAS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if ( NOT SUITESPARSE_USE_OPENMP )
set ( GRAPHBLAS_USE_OPENMP "OFF" CACHE STRING "" FORCE )
endif ( )
if ( GRAPHBLAS_USE_OPENMP )
find_package ( OpenMP )
find_package ( OpenMP COMPONENTS C )
else ( )
# OpenMP has been disabled
set ( OpenMP_C_FOUND OFF )
Expand Down
2 changes: 1 addition & 1 deletion LAGraph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ if ( COVERAGE )
message ( STATUS "OpenMP disabled for test coverage" )
else ( )
if ( LAGRAPH_USE_OPENMP )
find_package ( OpenMP GLOBAL )
find_package ( OpenMP COMPONENTS C GLOBAL )
if ( OpenMP_C_FOUND AND BUILD_STATIC_LIBS )
list ( APPEND LAGRAPH_STATIC_LIBS ${OpenMP_C_LIBRARIES} )
endif ( )
Expand Down
2 changes: 1 addition & 1 deletion LAGraph/config/LAGraphConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ endif ( )

# Look for OpenMP
if ( @LAGRAPH_HAS_OPENMP@ AND NOT OpenMP_C_FOUND )
find_dependency ( OpenMP )
find_dependency ( OpenMP COMPONENTS C )
if ( NOT OpenMP_C_FOUND )
set ( _dependencies_found OFF )
endif ( )
Expand Down
2 changes: 1 addition & 1 deletion ParU/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ endif ( )

if ( PARU_USE_OPENMP )
# OpenMP 4.5 or later is required
find_package ( OpenMP GLOBAL )
find_package ( OpenMP COMPONENTS C CXX GLOBAL )
if ( OpenMP_CXX_FOUND AND OpenMP_C_FOUND )
set ( PARU_HAS_OPENMP ON )
if (( OpenMP_CXX_VERSION VERSION_LESS 4.5 ) OR
Expand Down
2 changes: 1 addition & 1 deletion SuiteSparse_config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ 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 )
find_package ( OpenMP COMPONENTS C GLOBAL )
else ( )
# OpenMP has been disabled
set ( OpenMP_C_FOUND OFF )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ set ( _dependencies_found ON )

# Look for OpenMP
if ( @SUITESPARSE_HAS_OPENMP@ AND NOT OpenMP_C_FOUND )
find_dependency ( OpenMP )
find_dependency ( OpenMP COMPONENTS C )
if ( NOT OpenMP_C_FOUND )
set ( _dependencies_found OFF )
endif ( )
Expand Down