Skip to content

Commit 38be941

Browse files
authored
Merge branch 'develop' into fluka-cern
2 parents f2a322a + a435d06 commit 38be941

27 files changed

Lines changed: 409 additions & 156 deletions

.github/actions/upstream-test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ inputs:
2020
hdf5_version:
2121
description: Version of HDF5
2222
required: false
23-
default: hdf5_1_14_3
23+
default: 1.14.6
2424
moab_version:
2525
description: Version of MOAB
2626
required: false

.github/workflows/docker_publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
clang,
2323
]
2424
hdf5_version : [
25-
hdf5_1_14_3,
25+
1.14.6,
2626
]
2727
moab_version : [
2828
5.4.1,
@@ -103,7 +103,7 @@ jobs:
103103
clang,
104104
]
105105
hdf5_version : [
106-
hdf5_1_14_3,
106+
1.14.6,
107107
]
108108
moab_version : [
109109
5.4.1,

.github/workflows/linux_build_test.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,31 @@ jobs:
4444
clang,
4545
]
4646
hdf5_version : [
47-
1.14.3,
47+
1.14.6,
4848
]
4949
moab_version : [
5050
5.4.1,
5151
5.5.1,
5252
]
53+
pull_install_moab : [
54+
off,
55+
]
5356
geant4_version : [
54-
10.7.4,
55-
11.1.2
57+
v10.7.4,
58+
v11.2.1
5659
]
5760
double_down_version : [
5861
off,
5962
v1.1.0,
6063
]
64+
include:
65+
- ubuntu_version: 22.04
66+
compiler: gcc
67+
hdf5_version: 1.14.6
68+
moab_version: 5.4.1
69+
pull_install_moab: on
70+
geant4_version: off
71+
double_down_version: off
6172

6273
container:
6374
image: ghcr.io/svalinn/dagmc-ci-ubuntu-${{
@@ -72,7 +83,7 @@ jobs:
7283
matrix.geant4_version
7384
}}-double_down_${{
7485
matrix.double_down_version
75-
}}/moab:latest
86+
}}/external_deps:latest
7687

7788
steps:
7889
- name: Checkout repository
@@ -86,9 +97,10 @@ jobs:
8697
mkdir -p build
8798
cd build
8899
cmake ../ \
89-
-DMOAB_DIR=${moab_install_dir} \
100+
-DMOAB_DIR=${MOAB_INSTALL_DIR} \
90101
-DBUILD_GEANT4=$([ "${{ matrix.geant4_version }}" != "off" ] && echo "ON" || echo "OFF") \
91-
-DGEANT4_DIR=${geant4_install_dir} \
102+
-DPULL_INSTALL_MOAB=$([ "${{ matrix.pull_install_moab }}" != "on" ] && echo "OFF" || echo "ON -DHDF5_ROOT=${HDF5_INSTALL_DIR}") \
103+
-DGEANT4_DIR=${GEANT4_INSTALL_DIR} \
92104
-DBUILD_CI_TESTS=ON \
93105
-DBUILD_MW_REG_TESTS=OFF \
94106
-DBUILD_STATIC_EXE=OFF \
@@ -98,7 +110,7 @@ jobs:
98110
-DCMAKE_Fortran_COMPILER=gfortran \
99111
-DCMAKE_INSTALL_PREFIX=${install_dir}/dagmc \
100112
-DDOUBLE_DOWN=$([ "${{ matrix.double_down_version }}" != "off" ] && echo "ON" || echo "OFF") \
101-
-Ddd_ROOT=${double_down_install_dir}
113+
-Ddd_ROOT=${DOUBLE_DOWN_INSTALL_DIR}
102114
make -j${CI_JOBS}
103115
make install
104116

.github/workflows/windows_build_test.yml

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@ name: Windows Build/Test
33
on:
44
# allows us to run workflows manually
55
workflow_dispatch:
6-
pull_request:
7-
branches:
8-
- develop
9-
paths-ignore:
10-
- '.github/workflows/docker_publish.yml'
11-
- '.github/workflows/linux_build_test.yml'
12-
- '.github/workflows/linux_upstream_test_*'
13-
- '.github/workflows/mac_build_test.yml'
14-
- '.github/workflows/housekeeping.yml'
15-
- '.github/workflows/changelog_test.yml'
16-
- '.github/actions/**'
17-
- 'CI/**'
18-
- 'doc/**'
6+
# pull_request:
7+
# branches:
8+
# - develop
9+
# paths-ignore:
10+
# - '.github/workflows/docker_publish.yml'
11+
# - '.github/workflows/linux_build_test.yml'
12+
# - '.github/workflows/linux_upstream_test_*'
13+
# - '.github/workflows/mac_build_test.yml'
14+
# - '.github/workflows/housekeeping.yml'
15+
# - '.github/workflows/changelog_test.yml'
16+
# - '.github/actions/**'
17+
# - 'CI/**'
18+
# - 'doc/**'
1919

