@@ -36,8 +36,8 @@ option(OPENMC_ENABLE_COVERAGE "Compile with coverage analysis flags"
3636option (OPENMC_USE_DAGMC "Enable support for DAGMC (CAD) geometry" OFF )
3737option (OPENMC_USE_LIBMESH "Enable support for libMesh unstructured mesh tallies" OFF )
3838option (OPENMC_USE_MPI "Enable MPI" OFF )
39- option (OPENMC_USE_MCPL "Enable MCPL" OFF )
4039option (OPENMC_USE_UWUW "Enable UWUW" OFF )
40+ option (OPENMC_FORCE_VENDORED_LIBS "Explicitly use submodules defined in 'vendor'" OFF )
4141
4242message (STATUS "OPENMC_USE_OPENMP ${OPENMC_USE_OPENMP} " )
4343message (STATUS "OPENMC_BUILD_TESTS ${OPENMC_BUILD_TESTS} " )
@@ -46,8 +46,8 @@ message(STATUS "OPENMC_ENABLE_COVERAGE ${OPENMC_ENABLE_COVERAGE}")
4646message (STATUS "OPENMC_USE_DAGMC ${OPENMC_USE_DAGMC} " )
4747message (STATUS "OPENMC_USE_LIBMESH ${OPENMC_USE_LIBMESH} " )
4848message (STATUS "OPENMC_USE_MPI ${OPENMC_USE_MPI} " )
49- message (STATUS "OPENMC_USE_MCPL ${OPENMC_USE_MCPL} " )
5049message (STATUS "OPENMC_USE_UWUW ${OPENMC_USE_UWUW} " )
50+ message (STATUS "OPENMC_FORCE_VENDORED_LIBS ${OPENMC_FORCE_VENDORED_LIBS} " )
5151
5252# Warnings for deprecated options
5353foreach (OLD_OPT IN ITEMS "openmp" "profile" "coverage" "dagmc" "libmesh" )
@@ -189,22 +189,6 @@ if(${HDF5_VERSION} VERSION_GREATER_EQUAL 1.12.0)
189189 list (APPEND cxxflags -DH5Oget_info_by_idx_vers=1 -DH5O_info_t_vers=1)
190190endif ()
191191
192- #===============================================================================
193- # MCPL
194- #===============================================================================
195-
196- if (OPENMC_USE_MCPL)
197- if (NOT DEFINED MCPL_DIR)
198- execute_process (
199- COMMAND mcpl-config --show cmakedir
200- OUTPUT_VARIABLE MCPL_DIR
201- OUTPUT_STRIP_TRAILING_WHITESPACE
202- )
203- endif ()
204- find_package (MCPL REQUIRED )
205- message (STATUS "Found MCPL: ${MCPL_DIR} (found version \" ${MCPL_VERSION} \" )" )
206- endif ()
207-
208192#===============================================================================
209193# Set compile/link flags based on which compiler is being used
210194#===============================================================================
@@ -256,41 +240,61 @@ endif()
256240# pugixml library
257241#===============================================================================
258242
259- find_package_write_status (pugixml )
260- if (NOT pugixml_FOUND)
243+ if (OPENMC_FORCE_VENDORED_LIBS)
261244 add_subdirectory (vendor/pugixml )
262245 set_target_properties (pugixml PROPERTIES CXX_STANDARD 14 CXX_EXTENSIONS OFF )
246+ else ()
247+ find_package_write_status (pugixml )
248+ if (NOT pugixml_FOUND)
249+ add_subdirectory (vendor/pugixml )
250+ set_target_properties (pugixml PROPERTIES CXX_STANDARD 14 CXX_EXTENSIONS OFF )
251+ endif ()
263252endif ()
264253
265254#===============================================================================
266255# {fmt} library
267256#===============================================================================
268257
269- find_package_write_status (fmt )
270- if (NOT fmt_FOUND)
258+ if (OPENMC_FORCE_VENDORED_LIBS)
271259 set (FMT_INSTALL ON CACHE BOOL "Generate the install target." )
272260 add_subdirectory (vendor/fmt )
261+ else ()
262+ find_package_write_status (fmt )
263+ if (NOT fmt_FOUND)
264+ set (FMT_INSTALL ON CACHE BOOL "Generate the install target." )
265+ add_subdirectory (vendor/fmt )
266+ endif ()
273267endif ()
274268
275269#===============================================================================
276270# xtensor header-only library
277271#===============================================================================
278272
279- find_package_write_status (xtensor )
280- if (NOT xtensor_FOUND)
273+ if (OPENMC_FORCE_VENDORED_LIBS)
281274 add_subdirectory (vendor/xtl )
282275 set (xtl_DIR ${CMAKE_CURRENT_BINARY_DIR} /vendor/xtl)
283276 add_subdirectory (vendor/xtensor )
277+ else ()
278+ find_package_write_status (xtensor )
279+ if (NOT xtensor_FOUND)
280+ add_subdirectory (vendor/xtl )
281+ set (xtl_DIR ${CMAKE_CURRENT_BINARY_DIR} /vendor/xtl)
282+ add_subdirectory (vendor/xtensor )
283+ endif ()
284284endif ()
285285
286286#===============================================================================
287287# Catch2 library
288288#===============================================================================
289289
290290if (OPENMC_BUILD_TESTS)
291- find_package_write_status (Catch2 )
292- if (NOT Catch2_FOUND)
291+ if (OPENMC_FORCE_VENDORED_LIBS)
293292 add_subdirectory (vendor/Catch2 )
293+ else ()
294+ find_package_write_status (Catch2 )
295+ if (NOT Catch2_FOUND)
296+ add_subdirectory (vendor/Catch2 )
297+ endif ()
294298 endif ()
295299endif ()
296300
@@ -334,6 +338,7 @@ list(APPEND libopenmc_SOURCES
334338 src/cell.cpp
335339 src/chain.cpp
336340 src/cmfd_solver.cpp
341+ src/collision_track.cpp
337342 src/cross_sections.cpp
338343 src/dagmc.cpp
339344 src/distribution.cpp
@@ -414,6 +419,7 @@ list(APPEND libopenmc_SOURCES
414419 src/tallies/filter_materialfrom.cpp
415420 src/tallies/filter_mesh.cpp
416421 src/tallies/filter_meshborn.cpp
422+ src/tallies/filter_meshmaterial.cpp
417423 src/tallies/filter_meshsurface.cpp
418424 src/tallies/filter_mu.cpp
419425 src/tallies/filter_musurface.cpp
@@ -498,11 +504,11 @@ else()
498504endif ()
499505
500506if (OPENMC_USE_DAGMC)
501- target_compile_definitions (libopenmc PRIVATE DAGMC )
507+ target_compile_definitions (libopenmc PRIVATE OPENMC_DAGMC_ENABLED )
502508 target_link_libraries (libopenmc dagmc-shared )
503509
504510 if (OPENMC_USE_UWUW)
505- target_compile_definitions (libopenmc PRIVATE OPENMC_UWUW )
511+ target_compile_definitions (libopenmc PRIVATE OPENMC_UWUW_ENABLED )
506512 target_link_libraries (libopenmc uwuw-shared )
507513 endif ()
508514elseif (OPENMC_USE_UWUW)
@@ -511,7 +517,7 @@ elseif(OPENMC_USE_UWUW)
511517endif ()
512518
513519if (OPENMC_USE_LIBMESH)
514- target_compile_definitions (libopenmc PRIVATE LIBMESH )
520+ target_compile_definitions (libopenmc PRIVATE OPENMC_LIBMESH_ENABLED )
515521 target_link_libraries (libopenmc PkgConfig::LIBMESH )
516522endif ()
517523
@@ -534,11 +540,6 @@ if (OPENMC_BUILD_TESTS)
534540 add_subdirectory (tests/cpp_unit_tests )
535541endif ()
536542
537- if (OPENMC_USE_MCPL)
538- target_compile_definitions (libopenmc PUBLIC OPENMC_MCPL )
539- target_link_libraries (libopenmc MCPL::mcpl )
540- endif ()
541-
542543#===============================================================================
543544# Log build info that this executable can report later
544545#===============================================================================
0 commit comments