Skip to content

Commit

Permalink
adding test, and reshaping some things, adding comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bam241 committed Dec 5, 2024
1 parent 1a89e7a commit 2eabf6a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/linux_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ jobs:
5.4.1,
5.5.1,
]
ddl_deps : [
off,
on,
]
geant4_version : [
10.7.4,
11.1.2
Expand Down Expand Up @@ -88,6 +92,7 @@ jobs:
cmake ../ \
-DMOAB_DIR=${moab_install_dir} \
-DBUILD_GEANT4=$([ "${{ matrix.geant4_version }}" != "off" ] && echo "ON" || echo "OFF") \
-DDDL_INSTALL_DEPS$([ "${{ matrix.ddl_deps }}" != "off" ] && echo "ON" || echo "OFF") \
-DGEANT4_DIR=${geant4_install_dir} \
-DBUILD_CI_TESTS=ON \
-DBUILD_MW_REG_TESTS=OFF \
Expand Down
25 changes: 17 additions & 8 deletions cmake/FindMOAB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,24 @@ find_path(MOAB_CMAKE_CONFIG
PATHS ${MOAB_SEARCH_DIRS}
NO_DEFAULT_PATH
)
if (MOAB_CMAKE_CONFIG)
set(MOAB_CMAKE_CONFIG ${MOAB_CMAKE_CONFIG}/MOABConfig.cmake)
message(STATUS "MOAB_CMAKE_CONFIG: ${MOAB_CMAKE_CONFIG}")
include(${MOAB_CMAKE_CONFIG})
elseif (DDL_INSTALL_DEPS)

# First check if we are forcing the download of MOAB
if (DDL_INSTALL_DEPS)
IF(NOT DAGMC_BUILD_SHARED_LIBS OR DAGMC_BUILD_STATIC_LIBS)
message(FATAL_ERROR "DDL_INSTALL_DEPS is ONLY compatible with shared libraries.")
ENDIF()
IF(NOT MOAB_VERSION)
SET(MOAB_VERSION "5.5.1")
ENDIF()
include(MOAB_PullAndMake)
moab_pull_make(${MOAB_VERSION})

# Back to normal behavior
elseif (MOAB_CMAKE_CONFIG)
set(MOAB_CMAKE_CONFIG ${MOAB_CMAKE_CONFIG}/MOABConfig.cmake)
message(STATUS "MOAB_CMAKE_CONFIG: ${MOAB_CMAKE_CONFIG}")
include(${MOAB_CMAKE_CONFIG})

else ()
message(FATAL_ERROR "Could not find MOAB. Set -DMOAB_DIR=<MOAB_DIR> when running cmake or use the $MOAB_DIR environment variable.")
endif ()
Expand Down Expand Up @@ -78,11 +85,13 @@ message(STATUS "MOAB_LIBRARY_DIRS: ${MOAB_LIBRARY_DIRS}")
message(STATUS "MOAB_LIBRARIES_SHARED: ${MOAB_LIBRARIES_SHARED}")
message(STATUS "MOAB_LIBRARIES_STATIC: ${MOAB_LIBRARIES_STATIC}")

if (MOAB_INCLUDE_DIRS AND (MOAB_LIBRARIES_SHARED OR NOT BUILD_SHARED_LIBS) AND


if(DDL_INSTALL_DEPS)
message(STATUS "MOAB will be downloaded and built at make time")
elseif (MOAB_INCLUDE_DIRS AND (MOAB_LIBRARIES_SHARED OR NOT BUILD_SHARED_LIBS) AND
(MOAB_LIBRARIES_STATIC OR NOT BUILD_STATIC_LIBS))
message(STATUS "Found MOAB")
elseif(DDL_INSTALL_DEPS)
message(STATUS "MOAB not found, will be downloaded and built at make time")
else()
message(FATAL_ERROR "Could not find MOAB")
endif ()
Expand Down
4 changes: 3 additions & 1 deletion cmake/MOAB_PullAndMake.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# this Macro sets up the download and build of MOAB using ExternalProject
# few tweak are done in src/dagmc/CMakeLists.txt and src/PyNE/CMakelists.txt
# to make sure that MOAB is built before DAGMC.
MACRO (moab_pull_make moab_version)
message(STATUS "MOAB will be downloaded and built")
include(ExternalProject)
Expand All @@ -17,7 +20,6 @@ MACRO (moab_pull_make moab_version)
-DBUILD_SHARED_LIBS:BOOL=ON
-DENABLE_HDF5:BOOL=ON
-DHDF5_ROOT:PATH=${HDF5_ROOT}
-DEIGEN3_DIR:PATH=${EIGEN3_INCLUDE_DIRS}
-DENABLE_BLASLAPACK:BOOL=OFF
-DENABLE_FORTRAN:BOOL=OFF
-DCMAKE_MACOSX_RPATH:BOOL=ON
Expand Down
1 change: 1 addition & 0 deletions src/dagmc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ include_directories(${CMAKE_BINARY_DIR}/src/dagmc)

dagmc_install_library(dagmc)

# Required to ensure that MOAB is built before DAGMC and to properly link against MOAB
if(DDL_INSTALL_DEPS)
add_dependencies(dagmc-shared MOAB)
target_link_libraries(dagmc-shared PUBLIC ${MOAB_INSTALL_PREFIX}/lib64/libMOAB.so)
Expand Down
1 change: 1 addition & 0 deletions src/pyne/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ if(NOT (${HDF5_VERSION} VERSION_LESS 1.12.0))
endif()

dagmc_install_library(pyne_dagmc)
# Required to ensure that MOAB is built before pyne_dagmc
if(DDL_INSTALL_DEPS)
add_dependencies(pyne_dagmc-shared MOAB)
endif()

0 comments on commit 2eabf6a

Please sign in to comment.