Skip to content

Commit

Permalink
move tchem needed libraries out of compiler flags
Browse files Browse the repository at this point in the history
  • Loading branch information
jcurtis2 committed Oct 21, 2024
1 parent d35d10d commit 986c8a2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ include(FortranCInterface)

if (ENABLE_TCHEM)
find_package(OpenMP REQUIRED)
set(CMAKE_C_FLAGS "-lpthread -ldl ${OpenMP_C_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS "-lpthread -ldl ${OpenMP_Fortran_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS "${OpenMP_C_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS "${OpenMP_Fortran_FLAGS}" CACHE STRING "" FORCE)
if (ENABLE_TCHEM_GPU)
set(CMAKE_CXX_FLAGS "-lpthread -ldl ${OpenMP_CXX_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS}" CACHE STRING "" FORCE)
endif()
endif()

Expand Down Expand Up @@ -262,6 +262,11 @@ target_link_libraries(partmclib ${NETCDF_LIBS} ${SUNDIALS_LIBS}
${MOSAIC_LIB} ${GSL_LIBS} ${CAMP_LIB} ${TCHEM_LIB} ${YAML_LIB}
${KOKKOS_LIB} ${KOKKOSKERNEL_LIB} ${TINES_LIB} ${CPP_LIB} ${LAPACK_LIB})

if (ENABLE_TCHEM)
include(FindThreads)
target_link_libraries(partmclib ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
endif()

set_target_properties(partmclib PROPERTIES OUTPUT_NAME partmc)
if (ENABLE_TCHEM_GPU)
set_target_properties(partmclib PROPERTIES LINKER_LANGUAGE CXX)
Expand Down

0 comments on commit 986c8a2

Please sign in to comment.