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

Adding moab download if not found via fetch content #964

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

shimwell
Copy link
Member

@shimwell shimwell commented Nov 11, 2024

Description

To help with this PR on the openmc repo we would need DAGMC to fetch MOAB if it is not automatically found. Just making this PR to show the idea, this won't currently work as I think changes in MOAB are needed

Motivation and Context

This could ultimately allow openmc to be installed with dagmc without the user having to specify dirs for moab and dagmc and install them prior to the openmc compile.

Changes

changes to the cmakelists.txt

Behavior

current: if moab is not found cmake command terminals
with this PR: if moab not found moab gets downloaded

TODO

Changelog file

All pull requests are required to update the CHANGELOG file with the PR. Your update can take different forms including:

  • creating a new entry describing your change, including a reference to this pull request number
  • adding a reference to your pull request number to an exist entry if that entry can include your changes

@shimwell shimwell marked this pull request as draft November 11, 2024 13:44
@gonuke
Copy link
Member

gonuke commented Nov 11, 2024

We'd probably also want to do the same with Embree and double down?

@shimwell
Copy link
Member Author

shimwell commented Nov 11, 2024

Yes, keen to add them,

they would fist have to check that double down is enabled and if so then fetch the contents. Also they might need changes to the repos.

So perhaps best to keep the PR minimal and see if we can get something simple workign first. To get this working I think we need some changes in moab

@pshriwise pshriwise closed this Nov 11, 2024
@pshriwise pshriwise reopened this Nov 11, 2024
@pshriwise
Copy link
Member

Ah sorry! Mis-clicked and closed this momentarily.

@makeclean
Copy link
Contributor

Double down will be fun due to the double-down -> embree -> OneTbb

@ahnaf-tahmid-chowdhury
Copy link
Member

I am not a fan of using FetchContent; instead, if possible, I prefer using ExternalProject, as it allows us to build MOAB with HDF5 support.

@shimwell
Copy link
Member Author

I am not a fan of using FetchContent; instead, if possible, I prefer using ExternalProject, as it allows us to build MOAB with HDF5 support.

Interesting, I shall make a draft PR for ExternalProject and we can compare the two approaches.

I though hdf5 was automatically brought into moab after this PR so perhaps this is not a problem anymore (after the next moab release)?

@ahnaf-tahmid-chowdhury
Copy link
Member

I have noticed that current master branch doesn't have HDF5 enabled by default.

GIT_REPOSITORY https://bitbucket.org/fathomteam/moab.git
GIT_BRANCH master
# GIT_TAG 5.5.1
)
Copy link
Member Author

@shimwell shimwell Nov 12, 2024

Choose a reason for hiding this comment

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

How about we add HDF5 and other cmake args like this and then we can still use fetch

Suggested change
)
CMAKE_ARGS
-DENABLE_HDF5=ON
-DENABLE_NETCDF=ON
-DBUILD_SHARED_LIBS=OFF
-DENABLE_FORTRAN=OFF
-DENABLE_BLASLAPACK=OFF
)

Choose a reason for hiding this comment

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

I am not sure if it's a vaild command for FetchContent_Declare, but it is available in ExternalProject_Add. For more: https://discourse.cmake.org/t/fetchcontent-declare-with-cmake-args-does-not-work/11227/2

@ahnaf-tahmid-chowdhury
Copy link
Member

I think, if you don't mind, I should consider creating a PR with ExternalProject_Add since I have some previous experience with that. Or, You may find how I did this on PyNE.

@shimwell
Copy link
Member Author

I think, if you don't mind, I should consider creating a PR with ExternalProject_Add since I have some previous experience with that. Or, You may find how I did this on PyNE.

Sounds good to me, I think eitherway (fetch or external) we will bump into this issue.

@shimwell
Copy link
Member Author

shimwell commented Nov 14, 2024

I've made a small change to the MOAB cmakelists.txt on a fork and making use of that fork for now in this fetch command.

This change gets further through the compile

The new error starts with ...

CMake Error at build/_deps/moab-src/src/io/CMakeLists.txt:111 (add_library):
  add_library cannot create target "moabio" because another target with the
  same name already exists.  The existing target is created in source
  directory "/home/jon/DAGMC/build/_deps/moab-src/src/io".  See documentation
  for policy CMP0002 for more details.

...

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.

6 participants