20-
push:
21-
branches:
22-
- develop
23-
paths-ignore:
24-
- '.github/workflows/docker_publish.yml'
25-
- '.github/workflows/linux_build_test.yml'
26-
- '.github/workflows/linux_upstream_test_*'
27-
- '.github/workflows/mac_build_test.yml'
28-
- '.github/workflows/housekeeping.yml'
29-
- '.github/workflows/changelog_test.yml'
30-
- '.github/actions/**'
31-
- 'CI/**'
32-
- 'doc/**'
20+
# push:
21+
# branches:
22+
# - develop
23+
# paths-ignore:
24+
# - '.github/workflows/docker_publish.yml'
25+
# - '.github/workflows/linux_build_test.yml'
26+
# - '.github/workflows/linux_upstream_test_*'
27+
# - '.github/workflows/mac_build_test.yml'
28+
# - '.github/workflows/housekeeping.yml'
29+
# - '.github/workflows/changelog_test.yml'
30+
# - '.github/actions/**'
31+
# - 'CI/**'
32+
# - 'doc/**'
3333

3434
env:
3535
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -41,16 +41,16 @@ jobs:
4141

4242
- uses: conda-incubator/setup-miniconda@v3
4343
with:
44-
auto-activate-base: true
44+
auto-update-conda: true
45+
auto-activate-base: false
4546
activate-environment: ""
4647

4748
# yaml-cpp package has conflicting gtest headers and is not needed for this project
4849
- name: Conda dependencies
4950
shell: bash -l {0}
5051
run: |
5152
conda install curl eigen
52-
conda install -c conda-forge hdf5=1.10.6
53-
conda remove -y yaml-cpp
53+
conda install -c conda-forge hdf5==1.10.6
5454
5555
- name: Environment Variables
5656
shell: bash -l {0}
@@ -114,12 +114,15 @@ jobs:
114114
-DMOAB_DIR=../install_dir \
115115
-DHDF5_ROOT="${CONDA_LOC}" \
116116
-DHDF5_hdf5_LIBRARY_RELEASE="${CONDA_LOC}/lib/libhdf5_hl.lib;${CONDA_LOC}/lib/libhdf5.lib;${CONDA_LOC}/lib/zlib.lib;${CONDA_LOC}/lib/libhdf5_cpp.lib" \
117-
-DCMAKE_INSTALL_PREFIX=../install_dir/ \
118-
-DCMAKE_EXE_LINKER_FLAGS="" \
119-
-DCMAKE_MODULE_LINKER_FLAGS="" \
120-
-DCMAKE_SHARED_LINKER_FLAGS="" \
117+
-DCMAKE_EXE_LINKER_FLAGS="/std:c++latest -DH5_BUILT_AS_DYNAMIC_LIB" \
118+
-DCMAKE_MODULE_LINKER_FLAGS="/std:c++latest" \
119+
-DCMAKE_SHARED_LINKER_FLAGS="/std:c++latest" \
121120
-DCMAKE_STATIC_LINKER_FLAGS="" \
122-
-DCMAKE_BUILD_TYPE=Release
121+
-DCMAKE_EXE_LINKER_FLAGS="" \
122+
-DCMAKE_INSTALL_PREFIX=../install_dir/ \
123+
-DCMAKE_BUILD_TYPE=Release \
124+
-DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe" \
125+
-DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe"
123126
cmake --build . --config Release
124127
cmake --install . --config Release
125128

CI/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Global arguments set before the first build stage are accessable by all build stages
77
ARG UBUNTU_VERSION=22.04
8-
ARG HDF5_VERSION=hdf5_1_14_3
8+
ARG HDF5_VERSION=1.14.6
99
ARG MOAB_VERSION=5.5.1
1010
# Setting GEANT4_VERSION=off will disable GEANT4 build
1111
ARG GEANT4_VERSION=v11.2.1
@@ -136,7 +136,7 @@ ENV HDF5_INSTALL_DIR=${INSTALL_DIR}/hdf5
136136

137137
RUN mkdir -p ${HDF5_BUILD_DIR}/build && \
138138
cd ${HDF5_BUILD_DIR} && \
139-
git clone -b ${HDF5_VERSION} --depth 1 https://github.com/HDFGroup/hdf5.git && \
139+
git clone -b hdf5_${HDF5_VERSION} --depth 1 https://github.com/HDFGroup/hdf5.git && \
140140
cd build && \
141141
cmake ../hdf5 \
142142
-DCMAKE_INSTALL_PREFIX=${HDF5_INSTALL_DIR} \

