From 0c644206f7177b7250451604b6e9b7502f9de0c5 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Thu, 5 Dec 2024 18:38:17 +0100 Subject: [PATCH] normal build for MOAB --- .github/workflows/linux_build_test.yml | 2 +- cmake/FindMOAB.cmake | 47 ++++++++++++-------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/.github/workflows/linux_build_test.yml b/.github/workflows/linux_build_test.yml index b790f45f4..481beebef 100644 --- a/.github/workflows/linux_build_test.yml +++ b/.github/workflows/linux_build_test.yml @@ -66,7 +66,7 @@ jobs: compiler: gcc hdf5_version: 1.14.3 moab_version: 5.4.1 - ddl_deps: ON + ddl_deps: off geant4_version: off double_down_version: off diff --git a/cmake/FindMOAB.cmake b/cmake/FindMOAB.cmake index 259f6b496..3a04f2533 100644 --- a/cmake/FindMOAB.cmake +++ b/cmake/FindMOAB.cmake @@ -1,29 +1,5 @@ message("") - -# Find HDF5 -set(ENV{PATH} "${HDF5_DIR}:$ENV{PATH}") -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX}) -find_package(HDF5 REQUIRED) -# Remove HDF5 transitive dependencies that are system libraries -list(FILTER HDF5_LIBRARIES EXCLUDE REGEX ".*lib(pthread|dl|m).*") -set(HDF5_LIBRARIES_SHARED ${HDF5_LIBRARIES}) -# CMake doesn't let you find_package(HDF5) twice so we have to do this instead -if (BUILD_STATIC_LIBS) - string(REPLACE ${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_SUFFIX} - HDF5_LIBRARIES_STATIC "${HDF5_LIBRARIES_SHARED}") -endif () -if (NOT BUILD_SHARED_LIBS) - set(HDF5_LIBRARIES_SHARED) -endif () -set(HDF5_LIBRARIES) - -message(STATUS "HDF5_INCLUDE_DIRS: ${HDF5_INCLUDE_DIRS}") -message(STATUS "HDF5_LIBRARIES_SHARED: ${HDF5_LIBRARIES_SHARED}") -message(STATUS "HDF5_LIBRARIES_STATIC: ${HDF5_LIBRARIES_STATIC}") - -include_directories(${HDF5_INCLUDE_DIRS}) - # Find MOAB cmake config file # Only used to determine the location of the HDF5 with which MOAB was built set(MOAB_SEARCH_DIRS) @@ -35,7 +11,6 @@ find_path(MOAB_CMAKE_CONFIG NO_DEFAULT_PATH ) - # First check if we are forcing the download of MOAB if (DDL_INSTALL_DEPS) IF(DAGMC_BUILD_STATIC_LIBS) @@ -57,6 +32,28 @@ else () message(FATAL_ERROR "Could not find MOAB. Set -DMOAB_DIR= when running cmake or use the $MOAB_DIR environment variable.") endif () +# Find HDF5 +set(ENV{PATH} "${HDF5_DIR}:$ENV{PATH}") +set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX}) +find_package(HDF5 REQUIRED) +# Remove HDF5 transitive dependencies that are system libraries +list(FILTER HDF5_LIBRARIES EXCLUDE REGEX ".*lib(pthread|dl|m).*") +set(HDF5_LIBRARIES_SHARED ${HDF5_LIBRARIES}) +# CMake doesn't let you find_package(HDF5) twice so we have to do this instead +if (BUILD_STATIC_LIBS) + string(REPLACE ${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_SUFFIX} + HDF5_LIBRARIES_STATIC "${HDF5_LIBRARIES_SHARED}") +endif () +if (NOT BUILD_SHARED_LIBS) + set(HDF5_LIBRARIES_SHARED) +endif () +set(HDF5_LIBRARIES) + +message(STATUS "HDF5_INCLUDE_DIRS: ${HDF5_INCLUDE_DIRS}") +message(STATUS "HDF5_LIBRARIES_SHARED: ${HDF5_LIBRARIES_SHARED}") +message(STATUS "HDF5_LIBRARIES_STATIC: ${HDF5_LIBRARIES_STATIC}") + +include_directories(${HDF5_INCLUDE_DIRS}) if(MSVC) set(BUILD_STATIC_LIBS TRUE) set(BUILD_SHARED_LIBS OFF)