Attempt to fix linkage errors

This commit is contained in:
Guilhem Lavaux 2023-12-07 08:56:24 +01:00
parent b878efb8b1
commit 6adf02b287
2 changed files with 19 additions and 9 deletions

View File

@ -42,6 +42,17 @@ ENDIF(BUILD_PYTHON)
MESSAGE(STATUS "Using the target ${CosmoTool_local} to build python module") MESSAGE(STATUS "Using the target ${CosmoTool_local} to build python module")
find_library(ZLIB_LIBRARY z)
find_library(DL_LIBRARY dl)
find_library(RT_LIBRARY rt)
if (RT_LIBRARY)
SET(RT_DEP rt)
message(STATUS "RT found, linking against it")
else()
SET(RT_DEP)
endif()
find_library(MATH_LIBRARY m)
include(${CMAKE_SOURCE_DIR}/external/external_build.cmake) include(${CMAKE_SOURCE_DIR}/external/external_build.cmake)
IF(YORICK_SUPPORT) IF(YORICK_SUPPORT)
@ -55,9 +66,6 @@ IF(YORICK_SUPPORT)
ENDIF(YORICK_SUPPORT) ENDIF(YORICK_SUPPORT)
find_program(CYTHON NAMES cython3 cython) find_program(CYTHON NAMES cython3 cython)
find_library(ZLIB_LIBRARY z)
find_library(DL_LIBRARY dl)
find_library(MATH_LIBRARY m)
set(NETCDF_FIND_REQUIRED ${YORICK_SUPPORT}) set(NETCDF_FIND_REQUIRED ${YORICK_SUPPORT})
set(GSL_FIND_REQUIRED TRUE) set(GSL_FIND_REQUIRED TRUE)

View File

@ -105,7 +105,7 @@ if (INTERNAL_HDF5)
SET(ENV{HDF5_ROOT} ${HDF5_BIN_DIR}) SET(ENV{HDF5_ROOT} ${HDF5_BIN_DIR})
SET(HDF5_ROOTDIR ${HDF5_BIN_DIR}) SET(HDF5_ROOTDIR ${HDF5_BIN_DIR})
SET(CONFIGURE_LDFLAGS "${CONFIGURE_LDFLAGS} -L${HDF5_BIN_DIR}/lib") SET(CONFIGURE_LDFLAGS "${CONFIGURE_LDFLAGS} -L${HDF5_BIN_DIR}/lib")
SET(CONFIGURE_LIBS "${CONFIGURE_LIBS} -ldl") SET(CONFIGURE_LIBS "${CONFIGURE_LIBS} -ldl ${RT_LIBRARY}")
set(HDF5_C_STATIC_LIBRARY ${HDF5_BIN_DIR}/lib/libhdf5.a) set(HDF5_C_STATIC_LIBRARY ${HDF5_BIN_DIR}/lib/libhdf5.a)
set(HDF5_HL_STATIC_LIBRARY ${HDF5_BIN_DIR}/lib/libhdf5_hl.a) set(HDF5_HL_STATIC_LIBRARY ${HDF5_BIN_DIR}/lib/libhdf5_hl.a)
set(HDF5_LIBRARIES ${HDF5_BIN_DIR}/lib/libhdf5.a CACHE STRING "HDF5 lib" FORCE) set(HDF5_LIBRARIES ${HDF5_BIN_DIR}/lib/libhdf5.a CACHE STRING "HDF5 lib" FORCE)
@ -175,6 +175,7 @@ if (INTERNAL_NETCDF)
string(REPLACE ";" "|" CMAKE_PREFIX_PATH_ALT_SEP "${CMAKE_PREFIX_PATH}") string(REPLACE ";" "|" CMAKE_PREFIX_PATH_ALT_SEP "${CMAKE_PREFIX_PATH}")
ExternalProject_Add(netcdf ExternalProject_Add(netcdf
DEPENDS ${hdf5_built} DEPENDS ${hdf5_built}
URL_HASH MD5=f48ee01534365006934f0c63d4055ea0
PREFIX ${BUILD_PREFIX}/netcdf-prefix PREFIX ${BUILD_PREFIX}/netcdf-prefix
DOWNLOAD_DIR ${SOURCE_PREFIX}/downloads DOWNLOAD_DIR ${SOURCE_PREFIX}/downloads
URL ${NETCDF_URL} URL ${NETCDF_URL}
@ -183,6 +184,7 @@ if (INTERNAL_NETCDF)
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH_ALT_SEP} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH_ALT_SEP}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DNC_EXTRA_DEPS=${RT_DEP}
-DBUILD_SHARED_LIBS=OFF -DBUILD_SHARED_LIBS=OFF
-DBUILD_TESTING=OFF -DBUILD_TESTING=OFF
-DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_TYPE=Release