Skip to content

Commit

Permalink
CMake: openmp optional for FF and CPP if not explicitly requested (#2120
Browse files Browse the repository at this point in the history
)

If using FAST.Farm or the CPP API, optionally use OpenMP if it can be found 

Co-authored-by: Derek Slaughter <deslaughter@gmail.com>
  • Loading branch information
andrew-platt and deslaughter authored Mar 26, 2024
1 parent 106ed6b commit 70c0870
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ include(${CMAKE_SOURCE_DIR}/cmake/set_rpath.cmake)
# OpenMP
#-------------------------------------------------------------------------------

if (OPENMP OR BUILD_FASTFARM OR BUILD_OPENFAST_CPP_API)
FIND_PACKAGE(OpenMP REQUIRED)
if (OPENMP)
FIND_PACKAGE(OpenMP REQUIRED)
endif()
if (BUILD_FASTFARM OR BUILD_OPENFAST_CPP_API)
FIND_PACKAGE(OpenMP)
if (OpenMP_Fortran_FOUND)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenMP_Fortran_FLAGS}")
link_libraries("${OpenMP_Fortran_LIBRARIES}")
Expand Down

0 comments on commit 70c0870

Please sign in to comment.