CMakeLists.txt

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
project(DAGMC)
2-
cmake_minimum_required(VERSION 3.1)
2+
cmake_minimum_required(VERSION 3.18)
33
enable_language(CXX)
44

55
# Set DAGMC version
66
set(DAGMC_MAJOR_VERSION 3)
77
set(DAGMC_MINOR_VERSION 2)
8-
set(DAGMC_PATCH_VERSION 3)
8+
set(DAGMC_PATCH_VERSION 4)
99
set(DAGMC_VERSION ${DAGMC_MAJOR_VERSION}.${DAGMC_MINOR_VERSION}.${DAGMC_PATCH_VERSION})
1010

1111
if(MSVC)
1212
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
13+
add_definitions( -DH5_BUILT_AS_DYNAMIC_LIB )
1314
endif()
1415

1516

@@ -29,22 +30,6 @@ if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
2930
endif()
3031

3132
option(GIT_SUBMODULE "Check submodules during build" ON)
32-
if(GIT_SUBMODULE)
33-
message(STATUS "Submodule update")
34-
execute_process(COMMAND ${GIT_EXECUTABLE} "submodule" "update" "--init" "--recursive"
35-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
36-
RESULT_VARIABLE GIT_SUBMOD_RESULT)
37-
if(NOT GIT_SUBMOD_RESULT EQUAL 0)
38-
message(FATAL_ERROR "git submodule update --init --recursive failed with \
39-
${GIT_SUBMOD_RESULT}, please checkout submodules")
40-
endif()
41-
endif()
42-
endif()
43-
44-
# Check to see if submodules exist (by checking one)
45-
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/pyne/pyne/readme.rst")
46-
message(FATAL_ERROR "The git submodules were not downloaded! GIT_SUBMODULE was \
47-
turned off or failed. Please update submodules and try again.")
4833
endif()
4934

5035
# Make the scripts in the "cmake" directory available to CMake
@@ -59,7 +44,22 @@ if(BUILD_MCNP5 OR BUILD_MCNP6)
5944
enable_language(Fortran)
6045
endif()
6146

62-
find_package(MOAB REQUIRED)
47+
# Dealing with MOAB
48+
if (PULL_INSTALL_MOAB)
49+
set(MOAB_VERSION ${PULL_INSTALL_MOAB})
50+
51+
# Ensure MOAB_VERSION
52+
if(NOT ${MOAB_VERSION} MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+")
53+
MESSAGE("MOAB_VERSION: ${MOAB_VERSION} not recognized. Defaulting to 5.5.1")
54+
set(MOAB_VERSION "5.5.1")
55+
endif()
56+
MESSAGE("MOAB_VERSION to be installed: ${MOAB_VERSION}")
57+
include(MOAB_PullAndMake)
58+
moab_pull_make(${MOAB_VERSION})
59+
else()
60+
find_package(MOAB REQUIRED)
61+
endif()
62+
6363
find_package(OpenMP)
6464

6565
dagmc_setup_flags()

cmake/DAGMC_macros.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ macro (dagmc_setup_build)
1515
if (NOT CMAKE_BUILD_TYPE STREQUAL "Release" AND
1616
NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND
1717
NOT CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
18-
message(FATAL_ERROR "Specified CMAKE_BUILD_TYPE is invalid; valid options are Release, Debug, RelWithDebInfo")
18+
message(FATAL_ERROR "Specified CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} is invalid; valid options are Release, Debug, RelWithDebInfo")
1919
endif ()
2020
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER)
2121
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
@@ -73,6 +73,8 @@ macro (dagmc_setup_options)
7373

7474
option(DOUBLE_DOWN "Enable ray tracing with Embree via double down" OFF)
7575

76+
option(PULL_INSTALL_MOAB "Enable automatic downloading of MOAB dependency, provide a MOAB TAG version" OFF)
77+
7678
if (BUILD_ALL)
7779
set(BUILD_MCNP5 ON)
7880
set(BUILD_MCNP6 ON)
@@ -89,11 +91,13 @@ macro (dagmc_setup_options)
8991
endif()
9092

9193
if (DOUBLE_DOWN)
94+
message(STATUS "DOUBLE_DOWN has been enabled for ray tracing. Searching for package...")
9295
find_package(DOUBLE_DOWN REQUIRED)
9396
if (dd_VERSION VERSION_LESS 1.1.0)
9497
message(FATAL_ERROR "Discovered Double Down Version: ${DOUBLE_DOWN_VERSION}. \
9598
Please update Double Down to version 1.1.0 or greater.")
9699
endif()
100+
message(STATUS "Found DOUBLE_DOWN.")
97101
endif()
98102

99103

@@ -251,6 +255,11 @@ macro (dagmc_install_library lib_name)
251255
EXPORT DAGMCTargets
252256
LIBRARY DESTINATION ${INSTALL_LIB_DIR}
253257
PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR})
258+
# Required to ensure that MOAB is built before DAGMC and to properly link against MOAB
259+
if(PULL_INSTALL_MOAB)
260+
target_link_libraries(${lib_name}-shared PUBLIC ${MOAB_LIBRARY_DIRS}/libMOAB${CMAKE_SHARED_LIBRARY_SUFFIX})
261+
add_dependencies(${lib_name}-shared MOAB)
262+
endif()
254263
endif ()
255264

256265
if (BUILD_STATIC_LIBS)

cmake/FindMOAB.cmake

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This leverages HDF5_macro.cmake in order to find HDF5 libraries.
2+
13
message("")
24

35
# Find MOAB cmake config file
@@ -19,27 +21,9 @@ endif ()
1921

2022
# Find HDF5
2123
include(${MOAB_CMAKE_CONFIG})
22-
set(ENV{PATH} "${HDF5_DIR}:$ENV{PATH}")
23-
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
24-
find_package(HDF5 REQUIRED)
25-
# Remove HDF5 transitive dependencies that are system libraries
26-
list(FILTER HDF5_LIBRARIES EXCLUDE REGEX ".*lib(pthread|dl|m).*")
27-
set(HDF5_LIBRARIES_SHARED ${HDF5_LIBRARIES})
28-
# CMake doesn't let you find_package(HDF5) twice so we have to do this instead
29-
if (BUILD_STATIC_LIBS)
30-
string(REPLACE ${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_SUFFIX}
31-
HDF5_LIBRARIES_STATIC "${HDF5_LIBRARIES_SHARED}")
32-
endif ()
33-
if (NOT BUILD_SHARED_LIBS)
34-
set(HDF5_LIBRARIES_SHARED)
35-
endif ()
36-
set(HDF5_LIBRARIES)
37-
38-
message(STATUS "HDF5_INCLUDE_DIRS: ${HDF5_INCLUDE_DIRS}")
39-
message(STATUS "HDF5_LIBRARIES_SHARED: ${HDF5_LIBRARIES_SHARED}")
40-
message(STATUS "HDF5_LIBRARIES_STATIC: ${HDF5_LIBRARIES_STATIC}")
24+
include(HDF5_macro)
25+
find_set_HDF5()
4126

42-
include_directories(${HDF5_INCLUDE_DIRS})
4327
if(MSVC)
4428
set(BUILD_STATIC_LIBS TRUE)
4529
set(BUILD_SHARED_LIBS OFF)

cmake/HDF5_macro.cmake

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
MACRO (find_set_HDF5)
2+
# Find HDF5
3+
set(ENV{PATH} "${HDF5_DIR}:$ENV{PATH}")
4+
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
5+
find_package(HDF5 REQUIRED)
6+
# Remove HDF5 transitive dependencies that are system libraries
7+
list(FILTER HDF5_LIBRARIES EXCLUDE REGEX ".*lib(pthread|dl|m).*")
8+
set(HDF5_LIBRARIES_SHARED ${HDF5_LIBRARIES})
9+
# CMake doesn't let you find_package(HDF5) twice so we have to do this instead
10+
if (BUILD_STATIC_LIBS)
11+
string(REPLACE ${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_SUFFIX}
12+
HDF5_LIBRARIES_STATIC "${HDF5_LIBRARIES_SHARED}")
13+
endif ()
14+
if (NOT BUILD_SHARED_LIBS)
15+
set(HDF5_LIBRARIES_SHARED)
16+
endif ()
17+
set(HDF5_LIBRARIES)
18+
19+
message(STATUS "HDF5_INCLUDE_DIRS: ${HDF5_INCLUDE_DIRS}")
20+
message(STATUS "HDF5_LIBRARIES_SHARED: ${HDF5_LIBRARIES_SHARED}")
21+
message(STATUS "HDF5_LIBRARIES_STATIC: ${HDF5_LIBRARIES_STATIC}")
22+
23+
include_directories(${HDF5_INCLUDE_DIRS})
24+
25+
ENDMACRO (find_set_HDF5)

0 commit comments

Comments
 (0)