Docker configuration

Hello,
I am a Windows user and I a trying to figure out how to work with OpenMC.
I followed the Docker way since it seems the simpler one, so following the intructions in the User’s guide I successfully downloaded it and the execution of the command in the powershell:

docker run openmc/openmc:latest

went well.

Then, looking at both the forum as well as the Developer’s guide Sec.7, I was stucked at the first line:

docker build -t debian/openmc:latest https://github.com/openmc-dev/openmc.git#develop

since the procedure stops and gives me an error:

PS C:\Users\loren> docker build -t debian/openmc:latest https://github.com/openmc-dev/openmc.git#develop
[+] Building 24.4s (10/11)
 => CACHED [internal] load git source https://github.com/openmc-dev/openmc.git#develop                                                                                                  0.0s
 => [internal] load metadata for docker.io/library/debian:bullseye-slim                                                                                                                 1.8s
 => [auth] library/debian:pull token for registry-1.docker.io                                                                                                                           0.0s
 => [1/8] FROM docker.io/library/debian:bullseye-slim@sha256:78fd65998de7a59a001d792fe2d3a6d2ea25b6f3f068e5c84881250373577414                                                           0.0s
 => CACHED [2/8] RUN apt-get update -y &&     apt-get upgrade -y &&     apt-get install -y         python3-pip python-is-python3 wget git build-essential cmake         mpich libmpich  0.0s
 => CACHED [3/8] RUN pip install --upgrade pip                                                                                                                                          0.0s
 => CACHED [4/8] RUN cd /root     && git clone --single-branch --depth 1 https://github.com/njoy/NJOY2016     && cd NJOY2016     && mkdir build     && cd build     && cmake -Dstatic=  0.0s
 => CACHED [5/8] RUN if [ "off" = "on" ]; then         apt-get -y install libeigen3-dev libnetcdf-dev libtbb-dev libglfw3-dev         && pip install --upgrade numpy cython         &&  0.0s
 => CACHED [6/8] RUN if [ "off" = "on" ]; then         apt-get -y install m4 libnetcdf-dev libpnetcdf-dev         && mkdir -p /root/LIBMESH && cd /root/LIBMESH         && git clone -  0.0s
 => ERROR [7/8] RUN mkdir -p /root/OpenMC && cd /root/OpenMC     && git clone --shallow-submodules --recurse-submodules --single-branch -b master --depth=1 https://github.com/openmc  22.5s
------
 > [7/8] RUN mkdir -p /root/OpenMC && cd /root/OpenMC     && git clone --shallow-submodules --recurse-submodules --single-branch -b master --depth=1 https://github.com/openmc-dev/openmc     && mkdir build && cd build ;     if [ off = "on" ] && [ off = "on" ]; then         cmake ../openmc             -DOPENMC_USE_MPI=on             -DHDF5_PREFER_PARALLEL=on             -DOPENMC_USE_DAGMC=on             -DOPENMC_USE_LIBMESH=on             -DCMAKE_PREFIX_PATH="/root/DAGMC/;/root/LIBMESH" ;     fi ;     if [ off = "on" ] && [ off = "off" ]; then         cmake ../openmc             -DOPENMC_USE_MPI=on             -DHDF5_PREFER_PARALLEL=on             -DOPENMC_USE_DAGMC=ON             -DCMAKE_PREFIX_PATH=/root/DAGMC/ ;     fi ;     if [ off = "off" ] && [ off = "on" ]; then         cmake ../openmc             -DOPENMC_USE_MPI=on             -DHDF5_PREFER_PARALLEL=on             -DOPENMC_USE_LIBMESH=on             -DCMAKE_PREFIX_PATH=/root/LIBMESH ;     fi ;     if [ off = "off" ] && [ off = "off" ]; then         cmake ../openmc             -DOPENMC_USE_MPI=on             -DHDF5_PREFER_PARALLEL=on ;     fi ;     make 2>/dev/null -j1 install     && cd ../openmc && pip install .[test,depletion-mpi]     && python -c "import openmc":
