Skip to content

Commit

Permalink
Merge pull request #3051 from heplesser/omplibs
Browse files Browse the repository at this point in the history
Properly handle OpenMP linker flags
  • Loading branch information
heplesser authored Feb 5, 2024
2 parents d90ec9f + 11cef9d commit b8b2347
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,13 @@ endforeach ()
set( MODULE_LINK_LIBS
"-lnest"
"-lsli"
"${OpenMP_CXX_FLAGS}"
"${LTDL_LIBRARIES}"
"${READLINE_LIBRARIES}"
"${GSL_LIBRARIES}"
"${LIBNEUROSIM_LIBRARIES}"
"${MUSIC_LIBRARIES}"
"${MPI_CXX_LIBRARIES}"
"${OpenMP_CXX_LIBRARIES}"
"${SIONLIB_LIBRARIES}"
"${BOOST_LIBRARIES}" )

Expand Down
1 change: 1 addition & 0 deletions cmake/ConfigureSummary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ function( NEST_PRINT_CONFIG_SUMMARY )
message( "" )
if ( OPENMP_FOUND )
message( "Use threading : Yes (OpenMP: ${OpenMP_CXX_FLAGS})" )
message( " Libraries : ${OpenMP_CXX_LIBRARIES}" )
else ()
message( "Use threading : No" )
endif ()
Expand Down
2 changes: 2 additions & 0 deletions cmake/ProcessOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ function( NEST_PROCESS_WITH_OPENMP )
set( OPENMP_FOUND ON )
set( OpenMP_C_FLAGS "${with-openmp}" )
set( OpenMP_CXX_FLAGS "${with-openmp}" )
set( OpenMP_CXX_LIBRARIES "${with-openmp}" )
else ()
find_package( OpenMP )
endif ()
Expand All @@ -436,6 +437,7 @@ function( NEST_PROCESS_WITH_OPENMP )
set( OPENMP_FOUND "${OPENMP_FOUND}" PARENT_SCOPE )
set( OpenMP_C_FLAGS "${OpenMP_C_FLAGS}" PARENT_SCOPE )
set( OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS}" PARENT_SCOPE )
set( OpenMP_CXX_LIBRARIES "${OpenMP_CXX_LIBRARIES}" PARENT_SCOPE )
# set flags
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" PARENT_SCOPE )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" PARENT_SCOPE )
Expand Down

0 comments on commit b8b2347

Please sign in to comment.