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

Automatic download and build of MOAB #969

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

bam241
Copy link
Member

@bam241 bam241 commented Dec 4, 2024

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

  • add a make files that contains the proper ExternalProject configuration
  • add a CMAKE variable to enable pull and build and change the dips and link for the other DAGMC library

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

  • Done

This is very much inspired by @ahnaf-tahmid-chowdhury work on PyNE cmake.

This works is sponsored by Proxima Fusion

@bam241
Copy link
Member Author

bam241 commented Dec 4, 2024

@ahnaf-tahmid-chowdhury @shimwell @gonuke even if this is still a draft, feel free to provide any feed back!

src/pyne/CMakeLists.txt Outdated Show resolved Hide resolved
src/dagmc/CMakeLists.txt Outdated Show resolved Hide resolved
Comment on lines 122 to 123
else()
# message(FATAL_ERROR "Could not find MOAB")
Copy link
Member Author

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

@bam241
Copy link
Member Author

bam241 commented Dec 4, 2024

The safeguard I added should be improve... (i.e.: have them only MOAB download is triggered...)

cmake/FindMOAB.cmake Outdated Show resolved Hide resolved
cmake/FindMOAB.cmake Outdated Show resolved Hide resolved
@bam241 bam241 marked this pull request as ready for review December 6, 2024 06:42
@bam241 bam241 requested a review from gonuke December 6, 2024 06:54
@bam241
Copy link
Member Author

bam241 commented Dec 6, 2024

@gonuke this still needs some polishing here and there, but I think this is ready for a first opinion.

bam241 and others added 4 commits December 6, 2024 12:30
change location

cmake up

cmake up

cmake up

CMAKE_MODULE_PATH

CMAKE_MODULE_PATH

CMAKE_MODULE_PATH

adding LIBS

adding LIBS

install_dependent_library(MOAB )

install_dependent_library

adding LIBS

adding LIBS

adding LIBS

adding LIBS

adding LIBS

adding LIBS

adding LIBS

adding LIBS

instal_prefix

instal_prefix

instal_prefix

instal_prefix

instal_prefix

instal_prefix

instal_prefix

instal_prefix

instal_prefix

instal_prefix

INTERFACE

INTERFACE

INTERFACE

INTERFACE

INTERFACE

INTERFACE

INTERFACE

INTERFACE

INTERFACE

INTERFACE

INTERFACE

INTERFACE

INTERFACE

INTERFACE

tmp

get the safeguard

revert unnecessary change
Co-authored-by: Jonathan Shimwell <[email protected]>
Co-authored-by: Jonathan Shimwell <[email protected]>
Copy link
Member

@ahnaf-tahmid-chowdhury ahnaf-tahmid-chowdhury left a 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/DAGMC_macros.cmake Outdated Show resolved Hide resolved
cmake/MOAB_PullAndMake.cmake Outdated Show resolved Hide resolved
-DBUILD_SHARED_LIBS:BOOL=ON
-DENABLE_HDF5:BOOL=ON
-DHDF5_ROOT:PATH=${HDF5_ROOT}
-DCMAKE_INSTALL_RPATH=${HDF5_ROOT}/lib:${MOAB_INSTALL_PREFIX}/lib

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.

Copy link
Member Author

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 ?

Copy link
Member

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}

Copy link
Member Author

Choose a reason for hiding this comment

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

Trying it now.

@@ -50,6 +50,9 @@ jobs:
5.4.1,
5.5.1,
]
ddl_deps : [

Choose a reason for hiding this comment

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

What is the use of it?

Choose a reason for hiding this comment

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

This is like Enable Download MOAB or Double Down?

Copy link
Member Author

Choose a reason for hiding this comment

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

this only enables MOAB Download, otherwise everything work as it used to.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't have a strong opinion about the name of the variable,
but eventually one might want to include Embree and DD the same way...

if your question is about the addition into the matrix, I needed it to allow the CI to test for this kind of build...

Copy link
Member Author

Choose a reason for hiding this comment

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

this seems to pass, I'll revert the change

@jon-proximafusion
Copy link

jon-proximafusion commented Dec 10, 2024

Testing locally with this docker file and it compiles for me
Note this points to Bam's fork and this PR branch
Also note, this example is very minimal with no DD, Embree, Pyne

FROM ubuntu:24.04

RUN apt-get update -y
RUN apt-get install git cmake libhdf5-serial-dev g++ libeigen3-dev -y 

RUN mkdir DAGMC && \
	cd DAGMC && \
	git clone --single-branch --branch auto_moab --depth 1 https://github.com/bam241/DAGMC.git && \
	mkdir build && \
	cd build && \
	cmake ../DAGMC -DBUILD_TALLY=ON \
                   -DBUILD_STATIC_EXE=OFF \
                   -DBUILD_STATIC_LIBS=OFF \
                   -DCMAKE_INSTALL_PREFIX=/DAGMC/ \
                   -DBUILD_UWUW=OFF \
                   -DDDL_INSTALL_DEPS=ON && \
	make -j install

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.

4 participants