Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch DAGMC if not found in cmakelists.txt #3193

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +128 to +129
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried changing it to point to my branch where auto_moab is DDDL_INSTALL_DEPS=ON by default

Suggested change
GIT_REPOSITORY https://github.com/svalinn/DAGMC.git
GIT_TAG v3.2.3
GIT_REPOSITORY https://github.com/shimwell/DAGMC.git
GIT_TAG 8510f8efa3937480bdab9a77d3c51da17b5d0875

I've also tried pointing to @bam241 branch where DDDL_INSTALL_DEPS flag would need setting to ON

Suggested change
GIT_REPOSITORY https://github.com/svalinn/DAGMC.git
GIT_TAG v3.2.3
GIT_REPOSITORY https://github.com/bam241/DAGMC.git
GIT_TAG 99222f6d046da82710bfa8e9e9859d13fbd1f4d2

)
FetchContent_MakeAvailable(dagmc)
find_package(DAGMC REQUIRED PATH_SUFFIXES lib/cmake)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
find_package(DAGMC REQUIRED PATH_SUFFIXES lib/cmake)
set(DAGMC_DIR "${CMAKE_BINARY_DIR}/_deps/dagmc-build")
set(DAGMC_CONFIG_DIR ${DAGMC_DIR}/lib/cmake/dagmc)
list(APPEND CMAKE_PREFIX_PATH ${DAGMC_CONFIG_DIR})
find_package(DAGMC REQUIRED PATH_SUFFIXES lib/cmake)

this appears to help find one of the dagmc cmake files but not the DAGMCTargets.cmake file.
Worryingly I also can't see this file using the find . -name "*.cmake" command to search for .cmake file

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.")
Expand Down
Loading