Skip to content

Commit

Permalink
CMake: Build with OpenMP support if available
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Feb 20, 2023
1 parent b4ae6aa commit b672bef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ endforeach(FLAG)
# find dependencies
include(GNUInstallDirs)

find_package(OpenMP)

option(ENABLE_HDF5 "Build with HDF5 support?" ON)
if(ENABLE_HDF5)
find_package(
Expand Down Expand Up @@ -220,6 +222,11 @@ target_link_libraries(
PUBLIC ${BLAS_LIBRARIES}
PUBLIC ${CMAKE_DL_LIBS})


if(OpenMP_FOUND)
target_link_libraries(${PROJECT_NAME} PUBLIC OpenMP::OpenMP_CXX)
endif()

option(SUNDIALS_SUPERLUMT_ENABLE "Enable sundials SuperLUMT?" OFF)
if(SUNDIALS_SUPERLUMT_ENABLE)
set(SUNDIALS_LIBRARIES
Expand Down
2 changes: 2 additions & 0 deletions cmake/AmiciConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

include(CMakeFindDependencyMacro)

find_package(OpenMP)

find_package(SUNDIALS REQUIRED PATHS "@CMAKE_SOURCE_DIR@/ThirdParty/sundials/build/lib/cmake/sundials/")

include("${CMAKE_CURRENT_LIST_DIR}/AmiciTargets.cmake")
Expand Down

0 comments on commit b672bef

Please sign in to comment.