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 optional dagmc to docker #1725

Merged
merged 15 commits into from
Jan 2, 2021
Merged

Adding optional dagmc to docker #1725

merged 15 commits into from
Jan 2, 2021

Conversation

shimwell
Copy link
Member

This PR contains an updated dockerfile that allows optional building of OpenMC with DAGMC

This PR has been discussed in issue #1709 with advice from @pshriwise and @makeclean

There are a few other files to go with the updated Dockerfile.

There are three yml files that will help keep the docker images on dockerhub that contain this optional dagmc build upto date in a similar manner to #1678

This is a nice install of DAGMC as it includes some packages that speed up DAGMC such as double-down and Embree. Thanks to @makeclean for a nice sample script.

Also the use of FORTRAN is avoided in the MOAB build through the use of the DENABLE_FORTRAN option. Thanks to @bam241 for a nice example of how to do that.

@shimwell shimwell marked this pull request as draft November 24, 2020 21:15
@shimwell
Copy link
Member Author

Just converting this to a draft as it will need updating once the DAGMC release is complete.

Copy link
Contributor

@pshriwise pshriwise left a comment

Choose a reason for hiding this comment

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

I pulled this Dockerfile down to try it out and it worked great. Just a few small items/questions here.

Dockerfile Outdated
Comment on lines 98 to 100
cd pymoab ; \
bash install.sh ; \
python setup.py install ; \
Copy link
Contributor

Choose a reason for hiding this comment

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

I suspect these few lines were added to ensure Python could find the pymoab module. I think a safer way to do this (for now) is to set the -DPYMOAB_PREFIX value in the CMake command or to add the installation location of pymoab to the PYTHONPATH.

This approach stems from a desire to have pymoab installed as part of the standard MOAB builds (i.e. along with the autotools/CMake steps). Someday I'd like to move this to a more standard method of installation for Python packages, but it's where that project is at for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm going to look into this more. pymoab is working just fine in the Docker image. It's nice to know that this could be a viable alternative for installing that package.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for looking at the options here. I didn't get around to trying -DPYMOAB_PREFIX or PYTHONPATH yesterday but whatever you recommend or the current method sounds fine to me

Copy link
Contributor

@pshriwise pshriwise Dec 23, 2020

Choose a reason for hiding this comment

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

So I looked into this a bit more. As it stands the Dockerfile installs pymoab a total of three times in two different locations. Once with the make command, another with install.sh, and yet again with the python setup.py install command.

There's no harm in it other than being potentially confusing or winding up importing a pymoab version you weren't expecting to if a reinstall of MOAB is performed in the image. Overall, it would be nice to simplify that so it only exists in one place. To do that there are two options I can suggest:

1. Set thePYMOAB_INSTALL_PREFIX CMake variable directly in the CMake step.

This allows you to specify the exact location to install the module. /usr/local/lib/python3.8/dist-packages in this case.

  1. Install MOAB to the default location without a CMAKE_INSTALL_PREFIX. This will default to the system python modules directory for the pymoab installation.

Either of those solutions should install pymoab to the system location with the make install command.

Update: The former does not work 😞. I'd recommend installing without a CMake prefix to avoid use of the PYTHONPATH variable and install pymoab to the system python location.

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 can see pymoab is installing when the two -DCMAKE_INSTALL_PREFIX=\MOAB \ lines are removed from the MOAB install.

I'm wondering what to put in the next stage of the dockerfile which builds double-down, this needs to know the -DMOAB_DIR

I tried setting -DMOAB_DIR=/MOAB/build/ but this appears to have not worked in other ways.

Screenshot from 2020-12-25 19-48-57

Copy link
Contributor

Choose a reason for hiding this comment

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

If an installation prefix is not specified, CMake will install to /usr/local/ by default. So -DMOAB_DIR=/usr/local should do the trick.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for that, appears to work just fine over here

Copy link
Contributor

@pshriwise pshriwise left a comment

Choose a reason for hiding this comment

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

Tried out these updates and they work great. Thanks, @shimwell!

Just a couple of minor items and this should be ready to go.

@shimwell
Copy link
Member Author

Thanks Patrick, sorry for the indent mess and thanks for removing that extra DPYMOAB_PREFIX flag

@shimwell shimwell marked this pull request as ready for review December 29, 2020 19:06
Copy link
Contributor

@pshriwise pshriwise left a comment

Choose a reason for hiding this comment

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

Looks good, @shimwell. Thank you!

@pshriwise pshriwise merged commit 32918f0 into openmc-dev:develop Jan 2, 2021
@pshriwise pshriwise mentioned this pull request Jan 3, 2021
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.

2 participants