-
Notifications
You must be signed in to change notification settings - Fork 65
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
Automatic download and build of MOAB #969
Conversation
@ahnaf-tahmid-chowdhury @shimwell @gonuke even if this is still a draft, feel free to provide any feed back! |
cmake/FindMOAB.cmake
Outdated
else() | ||
# message(FATAL_ERROR "Could not find MOAB") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should still return a fatal_error if ExternalProject
encounters an issue
The safeguard I added should be improve... (i.e.: have them only MOAB download is triggered...) |
@gonuke this still needs some polishing here and there, but I think this is ready for a first opinion. |
d49d208
to
45feb89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for the update. I have a few comments for improvement.
cmake/MOAB_PullAndMake.cmake
Outdated
-DBUILD_SHARED_LIBS:BOOL=ON | ||
-DENABLE_HDF5:BOOL=ON | ||
-DHDF5_ROOT:PATH=${HDF5_ROOT} | ||
-DCMAKE_INSTALL_RPATH=${HDF5_ROOT}/lib:${MOAB_INSTALL_PREFIX}/lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method may work here for now, but may create trouble while working with scikit-build-core depended project. However, I am not sure here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no experience about scikit-build-core
, maybe we shall fix it, if the problem occurs ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe MOAB master branch now has scikit-build core while version 5.5.1 does not.
Perhaps changing the moab version to master would provide a quick way of checking if this continues to work
GIT_REPOSITORY https://bitbucket.org/fathomteam/moab.git
GIT_TAG ${moab_version}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to mention @bam241 tried this with the master branch of MOAB (which has scikit build core) and reported that it works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have a doubt about what I did, I'll try one more time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any final resolution on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing locally with this docker file and it compiles for me
|
IMO this PR makes building DAGMC easier for users. Currently we ask users to compile MOAB and then compile DAGMC passing some of the info on MOAB to the DAGMC compile. I believe the current situation is overly complicated. This PR simplifies the compile for users which I think will be appreciated and lowers the bar slightly for installing DAGMC which might help bring in a few more users. Additionally it retains backwards compatibility so if someone does what to compile both MOAB and DAGMC in the current way then they can still do that. The main change I would suggest is that we make the *update this also now allows users to specific the version of MOAB automatically downloaded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments trying to streamline and localize these changes.
cmake/FindMOAB.cmake
Outdated
if (MOAB_CMAKE_CONFIG) | ||
|
||
# First check if we are forcing the download of MOAB | ||
if (PULL_INSTALL_MOAB) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we thought about whether we put this condition up one level? That is, if we are going to PULL_INSTALL, then we don't call FindPackage
at all and just do this macro instead? Then we don't need to mess with the FindMOAB
file. I think that will work???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm nominally on board here and want to make the installation process easier, but I do have concerns. There are secondary dependencies to consider and how we might specify those to the direct dependencies of MOAB. For example, there's a requirement here for an HDF5_ROOT
that's expected to be set prior to the CMake call (from what I can tell).
I think what's here really would make the installation process better for all, but I do want to think through these scenarios thoroughly.
cmake/MOAB_PullAndMake.cmake
Outdated
-DBUILD_SHARED_LIBS:BOOL=ON | ||
-DENABLE_HDF5:BOOL=ON | ||
-DHDF5_ROOT:PATH=${HDF5_ROOT} | ||
-DCMAKE_INSTALL_RPATH=${HDF5_ROOT}/lib:${MOAB_INSTALL_PREFIX}/lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any final resolution on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, meant to comment not approve.. yet 😄
💔 |
IMO you should also add |
@gonuke, I moved this 1 level. I added a |
I might be tempted not to allow "ON" as an option. What do others think?
I might be tempted to use 'latest' or 'develop' as options by that is another topic. |
Co-authored-by: Patrick Shriwise <[email protected]>
|
||
INCLUDE(ExternalProject) | ||
MESSAGE("HDF5_ROOT: ${HDF5_ROOT}") | ||
SET(MOAB_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/moab") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems MOAB is going to be installed in a custom path, which means only DAGMC will have access to it, as it will use the rpath. This is a good approach, and we can apply the same strategy for HDF5 as well. However, I think we can use the same CMAKE_INSTALL_PREFIX
for both DAGMC and MOAB instead of CMAKE_INSTALL_PREFIX}/moab
, as there are no conflicts having the same file name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did put the MOAB installation there, because I though about scenarii where users would already have MOAB installed on it computer but would try an installation of DAGMC against a different version of MOAB.
To avoid conflict, I rather have MOAB installed in the DAGMC install dir, as it is installed through DAGMC.
Also if one would come to uninstall DAGMC by removing the install dir, it would make sense to remove MOAB at the same time.
Really like the idea behind this feature so I though I should give it a try. Happy to simplify the install process Running this and I think the autodownloading of moab assumes that moab is available in the path
|
Hello @rherrero-pf thanks for testing my working the error you get is: |
Thanks @bam241 confirming this slightly adapted version works for me
then when installing openmc one needs to pass the DAGMC path to openmc like this
*updated now that the PR is merged to point to svalinn repo and also includes full openmc instructions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks pretty good - a few final clarifications
CMakeLists.txt
Outdated
set(MOAB_VERSION ${PULL_INSTALL_MOAB}) | ||
|
||
# Ensure MOAB_VERSION | ||
if(${MOAB_VERSION}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me what conditions re true for this? It seems like it would evaluate to true if I DID set the version? but maybe I don't know how this CMake evaluates if(5.5.3)
, for example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(<variable>)
True if given a variable that is defined to a value that is not a false constant. False otherwise, including if the variable is undefined. Note that macro arguments are not variables.
``` from https://cmake.org/cmake/help/latest/command/if.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a version string evaluated as a "False" constant then? I would have assumed that a version string would evaluate as True
and cause this message and default to happen??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right I miss understood this. I'll fix it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gonuke this should take care of it !
CMakeLists.txt
Outdated
if(NOT ${MOAB_VERSION} MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]") | ||
MESSAGE("MOAB_VERSION: ${MOAB_VERSION} not recognized. Defaulting to 5.5.1") | ||
set(MOAB_VERSION "5.5.1") | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should enforce MOAB_VERSION to be shaped as X.Y.Z with X, Y, Z as numbers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work even if we have a number that takes 2 chars, e.g. 5.5.10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe not I'll try and fix it if not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested fix for number regex
Co-authored-by: Paul Wilson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but you seem to have messed up some indentation... just want that fixed, please.
cmake/DAGMC_macros.cmake
Outdated
if(PULL_INSTALL_MOAB) | ||
target_link_libraries(${lib_name}-shared INTERFACE ${MOAB_LIBRARY_DIRS}/libMOAB${CMAKE_SHARED_LIBRARY_SUFFIX}) | ||
add_dependencies(${lib_name}-shared MOAB) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix this indentation, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - I'd be happy to have one other person take a last look... @pshriwise ?
Gave this another look today. Thanks @bam241! |
This caused a test to fail on merge. We have a test that checks to see if we are compatible with the |
I don't see the failing test. |
found it |
It doesn't really matter now, I don't think, since tests pass with the specific version of HDF5, but it may be a sign for the future? |
I think I am the one who broke it: |
I revert the change I did on the findMOAB.cmake (responsible to deal with HDF5) and it works |
Description
Add capability to automate pull and build MOAB at DAGMC building time
This is redondant with #964
Motivation and Context
This is part of the project from @shimwell on getting a pip install for OpenMC with DAGMC.
Changes
tweaked a little bit the
findMOAB.cmake
Behavior
Nothing changes if DDL_DEPS is not set at ON on Cmake configuration.
Otherwise pull build MOAB from MOAB repo builds it, and build the DAGMC lib against it.
Changelog file
This is very much inspired by @ahnaf-tahmid-chowdhury work on PyNE cmake.
This works is sponsored by Proxima Fusion

