From 5e1ff2aa959bacbb0d6b2e96a989d8c20d807939 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 28 Sep 2021 23:04:41 +0100 Subject: [PATCH 01/20] libmesh not finding target --- Dockerfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Dockerfile b/Dockerfile index 89fec615ef..83352274c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -129,6 +129,18 @@ RUN if [ "$include_dagmc" = "true" ] ; \ rm -rf /DAGMC/DAGMC /DAGMC/build ; \ fi +# Clone and install libmesh +RUN mkdir libmesh ; \ + cd libmesh ; \ + git clone --single-branch --recurse-submodules --branch v1.6.0 https://github.com/libMesh/libmesh.git ; \ + # cd libmesh ; \ + # git submodule update --init --recursive ; \ + mkdir build ; \ + cd build ; \ + ../libmesh/configure --prefix=/opt/LIBMESH --enable-exodus --disable-netcdf-4 --disable-eigen --disable-lapack --disable-mpi ; \ + make -j"$compile_cores" ; \ + make -j"$compile_cores" install + # Clone and install OpenMC with DAGMC RUN if [ "$include_dagmc" = "true" ] ; \ then git clone --recurse-submodules https://github.com/openmc-dev/openmc.git /opt/openmc ; \ @@ -137,6 +149,8 @@ RUN if [ "$include_dagmc" = "true" ] ; \ cd build ; \ cmake -Doptimize=on \ -Ddagmc=ON \ + -Dlibmesh=ON \ + -DCMAKE_PREFIX_PATH=/opt/libmesh/ \ -DDAGMC_DIR=/DAGMC/ \ -DHDF5_PREFER_PARALLEL=on .. ; \ make -j"$compile_cores" ; \ From 91bd9eb67d104434fe1ceac688a0361db68d39c0 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 30 Sep 2021 23:49:07 +0100 Subject: [PATCH 02/20] added m4 package and depth=1 for clones --- Dockerfile | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 83352274c4..e32f54bdcb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ # To build with OpenMC # docker build -t openmc . +# To build with the develop branch of OpenMC +# docker build -t openmc --build-arg openmc_branch=develop. + # To build with OpenMC and DAGMC enabled # docker build -t openmc_dagmc --build-arg include_dagmc=true . @@ -9,6 +12,9 @@ FROM ubuntu:latest +# By default this Dockerfile builds the main branch of OpenMC +ARG openmc_branch=main + # By default this Dockerfile builds OpenMC without dagmc ARG include_dagmc=false @@ -29,7 +35,7 @@ RUN apt-get update -y && \ apt-get install -y \ python3-pip python-is-python3 wget git gfortran g++ cmake \ mpich libmpich-dev libhdf5-serial-dev libhdf5-mpich-dev \ - imagemagick && \ + imagemagick m4 && \ apt-get autoremove # Update system-provided pip @@ -41,14 +47,25 @@ RUN git clone https://github.com/njoy/NJOY2016.git /opt/NJOY2016 && \ mkdir build && cd build && \ cmake -Dstatic=on .. && make 2>/dev/null && make install +# Clone and install libmesh +RUN mkdir libmesh ; \ + cd libmesh ; \ + git clone --single-branch --shallow-submodules --recurse-submodules --branch v1.6.0 --depth 1 https://github.com/libMesh/libmesh.git ; \ + mkdir build ; \ + cd build ; \ + ../libmesh/configure --prefix=/opt/libmesh --enable-exodus --disable-netcdf-4 --disable-eigen --disable-lapack --disable-mpi ; \ + make -j"$compile_cores" ; \ + make -j"$compile_cores" install + # Clone and install OpenMC without DAGMC RUN if [ "$include_dagmc" = "false" ] ; \ - then git clone --recurse-submodules https://github.com/openmc-dev/openmc.git /opt/openmc ; \ + then git clone --shallow-submodules --recurse-submodules --branch "$openmc_branch" --depth=1 https://github.com/openmc-dev/openmc.git /opt/openmc ; \ cd /opt/openmc ; \ mkdir -p build ; \ cd build ; \ cmake -Doptimize=on \ - -DHDF5_PREFER_PARALLEL=on .. ; \ + -DHDF5_PREFER_PARALLEL=on .. \ + -DCMAKE_PREFIX_PATH=/opt/libmesh/ ; \ make -j"$compile_cores" ; \ make -j"$compile_cores" install ; \ cd .. ; \ @@ -65,7 +82,7 @@ RUN if [ "$include_dagmc" = "true" ] ; \ # Clone and install Embree RUN if [ "$include_dagmc" = "true" ] ; \ - then git clone --single-branch --branch v3.12.2 https://github.com/embree/embree.git ; \ + then git clone --single-branch --branch v3.12.2 --depth 1 https://github.com/embree/embree.git ; \ cd embree ; \ mkdir build ; \ cd build ; \ @@ -81,7 +98,7 @@ RUN if [ "$include_dagmc" = "true" ] ; \ mkdir MOAB ; \ cd MOAB ; \ mkdir build ; \ - git clone --single-branch --branch 5.2.1 https://bitbucket.org/fathomteam/moab.git ; \ + git clone --single-branch --branch 5.2.1 --depth 1 https://bitbucket.org/fathomteam/moab.git ; \ cd build ; \ cmake ../moab -DENABLE_HDF5=ON \ -DENABLE_NETCDF=ON \ @@ -102,7 +119,7 @@ RUN if [ "$include_dagmc" = "true" ] ; \ # Clone and install Double-Down RUN if [ "$include_dagmc" = "true" ] ; \ - then git clone --single-branch --branch main https://github.com/pshriwise/double-down.git ; \ + then git clone --single-branch --branch main --depth 1 https://github.com/pshriwise/double-down.git ; \ cd double-down ; \ mkdir build ; \ cd build ; \ @@ -117,7 +134,7 @@ RUN if [ "$include_dagmc" = "true" ] ; \ RUN if [ "$include_dagmc" = "true" ] ; \ then mkdir DAGMC ; \ cd DAGMC ; \ - git clone --single-branch --branch 3.2.0 https://github.com/svalinn/DAGMC.git ; \ + git clone --single-branch --branch 3.2.0 --depth 1 https://github.com/svalinn/DAGMC.git ; \ mkdir build ; \ cd build ; \ cmake ../DAGMC -DBUILD_TALLY=ON \ @@ -129,21 +146,9 @@ RUN if [ "$include_dagmc" = "true" ] ; \ rm -rf /DAGMC/DAGMC /DAGMC/build ; \ fi -# Clone and install libmesh -RUN mkdir libmesh ; \ - cd libmesh ; \ - git clone --single-branch --recurse-submodules --branch v1.6.0 https://github.com/libMesh/libmesh.git ; \ - # cd libmesh ; \ - # git submodule update --init --recursive ; \ - mkdir build ; \ - cd build ; \ - ../libmesh/configure --prefix=/opt/LIBMESH --enable-exodus --disable-netcdf-4 --disable-eigen --disable-lapack --disable-mpi ; \ - make -j"$compile_cores" ; \ - make -j"$compile_cores" install - # Clone and install OpenMC with DAGMC RUN if [ "$include_dagmc" = "true" ] ; \ - then git clone --recurse-submodules https://github.com/openmc-dev/openmc.git /opt/openmc ; \ + then git clone --shallow-submodules --recurse-submodules --branch "$openmc_branch" --depth=1 https://github.com/openmc-dev/openmc.git /opt/openmc ; \ cd /opt/openmc ; \ mkdir build ; \ cd build ; \ From 3d235b59dcfd235453d29f3a24ecde747083b65a Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 1 Oct 2021 21:17:53 +0100 Subject: [PATCH 03/20] added build arg to target develop branch in clone --- .github/workflows/dockerhub-publish-dev.yml | 1 + .github/workflows/dockerhub-publish-develop-dagmc.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/dockerhub-publish-dev.yml b/.github/workflows/dockerhub-publish-dev.yml index 73f62acaa2..a08d13e5ae 100644 --- a/.github/workflows/dockerhub-publish-dev.yml +++ b/.github/workflows/dockerhub-publish-dev.yml @@ -29,6 +29,7 @@ jobs: tags: openmc/openmc:develop build-args: | compile_cores=2 + openmc_branch=develop - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.github/workflows/dockerhub-publish-develop-dagmc.yml b/.github/workflows/dockerhub-publish-develop-dagmc.yml index 0ded0c180e..68924d1c7e 100644 --- a/.github/workflows/dockerhub-publish-develop-dagmc.yml +++ b/.github/workflows/dockerhub-publish-develop-dagmc.yml @@ -30,6 +30,7 @@ jobs: build-args: | include_dagmc=true compile_cores=2 + openmc_branch=develop - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} From c8c929bfbc3d3491284b185f9bffebeedf8031fe Mon Sep 17 00:00:00 2001 From: AI-Pranto Date: Tue, 5 Oct 2021 20:48:25 +0600 Subject: [PATCH 04/20] update and add yml scripts for libmesh build --- .../dockerhub-publish-develop-libmesh.yml | 36 +++ .../workflows/dockerhub-publish-libmesh.yml | 35 +++ Dockerfile | 296 ++++++++++-------- 3 files changed, 228 insertions(+), 139 deletions(-) create mode 100644 .github/workflows/dockerhub-publish-develop-libmesh.yml create mode 100644 .github/workflows/dockerhub-publish-libmesh.yml diff --git a/.github/workflows/dockerhub-publish-develop-libmesh.yml b/.github/workflows/dockerhub-publish-develop-libmesh.yml new file mode 100644 index 0000000000..07d0e917b1 --- /dev/null +++ b/.github/workflows/dockerhub-publish-develop-libmesh.yml @@ -0,0 +1,36 @@ +name: dockerhub-publish-develop-libmesh + +on: + push: + branches: develop + +jobs: + main: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: openmc/openmc:develop-dagmc + build-args: | + include_dagmc=true + compile_cores=2 + openmc_branch=develop + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.github/workflows/dockerhub-publish-libmesh.yml b/.github/workflows/dockerhub-publish-libmesh.yml new file mode 100644 index 0000000000..171ebb27e9 --- /dev/null +++ b/.github/workflows/dockerhub-publish-libmesh.yml @@ -0,0 +1,35 @@ +name: dockerhub-publish-latest-libmesh + +on: + push: + branches: master + +jobs: + main: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: openmc/openmc:latest-libmesh + build-args: | + include_libmesh=true + compile_cores=2 + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/Dockerfile b/Dockerfile index e32f54bdcb..6f41e454ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,168 +1,186 @@ -# To build with OpenMC +# To build with OpenMC and by default this Dockerfile builds the master branch of OpenMC. # docker build -t openmc . -# To build with the develop branch of OpenMC -# docker build -t openmc --build-arg openmc_branch=develop. +# To build with OpenMC develop branch +# docker build -t openmc_develop --build-arg OPENMC_BRANCH=develop . # To build with OpenMC and DAGMC enabled -# docker build -t openmc_dagmc --build-arg include_dagmc=true . +# docker build -t openmc_dagmc --build-arg include_dagmc=true --build-arg compile_cores=4 . -# To make use of multiple cores during the compile stages of the docker build -# docker build -t openmc_dagmc --build-arg compile_cores=8 . +# To build with OpenMC and Libmesh support +# docker build -t openmc_libmesh --build-arg include_libmesh=true --build-arg compile_cores=4 . + +# sudo docker run image_name:tag_name or ID with no tag sudo docker run ID number FROM ubuntu:latest -# By default this Dockerfile builds the main branch of OpenMC -ARG openmc_branch=main - -# By default this Dockerfile builds OpenMC without dagmc +# By default this Dockerfile builds OpenMC without DAGMC and LIBMESH support ARG include_dagmc=false +ARG include_libmesh=false # By default one core is used to compile -ARG compile_cores=1 +ARG compile_cores=2 + +# OpenMC variables +ARG OPENMC_BRANCH=master +ENV OPENMC_REPO='https://github.com/openmc-dev/openmc' + +# Embree variables +ENV EMBREE_TAG='v3.12.2' +ENV EMBREE_REPO='https://github.com/embree/embree' +ENV EMBREE_INSTALL_DIR=$HOME/EMBREE/ + +# MOAB variables +ENV MOAB_BRANCH='master' +ENV MOAB_REPO='https://bitbucket.org/fathomteam/moab/' + +# Double-Down variables +ENV DD_BRANCH='main' +ENV DD_REPO=' https://github.com/pshriwise/double-down' +ENV DD_INSTALL_DIR=$HOME/Double_down + +# DAGMC variables +ENV DAGMC_TAG='3.2.0' +ENV DAGMC_REPO='https://github.com/svalinn/DAGMC' +ENV DAGMC_INSTALL_DIR=$HOME/DAGMC/ + +# LIBMESH variables +ENV LIBMESH_TAG='v1.6.0' +ENV LIBMESH_REPO='https://github.com/libMesh/libmesh' +ENV LIBMESH_INSTALL_DIR=$HOME/LIBMESH # Setup environment variables for Docker image ENV CC=/usr/bin/mpicc CXX=/usr/bin/mpicxx \ - PATH=/opt/openmc/bin:/opt/NJOY2016/build:$PATH \ - LD_LIBRARY_PATH=/opt/openmc/lib:$LD_LIBRARY_PATH \ + LD_LIBRARY_PATH=${DAGMC_INSTALL_DIR}/lib:$LD_LIBRARY_PATH \ OPENMC_CROSS_SECTIONS=/root/nndc_hdf5/cross_sections.xml \ OPENMC_ENDF_DATA=/root/endf-b-vii.1 \ DEBIAN_FRONTEND=noninteractive -# Install dependencies from Debian package manager +# Install and update dependencies from Debian package manager RUN apt-get update -y && \ apt-get upgrade -y && \ apt-get install -y \ - python3-pip python-is-python3 wget git gfortran g++ cmake \ + python3-pip python-is-python3 wget git build-essential cmake \ mpich libmpich-dev libhdf5-serial-dev libhdf5-mpich-dev \ - imagemagick m4 && \ - apt-get autoremove + imagemagick && \ + apt-get autoremove -y # Update system-provided pip -RUN pip3 install --upgrade pip +RUN pip install --upgrade pip # Clone and install NJOY2016 -RUN git clone https://github.com/njoy/NJOY2016.git /opt/NJOY2016 && \ - cd /opt/NJOY2016 && \ - mkdir build && cd build && \ - cmake -Dstatic=on .. && make 2>/dev/null && make install +RUN cd $HOME && git clone --depth 1 https://github.com/njoy/NJOY2016.git && \ + cd NJOY2016 && mkdir build && cd build && \ + cmake -Dstatic=on .. && make 2>/dev/null -j${compile_cores} install ; \ + rm -rf $HOME/NJOY2016 -# Clone and install libmesh -RUN mkdir libmesh ; \ - cd libmesh ; \ - git clone --single-branch --shallow-submodules --recurse-submodules --branch v1.6.0 --depth 1 https://github.com/libMesh/libmesh.git ; \ - mkdir build ; \ - cd build ; \ - ../libmesh/configure --prefix=/opt/libmesh --enable-exodus --disable-netcdf-4 --disable-eigen --disable-lapack --disable-mpi ; \ - make -j"$compile_cores" ; \ - make -j"$compile_cores" install - -# Clone and install OpenMC without DAGMC -RUN if [ "$include_dagmc" = "false" ] ; \ - then git clone --shallow-submodules --recurse-submodules --branch "$openmc_branch" --depth=1 https://github.com/openmc-dev/openmc.git /opt/openmc ; \ - cd /opt/openmc ; \ - mkdir -p build ; \ - cd build ; \ - cmake -Doptimize=on \ - -DHDF5_PREFER_PARALLEL=on .. \ - -DCMAKE_PREFIX_PATH=/opt/libmesh/ ; \ - make -j"$compile_cores" ; \ - make -j"$compile_cores" install ; \ - cd .. ; \ - pip install -e .[test] ; \ - fi - -# install addition packages required for DAGMC -RUN if [ "$include_dagmc" = "true" ] ; \ - then apt-get --yes install libeigen3-dev ; \ - apt-get --yes install libnetcdf-dev ; \ - apt-get --yes install libtbb-dev ; \ - apt-get --yes install libglfw3-dev ; \ - fi - -# Clone and install Embree -RUN if [ "$include_dagmc" = "true" ] ; \ - then git clone --single-branch --branch v3.12.2 --depth 1 https://github.com/embree/embree.git ; \ - cd embree ; \ - mkdir build ; \ - cd build ; \ - cmake .. -DCMAKE_INSTALL_PREFIX=.. \ - -DEMBREE_ISPC_SUPPORT=OFF ; \ - make -j"$compile_cores" ; \ - make -j"$compile_cores" install ; \ - fi - -# Clone and install MOAB -RUN if [ "$include_dagmc" = "true" ] ; \ - then pip install --upgrade numpy cython ; \ - mkdir MOAB ; \ - cd MOAB ; \ - mkdir build ; \ - git clone --single-branch --branch 5.2.1 --depth 1 https://bitbucket.org/fathomteam/moab.git ; \ - cd build ; \ - cmake ../moab -DENABLE_HDF5=ON \ - -DENABLE_NETCDF=ON \ - -DBUILD_SHARED_LIBS=OFF \ - -DENABLE_FORTRAN=OFF \ - -DENABLE_BLASLAPACK=OFF ; \ - make -j"$compile_cores" ; \ - make -j"$compile_cores" install ; \ - rm -rf * ; \ - cmake ../moab -DBUILD_SHARED_LIBS=ON \ - -DENABLE_HDF5=ON \ - -DENABLE_PYMOAB=ON \ - -DENABLE_FORTRAN=OFF \ - -DENABLE_BLASLAPACK=OFF ; \ - make -j"$compile_cores" ; \ - make -j"$compile_cores" install ; \ - fi - -# Clone and install Double-Down -RUN if [ "$include_dagmc" = "true" ] ; \ - then git clone --single-branch --branch main --depth 1 https://github.com/pshriwise/double-down.git ; \ - cd double-down ; \ - mkdir build ; \ - cd build ; \ - cmake .. -DCMAKE_INSTALL_PREFIX=.. \ - -DMOAB_DIR=/usr/local \ - -DEMBREE_DIR=/embree ; \ - make -j"$compile_cores" ; \ - make -j"$compile_cores" install ; \ - fi - -# Clone and install DAGMC -RUN if [ "$include_dagmc" = "true" ] ; \ - then mkdir DAGMC ; \ - cd DAGMC ; \ - git clone --single-branch --branch 3.2.0 --depth 1 https://github.com/svalinn/DAGMC.git ; \ - mkdir build ; \ - cd build ; \ - cmake ../DAGMC -DBUILD_TALLY=ON \ - -DCMAKE_INSTALL_PREFIX=/DAGMC/ \ - -DMOAB_DIR=/usr/local \ - -DBUILD_STATIC_LIBS=OFF \ - -DBUILD_STATIC_EXE=OFF ; \ - make -j"$compile_cores" install ; \ - rm -rf /DAGMC/DAGMC /DAGMC/build ; \ - fi - -# Clone and install OpenMC with DAGMC -RUN if [ "$include_dagmc" = "true" ] ; \ - then git clone --shallow-submodules --recurse-submodules --branch "$openmc_branch" --depth=1 https://github.com/openmc-dev/openmc.git /opt/openmc ; \ - cd /opt/openmc ; \ - mkdir build ; \ - cd build ; \ - cmake -Doptimize=on \ - -Ddagmc=ON \ - -Dlibmesh=ON \ - -DCMAKE_PREFIX_PATH=/opt/libmesh/ \ - -DDAGMC_DIR=/DAGMC/ \ - -DHDF5_PREFER_PARALLEL=on .. ; \ - make -j"$compile_cores" ; \ - make -j"$compile_cores" install ; \ - cd .. ; \ - pip install -e .[test] ; \ - fi +RUN if [ "$include_dagmc" = "true" ]; then \ + # Install addition packages required for DAGMC + apt-get -y install libeigen3-dev libnetcdf-dev libtbb-dev libglfw3-dev ; \ + pip install --upgrade numpy cython ; \ + # Clone and install EMBREE + mkdir -p $HOME/EMBREE && cd $HOME/EMBREE; \ + git clone --single-branch -b ${EMBREE_TAG} --depth 1 ${EMBREE_REPO} ; \ + mkdir build && cd build; \ + cmake ../embree \ + -DCMAKE_INSTALL_PREFIX=${EMBREE_INSTALL_DIR} \ + -DEMBREE_ISPC_SUPPORT=OFF ; \ + make 2>/dev/null -j${compile_cores} install ; \ + rm -rf ${EMBREE_INSTALL_DIR}/build ${EMBREE_INSTALL_DIR}/embree ; \ + # Clone and install MOAB + mkdir -p $HOME/MOAB && cd $HOME/MOAB ; \ + git clone --single-branch -b ${MOAB_BRANCH} --depth 1 ${MOAB_REPO} ; \ + mkdir build && cd build ; \ + cmake ../moab \ + -DENABLE_HDF5=ON \ + -DENABLE_NETCDF=ON \ + -DBUILD_SHARED_LIBS=OFF \ + -DENABLE_FORTRAN=OFF \ + -DENABLE_BLASLAPACK=OFF ; \ + make 2>/dev/null -j${compile_cores} install ; \ + cmake ../moab \ + -DENABLE_PYMOAB=ON \ + -DBUILD_SHARED_LIBS=ON \ + make 2>/dev/null -j${compile_cores} install ; \ + cd pymoab && bash install.sh; \ + python setup.py install; \ + rm -rf $HOME/MOAB ; \ + # Clone and install Double-Down + mkdir -p $HOME/Double_down && cd $HOME/Double_down; \ + git clone --single-branch -b ${DD_BRANCH} --depth 1 ${DD_REPO} ; \ + mkdir build && cd build; \ + cmake ../double-down \ + -DCMAKE_INSTALL_PREFIX=${DD_INSTALL_DIR} \ + -DMOAB_DIR=/usr/local \ + -DEMBREE_DIR=${EMBREE_INSTALL_DIR} ; \ + make 2>/dev/null -j${compile_cores} install ; \ + rm -rf ${DD_INSTALL_DIR}/build && ${DD_INSTALL_DIR}/double-down; \ + # Clone and install DAGMC + mkdir -p $HOME/DAGMC && cd $HOME/DAGMC; \ + git clone --single-branch -b ${DAGMC_TAG} --depth 1 ${DAGMC_REPO} ; \ + mkdir build && cd build ; \ + cmake ../DAGMC \ + -DBUILD_TALLY=ON \ + -DCMAKE_INSTALL_PREFIX=${DAGMC_INSTALL_DIR} \ + -DMOAB_DIR=/usr/local \ + -DDOUBLE_DOWN=ON \ + -DDOUBLE_DOWN_DIR=${DD_INSTALL_DIR} \ + -DCMAKE_PREFIX_PATH=${DD_INSTALL_DIR}/lib \ + -DBUILD_STATIC_LIBS=OFF \ + -DBUILD_STATIC_EXE=OFF ; \ + make 2>/dev/null -j${compile_cores} install ; \ + rm -rf ${DAGMC_INSTALL_DIR}/DAGMC ${DAGMC_INSTALL_DIR}/build ; \ + # Clone and install OpenMC with DAGMC support + mkdir -p $HOME/OpenMC && cd $HOME/OpenMC; \ + git clone --shallow-submodules --recurse-submodules -b ${OPENMC_BRANCH} --depth=1 ${OPENMC_REPO} ; \ + mkdir build && cd build ; \ + cmake ../openmc \ + -Doptimize=on \ + -Ddagmc=ON \ + -Ddebug=on \ + -DDAGMC_DIR=${DAGMC_INSTALL_DIR} \ + -DHDF5_PREFER_PARALLEL=on ; \ + make 2>/dev/null -j${compile_cores} install ; \ + cd ../openmc && pip install -e .[test] ; \ + elif [ "$include_libmesh" = "true" ]; then \ + # Install addition packages required for LIBMESH + apt-get -y install m4 libnetcdf-dev libpnetcdf-dev ; \ + # Install LIBMESH + mkdir -p $HOME/LIBMESH && cd $HOME/LIBMESH; \ + git clone --shallow-submodules --recurse-submodules --single-branch -b ${LIBMESH_TAG} --depth 1 ${LIBMESH_REPO} ; \ + mkdir build && cd build; \ + ../libmesh/configure \ + --prefix=${LIBMESH_INSTALL_DIR} CXX=mpicxx CC=mpicc FC=mpifort F77=mpif77 \ + --enable-exodus \ + --disable-netcdf-4 \ + --disable-eigen \ + --disable-fortran \ + --disable-lapack \ + --enable-hdf5 \ + --with-hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial/ \ + --enable-mpi; \ + make 2>/dev/null -j${compile_cores} install ; \ + rm -rf ${LIBMESH_INSTALL_DIR}/build ${LIBMESH_INSTALL_DIR}/libmesh ; \ + # Clone and install OpenMC with LIBMESH support + mkdir -p $HOME/OpenMC && cd $HOME/OpenMC; \ + git clone --shallow-submodules --recurse-submodules -b ${OPENMC_BRANCH} --depth=1 ${OPENMC_REPO} ; \ + mkdir build && cd build ; \ + cmake ../openmc \ + -Doptimize=on \ + -Dlibmesh=on \ + -Ddebug=on \ + -DCMAKE_PREFIX_PATH=${LIBMESH_INSTALL_DIR} \ + -DHDF5_PREFER_PARALLEL=on ; \ + make 2>/dev/null -j${compile_cores} install ; \ + cd ../openmc && pip install -e .[test] ; \ + else \ + mkdir -p $HOME/OpenMC && cd $HOME/OpenMC; \ + git clone --shallow-submodules --recurse-submodules -b ${OPENMC_BRANCH} --depth=1 ${OPENMC_REPO} ; \ + mkdir build && cd build; \ + cmake -Doptimize=on -DHDF5_PREFER_PARALLEL=on ../openmc ; \ + make 2>/dev/null -j${compile_cores} install ; \ + cd ../openmc && pip install -e .[test] ; \ + fi ; # Download cross sections (NNDC and WMP) and ENDF data needed by test suite -RUN /opt/openmc/tools/ci/download-xs.sh +RUN $HOME/OpenMC/openmc/tools/ci/download-xs.sh From 7a68f566563733a120d14cb968983ab57f57a3e8 Mon Sep 17 00:00:00 2001 From: AI-Pranto Date: Tue, 5 Oct 2021 23:55:22 +0600 Subject: [PATCH 05/20] update yml script for libmesh build --- .github/workflows/dockerhub-publish-develop-libmesh.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dockerhub-publish-develop-libmesh.yml b/.github/workflows/dockerhub-publish-develop-libmesh.yml index 07d0e917b1..f73f097cdb 100644 --- a/.github/workflows/dockerhub-publish-develop-libmesh.yml +++ b/.github/workflows/dockerhub-publish-develop-libmesh.yml @@ -28,7 +28,7 @@ jobs: push: true tags: openmc/openmc:develop-dagmc build-args: | - include_dagmc=true + include_libmesh=true compile_cores=2 openmc_branch=develop - From 4ecdec652727c046de5ac1981fce961b00bd0ebe Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 6 Oct 2021 00:30:00 +0100 Subject: [PATCH 06/20] using env to define openmc cmake command --- .github/workflows/dockerhub-publish-dagmc.yml | 2 +- .../dockerhub-publish-develop-dagmc.yml | 2 +- .../dockerhub-publish-develop-libmesh.yml | 2 +- .../workflows/dockerhub-publish-libmesh.yml | 2 +- .../dockerhub-publish-release-dagmc.yml | 2 +- Dockerfile | 100 +++++++----------- 6 files changed, 46 insertions(+), 64 deletions(-) diff --git a/.github/workflows/dockerhub-publish-dagmc.yml b/.github/workflows/dockerhub-publish-dagmc.yml index d962292795..663e1fd17d 100644 --- a/.github/workflows/dockerhub-publish-dagmc.yml +++ b/.github/workflows/dockerhub-publish-dagmc.yml @@ -28,7 +28,7 @@ jobs: push: true tags: openmc/openmc:latest-dagmc build-args: | - include_dagmc=true + build_dagmc=on compile_cores=2 - name: Image digest diff --git a/.github/workflows/dockerhub-publish-develop-dagmc.yml b/.github/workflows/dockerhub-publish-develop-dagmc.yml index 68924d1c7e..b98b3dff6a 100644 --- a/.github/workflows/dockerhub-publish-develop-dagmc.yml +++ b/.github/workflows/dockerhub-publish-develop-dagmc.yml @@ -28,7 +28,7 @@ jobs: push: true tags: openmc/openmc:develop-dagmc build-args: | - include_dagmc=true + build_dagmc=on compile_cores=2 openmc_branch=develop - diff --git a/.github/workflows/dockerhub-publish-develop-libmesh.yml b/.github/workflows/dockerhub-publish-develop-libmesh.yml index f73f097cdb..fb83c71791 100644 --- a/.github/workflows/dockerhub-publish-develop-libmesh.yml +++ b/.github/workflows/dockerhub-publish-develop-libmesh.yml @@ -28,7 +28,7 @@ jobs: push: true tags: openmc/openmc:develop-dagmc build-args: | - include_libmesh=true + build_libmesh=on compile_cores=2 openmc_branch=develop - diff --git a/.github/workflows/dockerhub-publish-libmesh.yml b/.github/workflows/dockerhub-publish-libmesh.yml index 171ebb27e9..a861c5c9cd 100644 --- a/.github/workflows/dockerhub-publish-libmesh.yml +++ b/.github/workflows/dockerhub-publish-libmesh.yml @@ -28,7 +28,7 @@ jobs: push: true tags: openmc/openmc:latest-libmesh build-args: | - include_libmesh=true + build_libmesh=on compile_cores=2 - name: Image digest diff --git a/.github/workflows/dockerhub-publish-release-dagmc.yml b/.github/workflows/dockerhub-publish-release-dagmc.yml index 6038a9878b..927e91212a 100644 --- a/.github/workflows/dockerhub-publish-release-dagmc.yml +++ b/.github/workflows/dockerhub-publish-release-dagmc.yml @@ -31,7 +31,7 @@ jobs: push: true tags: openmc/openmc:${{ env.RELEASE_VERSION }}-dagmc build-args: | - include_dagmc=true + build_dagmc=on compile_cores=2 - name: Image digest diff --git a/Dockerfile b/Dockerfile index 6f41e454ba..11dba6bbb7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,21 +5,21 @@ # docker build -t openmc_develop --build-arg OPENMC_BRANCH=develop . # To build with OpenMC and DAGMC enabled -# docker build -t openmc_dagmc --build-arg include_dagmc=true --build-arg compile_cores=4 . +# docker build -t openmc_dagmc --build-arg build_dagmc=on --build-arg compile_cores=4 . # To build with OpenMC and Libmesh support -# docker build -t openmc_libmesh --build-arg include_libmesh=true --build-arg compile_cores=4 . +# docker build -t openmc_libmesh --build-arg build_libmesh=on --build-arg compile_cores=4 . # sudo docker run image_name:tag_name or ID with no tag sudo docker run ID number FROM ubuntu:latest # By default this Dockerfile builds OpenMC without DAGMC and LIBMESH support -ARG include_dagmc=false -ARG include_libmesh=false +ARG build_dagmc=off +ARG build_libmesh=off # By default one core is used to compile -ARG compile_cores=2 +ARG compile_cores=4 # OpenMC variables ARG OPENMC_BRANCH=master @@ -36,7 +36,7 @@ ENV MOAB_REPO='https://bitbucket.org/fathomteam/moab/' # Double-Down variables ENV DD_BRANCH='main' -ENV DD_REPO=' https://github.com/pshriwise/double-down' +ENV DD_REPO='https://github.com/pshriwise/double-down' ENV DD_INSTALL_DIR=$HOME/Double_down # DAGMC variables @@ -49,6 +49,9 @@ ENV LIBMESH_TAG='v1.6.0' ENV LIBMESH_REPO='https://github.com/libMesh/libmesh' ENV LIBMESH_INSTALL_DIR=$HOME/LIBMESH +# Creates the arguments for the openmc build command using parameter expansion +ENV OPENMC_CMAKE_ARGS="-Ddebug=on -Doptimize=on -DHDF5_PREFER_PARALLEL=on -DDAGMC_DIR=${build_dagmc:-} -DDAGMC_DIR=${DAGMC_INSTALL_DIR} -Dlibmesh=${build_libmesh:-} -DCMAKE_PREFIX_PATH=${LIBMESH_INSTALL_DIR}" + # Setup environment variables for Docker image ENV CC=/usr/bin/mpicc CXX=/usr/bin/mpicxx \ LD_LIBRARY_PATH=${DAGMC_INSTALL_DIR}/lib:$LD_LIBRARY_PATH \ @@ -74,7 +77,8 @@ RUN cd $HOME && git clone --depth 1 https://github.com/njoy/NJOY2016.git && \ cmake -Dstatic=on .. && make 2>/dev/null -j${compile_cores} install ; \ rm -rf $HOME/NJOY2016 -RUN if [ "$include_dagmc" = "true" ]; then \ + +RUN if [ "$build_dagmc" = "on" ]; then \ # Install addition packages required for DAGMC apt-get -y install libeigen3-dev libnetcdf-dev libtbb-dev libglfw3-dev ; \ pip install --upgrade numpy cython ; \ @@ -91,12 +95,11 @@ RUN if [ "$include_dagmc" = "true" ]; then \ mkdir -p $HOME/MOAB && cd $HOME/MOAB ; \ git clone --single-branch -b ${MOAB_BRANCH} --depth 1 ${MOAB_REPO} ; \ mkdir build && cd build ; \ - cmake ../moab \ - -DENABLE_HDF5=ON \ - -DENABLE_NETCDF=ON \ - -DBUILD_SHARED_LIBS=OFF \ - -DENABLE_FORTRAN=OFF \ - -DENABLE_BLASLAPACK=OFF ; \ + cmake ../moab -DENABLE_HDF5=ON \ + -DENABLE_NETCDF=ON \ + -DBUILD_SHARED_LIBS=OFF \ + -DENABLE_FORTRAN=OFF \ + -DENABLE_BLASLAPACK=OFF ; \ make 2>/dev/null -j${compile_cores} install ; \ cmake ../moab \ -DENABLE_PYMOAB=ON \ @@ -109,40 +112,29 @@ RUN if [ "$include_dagmc" = "true" ]; then \ mkdir -p $HOME/Double_down && cd $HOME/Double_down; \ git clone --single-branch -b ${DD_BRANCH} --depth 1 ${DD_REPO} ; \ mkdir build && cd build; \ - cmake ../double-down \ - -DCMAKE_INSTALL_PREFIX=${DD_INSTALL_DIR} \ - -DMOAB_DIR=/usr/local \ - -DEMBREE_DIR=${EMBREE_INSTALL_DIR} ; \ + cmake ../double-down -DCMAKE_INSTALL_PREFIX=${DD_INSTALL_DIR} \ + -DMOAB_DIR=/usr/local \ + -DEMBREE_DIR=${EMBREE_INSTALL_DIR} ; \ make 2>/dev/null -j${compile_cores} install ; \ rm -rf ${DD_INSTALL_DIR}/build && ${DD_INSTALL_DIR}/double-down; \ # Clone and install DAGMC mkdir -p $HOME/DAGMC && cd $HOME/DAGMC; \ git clone --single-branch -b ${DAGMC_TAG} --depth 1 ${DAGMC_REPO} ; \ mkdir build && cd build ; \ - cmake ../DAGMC \ - -DBUILD_TALLY=ON \ - -DCMAKE_INSTALL_PREFIX=${DAGMC_INSTALL_DIR} \ - -DMOAB_DIR=/usr/local \ - -DDOUBLE_DOWN=ON \ - -DDOUBLE_DOWN_DIR=${DD_INSTALL_DIR} \ - -DCMAKE_PREFIX_PATH=${DD_INSTALL_DIR}/lib \ - -DBUILD_STATIC_LIBS=OFF \ - -DBUILD_STATIC_EXE=OFF ; \ + cmake ../DAGMC -DBUILD_TALLY=ON \ + -DCMAKE_INSTALL_PREFIX=${DAGMC_INSTALL_DIR} \ + -DMOAB_DIR=/usr/local \ + -DDOUBLE_DOWN=ON \ + -DDOUBLE_DOWN_DIR=${DD_INSTALL_DIR} \ + -DCMAKE_PREFIX_PATH=${DD_INSTALL_DIR}/lib \ + -DBUILD_STATIC_LIBS=OFF \ + -DBUILD_STATIC_EXE=OFF ; \ make 2>/dev/null -j${compile_cores} install ; \ rm -rf ${DAGMC_INSTALL_DIR}/DAGMC ${DAGMC_INSTALL_DIR}/build ; \ - # Clone and install OpenMC with DAGMC support - mkdir -p $HOME/OpenMC && cd $HOME/OpenMC; \ - git clone --shallow-submodules --recurse-submodules -b ${OPENMC_BRANCH} --depth=1 ${OPENMC_REPO} ; \ - mkdir build && cd build ; \ - cmake ../openmc \ - -Doptimize=on \ - -Ddagmc=ON \ - -Ddebug=on \ - -DDAGMC_DIR=${DAGMC_INSTALL_DIR} \ - -DHDF5_PREFER_PARALLEL=on ; \ - make 2>/dev/null -j${compile_cores} install ; \ - cd ../openmc && pip install -e .[test] ; \ - elif [ "$include_libmesh" = "true" ]; then \ + fi + + +RUN if [ "$build_libmesh" = "on" ]; then \ # Install addition packages required for LIBMESH apt-get -y install m4 libnetcdf-dev libpnetcdf-dev ; \ # Install LIBMESH @@ -161,26 +153,16 @@ RUN if [ "$include_dagmc" = "true" ]; then \ --enable-mpi; \ make 2>/dev/null -j${compile_cores} install ; \ rm -rf ${LIBMESH_INSTALL_DIR}/build ${LIBMESH_INSTALL_DIR}/libmesh ; \ - # Clone and install OpenMC with LIBMESH support - mkdir -p $HOME/OpenMC && cd $HOME/OpenMC; \ - git clone --shallow-submodules --recurse-submodules -b ${OPENMC_BRANCH} --depth=1 ${OPENMC_REPO} ; \ - mkdir build && cd build ; \ - cmake ../openmc \ - -Doptimize=on \ - -Dlibmesh=on \ - -Ddebug=on \ - -DCMAKE_PREFIX_PATH=${LIBMESH_INSTALL_DIR} \ - -DHDF5_PREFER_PARALLEL=on ; \ - make 2>/dev/null -j${compile_cores} install ; \ - cd ../openmc && pip install -e .[test] ; \ - else \ - mkdir -p $HOME/OpenMC && cd $HOME/OpenMC; \ - git clone --shallow-submodules --recurse-submodules -b ${OPENMC_BRANCH} --depth=1 ${OPENMC_REPO} ; \ - mkdir build && cd build; \ - cmake -Doptimize=on -DHDF5_PREFER_PARALLEL=on ../openmc ; \ - make 2>/dev/null -j${compile_cores} install ; \ - cd ../openmc && pip install -e .[test] ; \ - fi ; + fi + +# clone and install openmc +RUN mkdir -p $HOME/OpenMC && cd $HOME/OpenMC ; \ + git clone --shallow-submodules --recurse-submodules -b ${OPENMC_BRANCH} --depth=1 ${OPENMC_REPO} ; \ + mkdir build ; \ + cd $HOME/OpenMC/build ; \ + cmake ../openmc ${OPENMC_CMAKE_ARGS} ; \ + make 2>/dev/null -j${compile_cores} install ; \ + cd ../openmc && pip install -e .[test] # Download cross sections (NNDC and WMP) and ENDF data needed by test suite RUN $HOME/OpenMC/openmc/tools/ci/download-xs.sh From a04a0922a31a643ef202d19692eb0cf62b7c01f1 Mon Sep 17 00:00:00 2001 From: AI-Pranto Date: Wed, 6 Oct 2021 17:45:21 +0600 Subject: [PATCH 07/20] Troubleshoot the dagmc and double-down installation --- Dockerfile | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index 11dba6bbb7..85bdeedd4e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # docker build -t openmc . # To build with OpenMC develop branch -# docker build -t openmc_develop --build-arg OPENMC_BRANCH=develop . +# docker build -t openmc_develop --build-arg openmc_branch=develop . # To build with OpenMC and DAGMC enabled # docker build -t openmc_dagmc --build-arg build_dagmc=on --build-arg compile_cores=4 . @@ -21,8 +21,11 @@ ARG build_libmesh=off # By default one core is used to compile ARG compile_cores=4 +# Set default value of HOME to /root +ENV HOME /root + # OpenMC variables -ARG OPENMC_BRANCH=master +ARG openmc_branch=master ENV OPENMC_REPO='https://github.com/openmc-dev/openmc' # Embree variables @@ -40,7 +43,7 @@ ENV DD_REPO='https://github.com/pshriwise/double-down' ENV DD_INSTALL_DIR=$HOME/Double_down # DAGMC variables -ENV DAGMC_TAG='3.2.0' +ENV DAGMC_BRANCH='develop' ENV DAGMC_REPO='https://github.com/svalinn/DAGMC' ENV DAGMC_INSTALL_DIR=$HOME/DAGMC/ @@ -50,7 +53,7 @@ ENV LIBMESH_REPO='https://github.com/libMesh/libmesh' ENV LIBMESH_INSTALL_DIR=$HOME/LIBMESH # Creates the arguments for the openmc build command using parameter expansion -ENV OPENMC_CMAKE_ARGS="-Ddebug=on -Doptimize=on -DHDF5_PREFER_PARALLEL=on -DDAGMC_DIR=${build_dagmc:-} -DDAGMC_DIR=${DAGMC_INSTALL_DIR} -Dlibmesh=${build_libmesh:-} -DCMAKE_PREFIX_PATH=${LIBMESH_INSTALL_DIR}" +ENV OPENMC_CMAKE_ARGS="-Ddebug=on -Doptimize=on -DHDF5_PREFER_PARALLEL=on -Ddagmc=${build_dagmc} -DDAGMC_DIR=${DAGMC_INSTALL_DIR} -Dlibmesh=${build_libmesh} -DCMAKE_PREFIX_PATH=${LIBMESH_INSTALL_DIR}" # Setup environment variables for Docker image ENV CC=/usr/bin/mpicc CXX=/usr/bin/mpicxx \ @@ -83,7 +86,7 @@ RUN if [ "$build_dagmc" = "on" ]; then \ apt-get -y install libeigen3-dev libnetcdf-dev libtbb-dev libglfw3-dev ; \ pip install --upgrade numpy cython ; \ # Clone and install EMBREE - mkdir -p $HOME/EMBREE && cd $HOME/EMBREE; \ + mkdir -p $HOME/EMBREE && cd $HOME/EMBREE ; \ git clone --single-branch -b ${EMBREE_TAG} --depth 1 ${EMBREE_REPO} ; \ mkdir build && cd build; \ cmake ../embree \ @@ -103,22 +106,22 @@ RUN if [ "$build_dagmc" = "on" ]; then \ make 2>/dev/null -j${compile_cores} install ; \ cmake ../moab \ -DENABLE_PYMOAB=ON \ - -DBUILD_SHARED_LIBS=ON \ + -DBUILD_SHARED_LIBS=ON ; \ make 2>/dev/null -j${compile_cores} install ; \ - cd pymoab && bash install.sh; \ - python setup.py install; \ + cd pymoab && bash install.sh ; \ + python setup.py install ; \ rm -rf $HOME/MOAB ; \ # Clone and install Double-Down - mkdir -p $HOME/Double_down && cd $HOME/Double_down; \ + mkdir -p $HOME/Double_down && cd $HOME/Double_down ; \ git clone --single-branch -b ${DD_BRANCH} --depth 1 ${DD_REPO} ; \ - mkdir build && cd build; \ + mkdir build && cd build ; \ cmake ../double-down -DCMAKE_INSTALL_PREFIX=${DD_INSTALL_DIR} \ -DMOAB_DIR=/usr/local \ -DEMBREE_DIR=${EMBREE_INSTALL_DIR} ; \ make 2>/dev/null -j${compile_cores} install ; \ - rm -rf ${DD_INSTALL_DIR}/build && ${DD_INSTALL_DIR}/double-down; \ + rm -rf ${DD_INSTALL_DIR}/build ${DD_INSTALL_DIR}/double-down ; \ # Clone and install DAGMC - mkdir -p $HOME/DAGMC && cd $HOME/DAGMC; \ + mkdir -p $HOME/DAGMC && cd $HOME/DAGMC ; \ git clone --single-branch -b ${DAGMC_TAG} --depth 1 ${DAGMC_REPO} ; \ mkdir build && cd build ; \ cmake ../DAGMC -DBUILD_TALLY=ON \ @@ -127,20 +130,19 @@ RUN if [ "$build_dagmc" = "on" ]; then \ -DDOUBLE_DOWN=ON \ -DDOUBLE_DOWN_DIR=${DD_INSTALL_DIR} \ -DCMAKE_PREFIX_PATH=${DD_INSTALL_DIR}/lib \ - -DBUILD_STATIC_LIBS=OFF \ - -DBUILD_STATIC_EXE=OFF ; \ + -DBUILD_STATIC_LIBS=OFF ; \ make 2>/dev/null -j${compile_cores} install ; \ rm -rf ${DAGMC_INSTALL_DIR}/DAGMC ${DAGMC_INSTALL_DIR}/build ; \ - fi + fi RUN if [ "$build_libmesh" = "on" ]; then \ # Install addition packages required for LIBMESH apt-get -y install m4 libnetcdf-dev libpnetcdf-dev ; \ # Install LIBMESH - mkdir -p $HOME/LIBMESH && cd $HOME/LIBMESH; \ + mkdir -p $HOME/LIBMESH && cd $HOME/LIBMESH ; \ git clone --shallow-submodules --recurse-submodules --single-branch -b ${LIBMESH_TAG} --depth 1 ${LIBMESH_REPO} ; \ - mkdir build && cd build; \ + mkdir build && cd build ; \ ../libmesh/configure \ --prefix=${LIBMESH_INSTALL_DIR} CXX=mpicxx CC=mpicc FC=mpifort F77=mpif77 \ --enable-exodus \ @@ -150,16 +152,15 @@ RUN if [ "$build_libmesh" = "on" ]; then \ --disable-lapack \ --enable-hdf5 \ --with-hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial/ \ - --enable-mpi; \ + --enable-mpi ; \ make 2>/dev/null -j${compile_cores} install ; \ rm -rf ${LIBMESH_INSTALL_DIR}/build ${LIBMESH_INSTALL_DIR}/libmesh ; \ - fi + fi # clone and install openmc RUN mkdir -p $HOME/OpenMC && cd $HOME/OpenMC ; \ - git clone --shallow-submodules --recurse-submodules -b ${OPENMC_BRANCH} --depth=1 ${OPENMC_REPO} ; \ - mkdir build ; \ - cd $HOME/OpenMC/build ; \ + git clone --shallow-submodules --recurse-submodules -b ${openmc_branch} --depth=1 ${OPENMC_REPO} ; \ + mkdir build && cd $HOME/OpenMC/build ; \ cmake ../openmc ${OPENMC_CMAKE_ARGS} ; \ make 2>/dev/null -j${compile_cores} install ; \ cd ../openmc && pip install -e .[test] From 2096691e524e701414c315747877b2b35330bf6d Mon Sep 17 00:00:00 2001 From: AI-Pranto Date: Wed, 6 Oct 2021 22:28:59 +0600 Subject: [PATCH 08/20] moving to DAGMC develop branch --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 85bdeedd4e..fe87f9d5a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -122,7 +122,7 @@ RUN if [ "$build_dagmc" = "on" ]; then \ rm -rf ${DD_INSTALL_DIR}/build ${DD_INSTALL_DIR}/double-down ; \ # Clone and install DAGMC mkdir -p $HOME/DAGMC && cd $HOME/DAGMC ; \ - git clone --single-branch -b ${DAGMC_TAG} --depth 1 ${DAGMC_REPO} ; \ + git clone --single-branch -b ${DAGMC_BRANCH} --depth 1 ${DAGMC_REPO} ; \ mkdir build && cd build ; \ cmake ../DAGMC -DBUILD_TALLY=ON \ -DCMAKE_INSTALL_PREFIX=${DAGMC_INSTALL_DIR} \ From 8ac473dc3d388c82d94e920bb376026a14f0205a Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Mon, 11 Oct 2021 15:56:26 +0100 Subject: [PATCH 09/20] corrected cmake cmd for DAGMC Co-authored-by: Patrick Shriwise --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7803b34581..5dede8cf1a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,7 +53,7 @@ ENV LIBMESH_REPO='https://github.com/libMesh/libmesh' ENV LIBMESH_INSTALL_DIR=$HOME/LIBMESH # Creates the arguments for the openmc build command using parameter expansion -ENV OPENMC_CMAKE_ARGS="-Ddebug=on -Doptimize=on -DHDF5_PREFER_PARALLEL=on -Ddagmc=${build_dagmc} -DDAGMC_DIR=${DAGMC_INSTALL_DIR} -Dlibmesh=${build_libmesh} -DCMAKE_PREFIX_PATH=${LIBMESH_INSTALL_DIR}" +ENV OPENMC_CMAKE_ARGS="-Ddebug=on -Doptimize=on -DHDF5_PREFER_PARALLEL=on -Ddagmc=${build_dagmc} -DCMAKE_PREFIX_PATH=${DAGMC_INSTALL_DIR} -Dlibmesh=${build_libmesh} -DCMAKE_PREFIX_PATH=${LIBMESH_INSTALL_DIR}" # Setup environment variables for Docker image ENV CC=/usr/bin/mpicc CXX=/usr/bin/mpicxx \ From 38a030d87a1ba110be8f4f23631907feb236b720 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 11 Oct 2021 20:10:24 +0100 Subject: [PATCH 10/20] added missing quotes in cmake cmd --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5dede8cf1a..afaa76adfd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -161,7 +161,7 @@ RUN if [ "$build_libmesh" = "on" ]; then \ RUN mkdir -p $HOME/OpenMC && cd $HOME/OpenMC ; \ git clone --shallow-submodules --recurse-submodules -b ${openmc_branch} --depth=1 ${OPENMC_REPO} ; \ mkdir build && cd $HOME/OpenMC/build ; \ - cmake ../openmc ${OPENMC_CMAKE_ARGS} ; \ + cmake ../openmc "${OPENMC_CMAKE_ARGS}" ; \ make 2>/dev/null -j${compile_cores} install ; \ cd ../openmc && pip install -e .[test] From f0cd6fb38cc446d3d5085bb38df0c2739f28a827 Mon Sep 17 00:00:00 2001 From: AI-Pranto Date: Tue, 12 Oct 2021 02:12:04 +0600 Subject: [PATCH 11/20] add yml file to publish (DAGMC+libmesh) image --- .../dockerhub-publish-dagmc-libmesh.yml | 36 ++++++++++++++++++ ...ockerhub-publish-develop-dagmc-libmesh.yml | 37 +++++++++++++++++++ Dockerfile | 7 +++- vendor/fmt | 2 +- 4 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/dockerhub-publish-dagmc-libmesh.yml create mode 100644 .github/workflows/dockerhub-publish-develop-dagmc-libmesh.yml diff --git a/.github/workflows/dockerhub-publish-dagmc-libmesh.yml b/.github/workflows/dockerhub-publish-dagmc-libmesh.yml new file mode 100644 index 0000000000..5a72475a90 --- /dev/null +++ b/.github/workflows/dockerhub-publish-dagmc-libmesh.yml @@ -0,0 +1,36 @@ +name: dockerhub-publish-latest-dagmc-libmesh + +on: + push: + branches: master + +jobs: + main: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: openmc/openmc:latest-libmesh + build-args: | + build_dagmc=on + build_libmesh=on + compile_cores=2 + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.github/workflows/dockerhub-publish-develop-dagmc-libmesh.yml b/.github/workflows/dockerhub-publish-develop-dagmc-libmesh.yml new file mode 100644 index 0000000000..1a5799f1aa --- /dev/null +++ b/.github/workflows/dockerhub-publish-develop-dagmc-libmesh.yml @@ -0,0 +1,37 @@ +name: dockerhub-publish-develop-dagmc-libmesh + +on: + push: + branches: develop + +jobs: + main: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: openmc/openmc:develop-dagmc + build-args: | + build_dagmc=on + build_libmesh=on + compile_cores=2 + openmc_branch=develop + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/Dockerfile b/Dockerfile index afaa76adfd..76b75150a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,9 +7,12 @@ # To build with OpenMC and DAGMC enabled # docker build -t openmc_dagmc --build-arg build_dagmc=on --build-arg compile_cores=4 . -# To build with OpenMC and Libmesh support +# To build with OpenMC and Libmesh enabled # docker build -t openmc_libmesh --build-arg build_libmesh=on --build-arg compile_cores=4 . +# To build with both DAGMC and Libmesh enabled +# docker build -t openmc_dagmc_libmesh --build-arg build_dagmc=on --build-arg build_libmesh=on --build-arg compile_cores=4 . + # sudo docker run image_name:tag_name or ID with no tag sudo docker run ID number FROM ubuntu:latest @@ -19,7 +22,7 @@ ARG build_dagmc=off ARG build_libmesh=off # By default one core is used to compile -ARG compile_cores=4 +ARG compile_cores=1 # Set default value of HOME to /root ENV HOME /root diff --git a/vendor/fmt b/vendor/fmt index d141cdbeb0..65ac626c58 160000 --- a/vendor/fmt +++ b/vendor/fmt @@ -1 +1 @@ -Subproject commit d141cdbeb0fb422a3fb7173b285fd38e0d1772dc +Subproject commit 65ac626c5856f5aad1f1542e79407a6714357043 From fcdde37c761254827d11303f0911911d575a33a7 Mon Sep 17 00:00:00 2001 From: AI-Pranto Date: Tue, 19 Oct 2021 15:14:00 +0600 Subject: [PATCH 12/20] install moose-libmesh with conda --- Dockerfile | 82 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 35 deletions(-) diff --git a/Dockerfile b/Dockerfile index 76b75150a1..b68c77acfa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,9 +24,6 @@ ARG build_libmesh=off # By default one core is used to compile ARG compile_cores=1 -# Set default value of HOME to /root -ENV HOME /root - # OpenMC variables ARG openmc_branch=master ENV OPENMC_REPO='https://github.com/openmc-dev/openmc' @@ -50,16 +47,10 @@ ENV DAGMC_BRANCH='develop' ENV DAGMC_REPO='https://github.com/svalinn/DAGMC' ENV DAGMC_INSTALL_DIR=$HOME/DAGMC/ -# LIBMESH variables -ENV LIBMESH_TAG='v1.6.0' -ENV LIBMESH_REPO='https://github.com/libMesh/libmesh' -ENV LIBMESH_INSTALL_DIR=$HOME/LIBMESH - -# Creates the arguments for the openmc build command using parameter expansion -ENV OPENMC_CMAKE_ARGS="-Ddebug=on -Doptimize=on -DHDF5_PREFER_PARALLEL=on -Ddagmc=${build_dagmc} -DCMAKE_PREFIX_PATH=${DAGMC_INSTALL_DIR} -Dlibmesh=${build_libmesh} -DCMAKE_PREFIX_PATH=${LIBMESH_INSTALL_DIR}" - # Setup environment variables for Docker image ENV CC=/usr/bin/mpicc CXX=/usr/bin/mpicxx \ + PATH=/miniconda/bin:${PATH} \ + LIBMESH_DIR=/miniconda/libmesh \ LD_LIBRARY_PATH=${DAGMC_INSTALL_DIR}/lib:$LD_LIBRARY_PATH \ OPENMC_CROSS_SECTIONS=/root/nndc_hdf5/cross_sections.xml \ OPENMC_ENDF_DATA=/root/endf-b-vii.1 \ @@ -74,6 +65,7 @@ RUN apt-get update -y && \ libpng-dev && \ apt-get autoremove + # Update system-provided pip RUN pip install --upgrade pip @@ -83,7 +75,6 @@ RUN cd $HOME && git clone --depth 1 https://github.com/njoy/NJOY2016.git && \ cmake -Dstatic=on .. && make 2>/dev/null -j${compile_cores} install ; \ rm -rf $HOME/NJOY2016 - RUN if [ "$build_dagmc" = "on" ]; then \ # Install addition packages required for DAGMC apt-get -y install libeigen3-dev libnetcdf-dev libtbb-dev libglfw3-dev ; \ @@ -138,35 +129,56 @@ RUN if [ "$build_dagmc" = "on" ]; then \ rm -rf ${DAGMC_INSTALL_DIR}/DAGMC ${DAGMC_INSTALL_DIR}/build ; \ fi - RUN if [ "$build_libmesh" = "on" ]; then \ - # Install addition packages required for LIBMESH - apt-get -y install m4 libnetcdf-dev libpnetcdf-dev ; \ - # Install LIBMESH - mkdir -p $HOME/LIBMESH && cd $HOME/LIBMESH ; \ - git clone --shallow-submodules --recurse-submodules --single-branch -b ${LIBMESH_TAG} --depth 1 ${LIBMESH_REPO} ; \ - mkdir build && cd build ; \ - ../libmesh/configure \ - --prefix=${LIBMESH_INSTALL_DIR} CXX=mpicxx CC=mpicc FC=mpifort F77=mpif77 \ - --enable-exodus \ - --disable-netcdf-4 \ - --disable-eigen \ - --disable-fortran \ - --disable-lapack \ - --enable-hdf5 \ - --with-hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial/ \ - --enable-mpi ; \ - make 2>/dev/null -j${compile_cores} install ; \ - rm -rf ${LIBMESH_INSTALL_DIR}/build ${LIBMESH_INSTALL_DIR}/libmesh ; \ + # Install miniconda + wget -q https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh -O miniconda.sh ; \ + bash miniconda.sh -b -p /miniconda ; \ + rm -f miniconda.sh ; \ + conda config --set always_yes yes --set changeps1 no ; \ + conda update -q conda ; \ + # Add INL public channel and install moose-libmesh + conda config --add channels conda-forge ; \ + conda config --add channels https://conda.software.inl.gov/public ; \ + conda install moose-libmesh ; \ fi # clone and install openmc -RUN mkdir -p $HOME/OpenMC && cd $HOME/OpenMC ; \ +RUN mkdir -p ${HOME}/OpenMC && cd ${HOME}/OpenMC ; \ git clone --shallow-submodules --recurse-submodules -b ${openmc_branch} --depth=1 ${OPENMC_REPO} ; \ - mkdir build && cd $HOME/OpenMC/build ; \ - cmake ../openmc "${OPENMC_CMAKE_ARGS}" ; \ + mkdir build && cd build ; \ + if [ ${build_dagmc} = "on" ] && [ ${build_libmesh} = "on" ]; then \ + cmake ../openmc \ + -Doptimize=on \ + -Ddebug=on \ + -DHDF5_PREFER_PARALLEL=on \ + -Ddagmc=on \ + -Dlibmesh=on \ + -DCMAKE_PREFIX_PATH="${DAGMC_INSTALL_DIR};${LIBMESH_DIR}" ; \ + fi ; \ + if [ ${build_dagmc} = "on" ] && [ ${build_libmesh} = "off" ]; then \ + cmake ../openmc \ + -Doptimize=on \ + -Ddebug=on \ + -DHDF5_PREFER_PARALLEL=on \ + -Ddagmc=ON \ + -DCMAKE_PREFIX_PATH=${DAGMC_INSTALL_DIR} ; \ + fi ; \ + if [ ${build_dagmc} = "off" ] && [ ${build_libmesh} = "on" ]; then \ + cmake ../openmc \ + -Doptimize=on \ + -Ddebug=on \ + -DHDF5_PREFER_PARALLEL=on \ + -Dlibmesh=on \ + -DCMAKE_PREFIX_PATH=${LIBMESH_DIR} ; \ + fi ; \ + if [ ${build_dagmc} = "off" ] && [ ${build_libmesh} = "off" ]; then \ + cmake ../openmc \ + -Doptimize=on \ + -Ddebug=on \ + -DHDF5_PREFER_PARALLEL=on ; \ + fi ; \ make 2>/dev/null -j${compile_cores} install ; \ cd ../openmc && pip install -e .[test] # Download cross sections (NNDC and WMP) and ENDF data needed by test suite -RUN $HOME/OpenMC/openmc/tools/ci/download-xs.sh +RUN ${HOME}/OpenMC/openmc/tools/ci/download-xs.sh From 42098fb5a96487ce613c0987235230f39a793ee0 Mon Sep 17 00:00:00 2001 From: AI-Pranto Date: Sat, 23 Oct 2021 00:54:58 +0600 Subject: [PATCH 13/20] switch from `ubuntu` to `debian-slim` image --- Dockerfile | 135 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 78 insertions(+), 57 deletions(-) diff --git a/Dockerfile b/Dockerfile index b68c77acfa..397d3be62f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ # sudo docker run image_name:tag_name or ID with no tag sudo docker run ID number -FROM ubuntu:latest +FROM debian:bullseye-slim # By default this Dockerfile builds OpenMC without DAGMC and LIBMESH support ARG build_dagmc=off @@ -24,6 +24,9 @@ ARG build_libmesh=off # By default one core is used to compile ARG compile_cores=1 +# Set default value of HOME to /root +ENV HOME=/root + # OpenMC variables ARG openmc_branch=master ENV OPENMC_REPO='https://github.com/openmc-dev/openmc' @@ -47,10 +50,13 @@ ENV DAGMC_BRANCH='develop' ENV DAGMC_REPO='https://github.com/svalinn/DAGMC' ENV DAGMC_INSTALL_DIR=$HOME/DAGMC/ +# LIBMESH variables +ENV LIBMESH_TAG='v1.6.0' +ENV LIBMESH_REPO='https://github.com/libMesh/libmesh' +ENV LIBMESH_INSTALL_DIR=$HOME/LIBMESH + # Setup environment variables for Docker image ENV CC=/usr/bin/mpicc CXX=/usr/bin/mpicxx \ - PATH=/miniconda/bin:${PATH} \ - LIBMESH_DIR=/miniconda/libmesh \ LD_LIBRARY_PATH=${DAGMC_INSTALL_DIR}/lib:$LD_LIBRARY_PATH \ OPENMC_CROSS_SECTIONS=/root/nndc_hdf5/cross_sections.xml \ OPENMC_ENDF_DATA=/root/endf-b-vii.1 \ @@ -65,87 +71,102 @@ RUN apt-get update -y && \ libpng-dev && \ apt-get autoremove - # Update system-provided pip RUN pip install --upgrade pip # Clone and install NJOY2016 RUN cd $HOME && git clone --depth 1 https://github.com/njoy/NJOY2016.git && \ cd NJOY2016 && mkdir build && cd build && \ - cmake -Dstatic=on .. && make 2>/dev/null -j${compile_cores} install ; \ + cmake -Dstatic=on .. && make 2>/dev/null -j${compile_cores} install && \ rm -rf $HOME/NJOY2016 + RUN if [ "$build_dagmc" = "on" ]; then \ # Install addition packages required for DAGMC - apt-get -y install libeigen3-dev libnetcdf-dev libtbb-dev libglfw3-dev ; \ - pip install --upgrade numpy cython ; \ + apt-get -y install libeigen3-dev libnetcdf-dev libtbb-dev libglfw3-dev \ + && pip install --upgrade numpy cython \ # Clone and install EMBREE - mkdir -p $HOME/EMBREE && cd $HOME/EMBREE ; \ - git clone --single-branch -b ${EMBREE_TAG} --depth 1 ${EMBREE_REPO} ; \ - mkdir build && cd build; \ - cmake ../embree \ + && mkdir -p $HOME/EMBREE && cd $HOME/EMBREE \ + && git clone --single-branch -b ${EMBREE_TAG} --depth 1 ${EMBREE_REPO} \ + && mkdir build && cd build \ + && cmake ../embree \ -DCMAKE_INSTALL_PREFIX=${EMBREE_INSTALL_DIR} \ - -DEMBREE_ISPC_SUPPORT=OFF ; \ - make 2>/dev/null -j${compile_cores} install ; \ - rm -rf ${EMBREE_INSTALL_DIR}/build ${EMBREE_INSTALL_DIR}/embree ; \ + -DEMBREE_ISPC_SUPPORT=OFF \ + && make 2>/dev/null -j${compile_cores} install \ + && rm -rf ${EMBREE_INSTALL_DIR}/build ${EMBREE_INSTALL_DIR}/embree ; \ # Clone and install MOAB - mkdir -p $HOME/MOAB && cd $HOME/MOAB ; \ - git clone --single-branch -b ${MOAB_BRANCH} --depth 1 ${MOAB_REPO} ; \ - mkdir build && cd build ; \ - cmake ../moab -DENABLE_HDF5=ON \ + mkdir -p $HOME/MOAB && cd $HOME/MOAB \ + && git clone --single-branch -b ${MOAB_BRANCH} --depth 1 ${MOAB_REPO} \ + && mkdir build && cd build \ + && cmake ../moab -DENABLE_HDF5=ON \ -DENABLE_NETCDF=ON \ -DBUILD_SHARED_LIBS=OFF \ -DENABLE_FORTRAN=OFF \ - -DENABLE_BLASLAPACK=OFF ; \ - make 2>/dev/null -j${compile_cores} install ; \ - cmake ../moab \ + -DENABLE_BLASLAPACK=OFF \ + && make 2>/dev/null -j${compile_cores} install \ + && cmake ../moab \ -DENABLE_PYMOAB=ON \ - -DBUILD_SHARED_LIBS=ON ; \ - make 2>/dev/null -j${compile_cores} install ; \ - cd pymoab && bash install.sh ; \ - python setup.py install ; \ - rm -rf $HOME/MOAB ; \ + -DBUILD_SHARED_LIBS=ON \ + && make 2>/dev/null -j${compile_cores} install \ + && cd pymoab && bash install.sh \ + && python setup.py install \ + && rm -rf $HOME/MOAB ; \ # Clone and install Double-Down - mkdir -p $HOME/Double_down && cd $HOME/Double_down ; \ - git clone --single-branch -b ${DD_BRANCH} --depth 1 ${DD_REPO} ; \ - mkdir build && cd build ; \ - cmake ../double-down -DCMAKE_INSTALL_PREFIX=${DD_INSTALL_DIR} \ + mkdir -p $HOME/Double_down && cd $HOME/Double_down \ + && git clone --single-branch -b ${DD_BRANCH} --depth 1 ${DD_REPO} \ + && mkdir build && cd build \ + && cmake ../double-down -DCMAKE_INSTALL_PREFIX=${DD_INSTALL_DIR} \ -DMOAB_DIR=/usr/local \ - -DEMBREE_DIR=${EMBREE_INSTALL_DIR} ; \ - make 2>/dev/null -j${compile_cores} install ; \ - rm -rf ${DD_INSTALL_DIR}/build ${DD_INSTALL_DIR}/double-down ; \ + -DEMBREE_DIR=${EMBREE_INSTALL_DIR} \ + && make 2>/dev/null -j${compile_cores} install \ + && rm -rf ${DD_INSTALL_DIR}/build ${DD_INSTALL_DIR}/double-down ; \ # Clone and install DAGMC - mkdir -p $HOME/DAGMC && cd $HOME/DAGMC ; \ - git clone --single-branch -b ${DAGMC_BRANCH} --depth 1 ${DAGMC_REPO} ; \ - mkdir build && cd build ; \ - cmake ../DAGMC -DBUILD_TALLY=ON \ + mkdir -p $HOME/DAGMC && cd $HOME/DAGMC \ + && git clone --single-branch -b ${DAGMC_BRANCH} --depth 1 ${DAGMC_REPO} \ + && mkdir build && cd build \ + && cmake ../DAGMC -DBUILD_TALLY=ON \ -DCMAKE_INSTALL_PREFIX=${DAGMC_INSTALL_DIR} \ -DMOAB_DIR=/usr/local \ -DDOUBLE_DOWN=ON \ -DDOUBLE_DOWN_DIR=${DD_INSTALL_DIR} \ -DCMAKE_PREFIX_PATH=${DD_INSTALL_DIR}/lib \ - -DBUILD_STATIC_LIBS=OFF ; \ - make 2>/dev/null -j${compile_cores} install ; \ - rm -rf ${DAGMC_INSTALL_DIR}/DAGMC ${DAGMC_INSTALL_DIR}/build ; \ + -DBUILD_STATIC_LIBS=OFF \ + && make 2>/dev/null -j${compile_cores} install \ + && rm -rf ${DAGMC_INSTALL_DIR}/DAGMC ${DAGMC_INSTALL_DIR}/build ; \ fi + RUN if [ "$build_libmesh" = "on" ]; then \ - # Install miniconda - wget -q https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh -O miniconda.sh ; \ - bash miniconda.sh -b -p /miniconda ; \ - rm -f miniconda.sh ; \ - conda config --set always_yes yes --set changeps1 no ; \ - conda update -q conda ; \ - # Add INL public channel and install moose-libmesh - conda config --add channels conda-forge ; \ - conda config --add channels https://conda.software.inl.gov/public ; \ - conda install moose-libmesh ; \ + # Install addition packages required for LIBMESH + apt-get -y install m4 libnetcdf-dev libpnetcdf-dev \ + # Install LIBMESH + && mkdir -p $HOME/LIBMESH && cd $HOME/LIBMESH \ + && git clone --shallow-submodules --recurse-submodules --single-branch -b ${LIBMESH_TAG} --depth 1 ${LIBMESH_REPO} \ + && mkdir build && cd build \ + && ../libmesh/configure \ + --prefix=${LIBMESH_INSTALL_DIR} CXX=mpicxx CC=mpicc FC=mpifort F77=mpif77 \ + --enable-exodus \ + --enable-mpi \ + --enable-silent-rules \ + --enable-unique-id \ + --disable-eigen \ + --disable-fortran \ + --disable-lapack \ + --disable-examples \ + --disable-warnings \ + --disable-maintainer-mode \ + --disable-metaphysicl \ + --with-methods="opt" \ + --without-gdb-command \ + --with-cxx-std-min=2014 \ + && make 2>/dev/null -j${compile_cores} install \ + && rm -rf ${LIBMESH_INSTALL_DIR}/build ${LIBMESH_INSTALL_DIR}/libmesh ; \ fi # clone and install openmc -RUN mkdir -p ${HOME}/OpenMC && cd ${HOME}/OpenMC ; \ - git clone --shallow-submodules --recurse-submodules -b ${openmc_branch} --depth=1 ${OPENMC_REPO} ; \ - mkdir build && cd build ; \ +RUN mkdir -p ${HOME}/OpenMC && cd ${HOME}/OpenMC \ + && git clone --shallow-submodules --recurse-submodules -b ${openmc_branch} --depth=1 ${OPENMC_REPO} \ + && mkdir build && cd build ; \ if [ ${build_dagmc} = "on" ] && [ ${build_libmesh} = "on" ]; then \ cmake ../openmc \ -Doptimize=on \ @@ -153,7 +174,7 @@ RUN mkdir -p ${HOME}/OpenMC && cd ${HOME}/OpenMC ; \ -DHDF5_PREFER_PARALLEL=on \ -Ddagmc=on \ -Dlibmesh=on \ - -DCMAKE_PREFIX_PATH="${DAGMC_INSTALL_DIR};${LIBMESH_DIR}" ; \ + -DCMAKE_PREFIX_PATH="${DAGMC_INSTALL_DIR};${LIBMESH_INSTALL_DIR}" ; \ fi ; \ if [ ${build_dagmc} = "on" ] && [ ${build_libmesh} = "off" ]; then \ cmake ../openmc \ @@ -169,7 +190,7 @@ RUN mkdir -p ${HOME}/OpenMC && cd ${HOME}/OpenMC ; \ -Ddebug=on \ -DHDF5_PREFER_PARALLEL=on \ -Dlibmesh=on \ - -DCMAKE_PREFIX_PATH=${LIBMESH_DIR} ; \ + -DCMAKE_PREFIX_PATH=${LIBMESH_INSTALL_DIR} ; \ fi ; \ if [ ${build_dagmc} = "off" ] && [ ${build_libmesh} = "off" ]; then \ cmake ../openmc \ @@ -177,8 +198,8 @@ RUN mkdir -p ${HOME}/OpenMC && cd ${HOME}/OpenMC ; \ -Ddebug=on \ -DHDF5_PREFER_PARALLEL=on ; \ fi ; \ - make 2>/dev/null -j${compile_cores} install ; \ - cd ../openmc && pip install -e .[test] + make 2>/dev/null -j${compile_cores} install \ + && cd ../openmc && pip install -e .[test] # Download cross sections (NNDC and WMP) and ENDF data needed by test suite RUN ${HOME}/OpenMC/openmc/tools/ci/download-xs.sh From d0198f2981ace7decb1d3d393f32dfeddf581d02 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 17 Nov 2021 14:25:18 +0000 Subject: [PATCH 14/20] now targeting v1.0.0 of double down --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 397d3be62f..0f81e776df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,7 @@ ENV MOAB_BRANCH='master' ENV MOAB_REPO='https://bitbucket.org/fathomteam/moab/' # Double-Down variables -ENV DD_BRANCH='main' +ENV DD_TAG='v1.0.0 ' ENV DD_REPO='https://github.com/pshriwise/double-down' ENV DD_INSTALL_DIR=$HOME/Double_down @@ -113,7 +113,7 @@ RUN if [ "$build_dagmc" = "on" ]; then \ && rm -rf $HOME/MOAB ; \ # Clone and install Double-Down mkdir -p $HOME/Double_down && cd $HOME/Double_down \ - && git clone --single-branch -b ${DD_BRANCH} --depth 1 ${DD_REPO} \ + && git clone --single-branch -b ${DD_TAG} --depth 1 ${DD_REPO} \ && mkdir build && cd build \ && cmake ../double-down -DCMAKE_INSTALL_PREFIX=${DD_INSTALL_DIR} \ -DMOAB_DIR=/usr/local \ From 007f4f81ee91a92ef634f35aa7161a3c1ddfbc6e Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 17 Nov 2021 14:28:56 +0000 Subject: [PATCH 15/20] [skip ci] now targeting moab 5.3.0 --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0f81e776df..e6e6983b34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,11 +37,11 @@ ENV EMBREE_REPO='https://github.com/embree/embree' ENV EMBREE_INSTALL_DIR=$HOME/EMBREE/ # MOAB variables -ENV MOAB_BRANCH='master' +ENV MOAB_TAG='5.3.0' ENV MOAB_REPO='https://bitbucket.org/fathomteam/moab/' # Double-Down variables -ENV DD_TAG='v1.0.0 ' +ENV DD_TAG='v1.0.0' ENV DD_REPO='https://github.com/pshriwise/double-down' ENV DD_INSTALL_DIR=$HOME/Double_down @@ -96,7 +96,7 @@ RUN if [ "$build_dagmc" = "on" ]; then \ && rm -rf ${EMBREE_INSTALL_DIR}/build ${EMBREE_INSTALL_DIR}/embree ; \ # Clone and install MOAB mkdir -p $HOME/MOAB && cd $HOME/MOAB \ - && git clone --single-branch -b ${MOAB_BRANCH} --depth 1 ${MOAB_REPO} \ + && git clone --single-branch -b ${MOAB_TAG} --depth 1 ${MOAB_REPO} \ && mkdir build && cd build \ && cmake ../moab -DENABLE_HDF5=ON \ -DENABLE_NETCDF=ON \ From 1711ff67ae23074cc82bb52744ae53ef80301837 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 17 Nov 2021 17:49:24 +0000 Subject: [PATCH 16/20] changed embree compile to increase compatibility --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index e6e6983b34..c1f014ed4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -91,6 +91,8 @@ RUN if [ "$build_dagmc" = "on" ]; then \ && mkdir build && cd build \ && cmake ../embree \ -DCMAKE_INSTALL_PREFIX=${EMBREE_INSTALL_DIR} \ + -DEMBREE_MAX_ISA=NONE \ + -DEMBREE_ISA_SSE42=ON \ -DEMBREE_ISPC_SUPPORT=OFF \ && make 2>/dev/null -j${compile_cores} install \ && rm -rf ${EMBREE_INSTALL_DIR}/build ${EMBREE_INSTALL_DIR}/embree ; \ From d0353c3e58eb4f64f3e97bdd346b8b9060780e05 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Fri, 3 Dec 2021 17:05:25 +0000 Subject: [PATCH 17/20] Reverting change to fmt submodule --- vendor/fmt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/fmt b/vendor/fmt index 65ac626c58..d141cdbeb0 160000 --- a/vendor/fmt +++ b/vendor/fmt @@ -1 +1 @@ -Subproject commit 65ac626c5856f5aad1f1542e79407a6714357043 +Subproject commit d141cdbeb0fb422a3fb7173b285fd38e0d1772dc From bb9f6009382115fbdcb2e9e88cb76c03c2d082b4 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Sun, 5 Dec 2021 00:54:26 +0000 Subject: [PATCH 18/20] Added pip install of mpi4py Co-authored-by: Patrick Shriwise --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c1f014ed4b..cefd01dd63 100644 --- a/Dockerfile +++ b/Dockerfile @@ -201,7 +201,7 @@ RUN mkdir -p ${HOME}/OpenMC && cd ${HOME}/OpenMC \ -DHDF5_PREFER_PARALLEL=on ; \ fi ; \ make 2>/dev/null -j${compile_cores} install \ - && cd ../openmc && pip install -e .[test] + && cd ../openmc && pip install -e .[test, depletion-mpi] # Download cross sections (NNDC and WMP) and ENDF data needed by test suite RUN ${HOME}/OpenMC/openmc/tools/ci/download-xs.sh From 75b7706741745257538aadc99afe405eb688a789 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Sun, 5 Dec 2021 17:40:34 +0000 Subject: [PATCH 19/20] Adding space in pip command Co-authored-by: Patrick Shriwise --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cefd01dd63..5da7864605 100644 --- a/Dockerfile +++ b/Dockerfile @@ -201,7 +201,7 @@ RUN mkdir -p ${HOME}/OpenMC && cd ${HOME}/OpenMC \ -DHDF5_PREFER_PARALLEL=on ; \ fi ; \ make 2>/dev/null -j${compile_cores} install \ - && cd ../openmc && pip install -e .[test, depletion-mpi] + && cd ../openmc && pip install -e .[test,depletion-mpi] # Download cross sections (NNDC and WMP) and ENDF data needed by test suite RUN ${HOME}/OpenMC/openmc/tools/ci/download-xs.sh From 180fb664901b2b34152bd9584f302da24db2571f Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Mon, 6 Dec 2021 11:35:12 +0000 Subject: [PATCH 20/20] setting Doptimize and Ddebug to off --- Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5da7864605..7399988645 100644 --- a/Dockerfile +++ b/Dockerfile @@ -171,8 +171,8 @@ RUN mkdir -p ${HOME}/OpenMC && cd ${HOME}/OpenMC \ && mkdir build && cd build ; \ if [ ${build_dagmc} = "on" ] && [ ${build_libmesh} = "on" ]; then \ cmake ../openmc \ - -Doptimize=on \ - -Ddebug=on \ + -Doptimize=off \ + -Ddebug=off \ -DHDF5_PREFER_PARALLEL=on \ -Ddagmc=on \ -Dlibmesh=on \ @@ -180,24 +180,24 @@ RUN mkdir -p ${HOME}/OpenMC && cd ${HOME}/OpenMC \ fi ; \ if [ ${build_dagmc} = "on" ] && [ ${build_libmesh} = "off" ]; then \ cmake ../openmc \ - -Doptimize=on \ - -Ddebug=on \ + -Doptimize=off \ + -Ddebug=off \ -DHDF5_PREFER_PARALLEL=on \ -Ddagmc=ON \ -DCMAKE_PREFIX_PATH=${DAGMC_INSTALL_DIR} ; \ fi ; \ if [ ${build_dagmc} = "off" ] && [ ${build_libmesh} = "on" ]; then \ cmake ../openmc \ - -Doptimize=on \ - -Ddebug=on \ + -Doptimize=off \ + -Ddebug=off \ -DHDF5_PREFER_PARALLEL=on \ -Dlibmesh=on \ -DCMAKE_PREFIX_PATH=${LIBMESH_INSTALL_DIR} ; \ fi ; \ if [ ${build_dagmc} = "off" ] && [ ${build_libmesh} = "off" ]; then \ cmake ../openmc \ - -Doptimize=on \ - -Ddebug=on \ + -Doptimize=off \ + -Ddebug=off \ -DHDF5_PREFER_PARALLEL=on ; \ fi ; \ make 2>/dev/null -j${compile_cores} install \