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

Conversation

jon-proximafusion
Copy link
Contributor

@jon-proximafusion jon-proximafusion commented Nov 11, 2024

Description

Marked as draft as this PR is mainly to check with @gonuke and @pshriwise if they would be keen on something like this?

Many other packages are included via submodule and they get smoothly installed during the compile so I was looking for ways of making the DAGMC install a bit smoother for users

I was just wondering if it is worth making the inclusion of DAGMC when compiling a little easier by automatically fetching the repo if it is requested and not found locally.

Changes like this to the cmakelists file could allow users to compile with dagmc like this

cmake .. -DOPENMC_USE_DAGMC=ON

This would provide a different route instead of cloning dagmc, compiling dagmc, cloning moab, compiling moab, passing directories to each cmake command etc.

ps this would need a small change in dagmc to fetch moab for this to work and changes in moab to make the repo more compatible with the fetch content. This issue is related

Fixes # (issue)

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

Comment on lines +128 to +129
GIT_REPOSITORY https://github.com/svalinn/DAGMC.git
GIT_TAG v3.2.3
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

@shimwell
Copy link
Member

Just to mention I've been trying to get this branch working locally and making use of @bam241 DAGMC branch (auto_moab) but can't quite get it to find the libraries

current error is

CMake Error at CMakeLists.txt:137 (find_package):
  Could not find a package configuration file provided by "DAGMC" with any of
  the following names:

    DAGMCConfig.cmake
    dagmc-config.cmake

@bam241
Copy link
Contributor

bam241 commented Dec 12, 2024

My guess is your problem is there:
find_package(DAGMC QUIET PATH_SUFFIXES lib/cmake)
because the current build system supposes that DAGMC is installed. and relies on a FindDAGMC provided by DAGMC itself.

GIT_TAG v3.2.3
)
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants