Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Added HDF5 library to link stage
Browse files Browse the repository at this point in the history
  • Loading branch information
MintoDA1 authored and MintoDA1 committed Sep 22, 2023
1 parent 0adbccf commit 89b2168
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ IF (CMAKE_SYSTEM_NAME STREQUAL "Windows")
ENDIF ()
MESSAGE(STATUS "Looking for netCDF-FortranConfig.cmake in ${netCDF-Fortran_DIR}")
FIND_PACKAGE(netCDF-Fortran REQUIRED)
FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED)

# Ensure scikit-build modules
FIND_PACKAGE(Python COMPONENTS Interpreter Development.Module REQUIRED)
Expand Down
6 changes: 2 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,8 @@ IF (NOT BUILD_SHARED_LIBS)
SET_PROPERTY(TARGET ${SWIFTEST_LIBRARY} PROPERTY POSITION_INDEPENDENT_CODE)
ENDIF ()

#TARGET_INCLUDE_DIRECTORIES(${SWIFTEST_LIBRARY} PUBLIC ${NETCDF_FORTRAN_INCLUDE_DIR})
#TARGET_INCLUDE_DIRECTORIES(${SWIFTEST_DRIVER} PUBLIC ${NETCDF_FORTRAN_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(${SWIFTEST_LIBRARY} PUBLIC netCDF::netcdff)
TARGET_LINK_LIBRARIES(${SWIFTEST_DRIVER} PUBLIC ${SWIFTEST_LIBRARY} netCDF::netcdff)
TARGET_LINK_LIBRARIES(${SWIFTEST_LIBRARY} PUBLIC netCDF::netcdff HDF5::HDF5)
TARGET_LINK_LIBRARIES(${SWIFTEST_DRIVER} PUBLIC ${SWIFTEST_LIBRARY} netCDF::netcdff HDF5::HDF5)

IF(USE_OPENMP OR USE_SIMD)
SET_PROPERTY(TARGET ${SWIFTEST_LIBRARY} ${SWIFTEST_DRIVER} APPEND_STRING PROPERTY COMPILE_FLAGS "${OpenMP_Fortran_FLAGS} ")
Expand Down

0 comments on commit 89b2168

Please sign in to comment.