#10 0.623 Cloning into 'openmc'...
#10 4.669 Submodule 'vendor/fmt' (https://github.com/fmtlib/fmt.git) registered for path 'vendor/fmt'
#10 4.670 Submodule 'vendor/gsl-lite' (https://github.com/martinmoene/gsl-lite.git) registered for path 'vendor/gsl-lite'
#10 4.672 Submodule 'vendor/pugixml' (https://github.com/zeux/pugixml.git) registered for path 'vendor/pugixml'
#10 4.673 Submodule 'vendor/xtensor' (https://github.com/xtensor-stack/xtensor.git) registered for path 'vendor/xtensor'
#10 4.674 Submodule 'vendor/xtl' (https://github.com/xtensor-stack/xtl.git) registered for path 'vendor/xtl'
#10 4.682 Cloning into '/root/OpenMC/openmc/vendor/fmt'...
#10 6.030 Cloning into '/root/OpenMC/openmc/vendor/gsl-lite'...
#10 6.973 Cloning into '/root/OpenMC/openmc/vendor/pugixml'...
#10 8.273 Cloning into '/root/OpenMC/openmc/vendor/xtensor'...
#10 10.05 Cloning into '/root/OpenMC/openmc/vendor/xtl'...
#10 13.05 From https://github.com/fmtlib/fmt
#10 13.05  * branch            d141cdbeb0fb422a3fb7173b285fd38e0d1772dc -> FETCH_HEAD
#10 13.15 Submodule path 'vendor/fmt': checked out 'd141cdbeb0fb422a3fb7173b285fd38e0d1772dc'
#10 14.95 From https://github.com/martinmoene/gsl-lite
#10 14.95  * branch            913e86d49c6a1acca980f4e325378f9dc393493a -> FETCH_HEAD
#10 15.00 Submodule path 'vendor/gsl-lite': checked out '913e86d49c6a1acca980f4e325378f9dc393493a'
#10 16.78 From https://github.com/zeux/pugixml
#10 16.78  * branch            41b6ff21c455865bb8ef67c5952b7f895b62bacc -> FETCH_HEAD
#10 16.83 Submodule path 'vendor/pugixml': checked out '41b6ff21c455865bb8ef67c5952b7f895b62bacc'
#10 19.06 From https://github.com/xtensor-stack/xtensor
#10 19.06  * branch            31acec1e90bbea6d4bc17af0710a123bd5da6689 -> FETCH_HEAD
#10 19.15 Submodule path 'vendor/xtensor': checked out '31acec1e90bbea6d4bc17af0710a123bd5da6689'
#10 20.97 From https://github.com/xtensor-stack/xtl
#10 20.97  * branch            c19750fb1488369dc41f6069bc2b8446fc093e75 -> FETCH_HEAD
#10 21.00 Submodule path 'vendor/xtl': checked out 'c19750fb1488369dc41f6069bc2b8446fc093e75'
#10 21.13 -- The C compiler identification is GNU 10.2.1
#10 21.26 -- The CXX compiler identification is GNU 10.2.1
#10 21.27 -- Detecting C compiler ABI info
#10 21.40 -- Detecting C compiler ABI info - done
#10 21.44 -- Check for working C compiler: /usr/bin/cc - skipped
#10 21.44 -- Detecting C compile features
#10 21.44 -- Detecting C compile features - done
#10 21.45 -- Detecting CXX compiler ABI info
#10 21.64 -- Detecting CXX compiler ABI info - done
#10 21.66 -- Check for working CXX compiler: /usr/bin/c++ - skipped
#10 21.66 -- Detecting CXX compile features
#10 21.66 -- Detecting CXX compile features - done
#10 21.67 -- Did not find fmt, will use submodule instead
#10 21.67 -- Did not find pugixml, will use submodule instead
#10 21.68 -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
#10 21.69 -- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.37")
#10 22.19 -- Found HDF5: /usr/lib/x86_64-linux-gnu/hdf5/mpich/libhdf5.so;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.10.6") found components: C HL
#10 22.19 CMake Error at CMakeLists.txt:107 (message):
#10 22.19   Parallel HDF5 was detected, but the detected compiler, /usr/bin/c++, does
#10 22.19   not support MPI.  An MPI-capable compiler must be used with parallel HDF5.
#10 22.19
#10 22.19
#10 22.19 -- Configuring incomplete, errors occurred!
#10 22.19 See also "/root/OpenMC/build/CMakeFiles/CMakeOutput.log".
------
executor failed running [/bin/sh -c mkdir -p ${HOME}/OpenMC && cd ${HOME}/OpenMC     && git clone --shallow-submodules --recurse-submodules --single-branch -b ${openmc_branch} --depth=1 ${OPENMC_REPO}     && mkdir build && cd build ;     if [ ${build_dagmc} = "on" ] && [ ${build_libmesh} = "on" ]; then         cmake ../openmc             -DOPENMC_USE_MPI=on             -DHDF5_PREFER_PARALLEL=on             -DOPENMC_USE_DAGMC=on             -DOPENMC_USE_LIBMESH=on             -DCMAKE_PREFIX_PATH="${DAGMC_INSTALL_DIR};${LIBMESH_INSTALL_DIR}" ;     fi ;     if [ ${build_dagmc} = "on" ] && [ ${build_libmesh} = "off" ]; then         cmake ../openmc             -DOPENMC_USE_MPI=on             -DHDF5_PREFER_PARALLEL=on             -DOPENMC_USE_DAGMC=ON             -DCMAKE_PREFIX_PATH=${DAGMC_INSTALL_DIR} ;     fi ;     if [ ${build_dagmc} = "off" ] && [ ${build_libmesh} = "on" ]; then         cmake ../openmc             -DOPENMC_USE_MPI=on             -DHDF5_PREFER_PARALLEL=on             -DOPENMC_USE_LIBMESH=on             -DCMAKE_PREFIX_PATH=${LIBMESH_INSTALL_DIR} ;     fi ;     if [ ${build_dagmc} = "off" ] && [ ${build_libmesh} = "off" ]; then         cmake ../openmc             -DOPENMC_USE_MPI=on             -DHDF5_PREFER_PARALLEL=on ;     fi ;     make 2>/dev/null -j${compile_cores} install     && cd ../openmc && pip install .[test,depletion-mpi]     && python -c "import openmc"]: exit code: 2

