From 4b2e6ea2f4321d3a73f86ac23b955bc62474ecdc Mon Sep 17 00:00:00 2001 From: Jon Shimwell Date: Mon, 11 Nov 2024 10:03:54 +0100 Subject: [PATCH 1/2] downloading (fetch) dagmc if not found --- CMakeLists.txt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 575e45373ae..a453c59a890 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ option(OPENMC_USE_OPENMP "Enable shared-memory parallelism with OpenMP" option(OPENMC_BUILD_TESTS "Build tests" ON) option(OPENMC_ENABLE_PROFILE "Compile with profiling flags" OFF) option(OPENMC_ENABLE_COVERAGE "Compile with coverage analysis flags" OFF) -option(OPENMC_USE_DAGMC "Enable support for DAGMC (CAD) geometry" OFF) +option(OPENMC_USE_DAGMC "Enable support for DAGMC (CAD) geometry" ON) option(OPENMC_USE_LIBMESH "Enable support for libMesh unstructured mesh tallies" OFF) option(OPENMC_USE_MPI "Enable MPI" OFF) option(OPENMC_USE_MCPL "Enable MCPL" OFF) @@ -119,7 +119,18 @@ endif() #=============================================================================== if(OPENMC_USE_DAGMC) - find_package(DAGMC REQUIRED PATH_SUFFIXES lib/cmake) + find_package(DAGMC QUIET PATH_SUFFIXES lib/cmake) + if(NOT DAGMC_FOUND) + message(STATUS "DAGMC not found, fetching from repository") + include(FetchContent) + FetchContent_Declare( + dagmc + GIT_REPOSITORY https://github.com/svalinn/DAGMC.git + GIT_TAG v3.2.3 + ) + FetchContent_MakeAvailable(dagmc) + find_package(DAGMC REQUIRED PATH_SUFFIXES lib/cmake) + endif() if (${DAGMC_VERSION} VERSION_LESS 3.2.0) message(FATAL_ERROR "Discovered DAGMC Version: ${DAGMC_VERSION}." "Please update DAGMC to version 3.2.0 or greater.") From 81f19112c15211747dfdd9ff12dbc805de2424f9 Mon Sep 17 00:00:00 2001 From: Jon Shimwell Date: Mon, 11 Nov 2024 10:05:51 +0100 Subject: [PATCH 2/2] default off --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a453c59a890..c5f7035a2ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ option(OPENMC_USE_OPENMP "Enable shared-memory parallelism with OpenMP" option(OPENMC_BUILD_TESTS "Build tests" ON) option(OPENMC_ENABLE_PROFILE "Compile with profiling flags" OFF) option(OPENMC_ENABLE_COVERAGE "Compile with coverage analysis flags" OFF) -option(OPENMC_USE_DAGMC "Enable support for DAGMC (CAD) geometry" ON) +option(OPENMC_USE_DAGMC "Enable support for DAGMC (CAD) geometry" OFF) option(OPENMC_USE_LIBMESH "Enable support for libMesh unstructured mesh tallies" OFF) option(OPENMC_USE_MPI "Enable MPI" OFF) option(OPENMC_USE_MCPL "Enable MCPL" OFF)