-
Notifications
You must be signed in to change notification settings - Fork 533
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
Adding optional dagmc to docker #1725
Conversation
Just converting this to a draft as it will need updating once the DAGMC release is complete. |
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 pulled this Dockerfile down to try it out and it worked great. Just a few small items/questions here.
Dockerfile
Outdated
cd pymoab ; \ | ||
bash install.sh ; \ | ||
python setup.py install ; \ |
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 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.
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 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.
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.
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
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.
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.
- Install MOAB to the default location without a
CMAKE_INSTALL_PREFIX
. This will default to the system python modules directory for thepymoab
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.
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 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.
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 an installation prefix is not specified, CMake will install to /usr/local/
by default. So -DMOAB_DIR=/usr/local
should do the trick.
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.
Thanks for that, appears to work just fine over here
Co-authored-by: Patrick Shriwise <[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.
Tried out these updates and they work great. Thanks, @shimwell!
Just a couple of minor items and this should be ready to go.
Co-authored-by: Patrick Shriwise <[email protected]>
Thanks Patrick, sorry for the indent mess and thanks for removing that extra DPYMOAB_PREFIX flag |
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 good, @shimwell. Thank you!
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.