I apologize for the long error’s wall of text.

Am I doing it wrong/skipping some passage?
Do you have any suggestion to complete the image creation?
Do you think that using a virtual machine and downloading openMC from source will be easier?

Thank you very much for helping.

Sincerely,
Lorenzo

Welcome to the forum @lorenzoloi

docker run command will download the image first if it’s not found locally. After that, to run a container, the only thing you need to include in the command is the image on which it is based.

docker run openmc/openmc:latest

Thanks for the reply and sorry for the delay @Pranto.

I’ve still some problems in working with OpenMC.

Once i’ve pasted in the powershell the command:

docker run openmc/openmc:latest

the image is correctly downloaded.
Then, i paste the following in order to go inside the interactive container called my_openmc:

docker run -it --name=my_openmc openmc/openmc:latest

at this point, according to other posts in this forum and also to the docker official documentation regarding openmc at: openmc/openmc - Docker Image | Docker Hub, I should be inside an environment with installed OpenMC in the /opt folder.

However, this folder is empy.
I also tried to copy one of the pincell examples /root/OpenMC/openmc/examples/pincell inside a directory but it gives me the same error which is:

python build_xml.py
Traceback (most recent call last):
File “/opt/prova/build_xml.py”, line 4, in
import openmc
ModuleNotFoundError: No module named ‘openmc’

Am I doing it wrong something?

Thank you very much and sorry to bother.

Unfortunately the last docker image release didn’t run the pip install . command correctly to install the python api for openmc.

We aim to release another docker image that will replace the latest image and we have fixed the issue in the develop branch with this PR

In the meantime you could build the docker image which takes a bit longer but should work

git clone https://github.com/openmc-dev/openmc.git
cd openmc
docker build -t my_openmc .

Sorry for this inconvenience, let us know if this works for you

Hello @Shimwell,
I successfully cloned openmc from git in my personal laptop. Unfortunately, the last command

docker build -t my_openmc .

face an error during the configuration with an exit code=2.

I think that I will wait the release of the replacement to the latest image, which seems to me the easier way.

Can I ask you how may I know when it will be released?
Thank you very much

@lorenzoloi I’m hoping to get a release out within the next month.

1 Like