From 98eb6e7767926493545e4cd8205fcd70361f0c15 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Tue, 5 Jan 2021 22:27:17 +0000 Subject: [PATCH] Add docker image scripts for Arch linux Centos-7 ships with GCC 4.8.5 which won't compile BOUT++. Lots of trouble compiling with devtoolset-7, and Centos seems likely to be unsupported in future. Updated README, removed some obsolete scripts. --- README.md | 67 +++++++---- arch/arch-bout-master-sundials.dkr | 75 +++++++++++++ arch/arch-bout-master.dkr | 111 ++++++++++++++++++ arch/arch-bout-next-sundials.dkr | 75 +++++++++++++ arch/arch-bout-next.dkr | 112 ++++++++++++++++++ bout-3.1.dkr | 150 ------------------------- bout-next.dkr | 174 ---------------------------- bout.dkr | 175 ----------------------------- buildBOUT.sh | 43 ------- 9 files changed, 416 insertions(+), 566 deletions(-) create mode 100644 arch/arch-bout-master-sundials.dkr create mode 100644 arch/arch-bout-master.dkr create mode 100644 arch/arch-bout-next-sundials.dkr create mode 100644 arch/arch-bout-next.dkr delete mode 100644 bout-3.1.dkr delete mode 100644 bout-next.dkr delete mode 100644 bout.dkr delete mode 100755 buildBOUT.sh diff --git a/README.md b/README.md index 395da57..e0dc464 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,46 @@ -This repository is for creating docker containers for BOUT-dev master and next branches. (found here: https://github.com/boutproject/BOUT-dev) +BOUT++ docker scripts +===================== -bout.dkr - docker script for building BOUT-dev master -bout-next.dkr - docker script for building BOUt-dev next -buildBOUT.sh - script to build a container from a docker script -start-interactive.sh - script for starting an interactive docker container -start-BOUT.sh - script for starting bout container with some detailed options (see below) - - -To build these containers you must first install docker and then set it running (instructions here: https://docs.docker.com/install/linux/docker-ce/centos/) -Once docker is running, you can navigate into this repo directory and type: -./buildBOUT.sh - -This will ask you the name of the docker script file you'd like to build so either "bout" or "bout-next" - -It may take a while to build, you will need an internet connection, and you will need sudo privelages. If your docker commands -function without sudo privelages, then you will need to modify the buildBOUT.sh script by removing all the sudo commands. - -When complete, a list of your currently loaded docker images will be displayed. To open an image as a container you can type: -./start-interactive.sh -it will prompt you for the name of the image (which should either be bout-img or bout-next-img depending on which you built) +This repository contains scripts for creating and using docker +containers for BOUT-dev master and next branches. (found here: +https://github.com/boutproject/BOUT-dev) + +To build or use Docker containers, you must first install docker and +then set it running (instructions here: +https://docs.docker.com/install/linux/docker-ce/centos/) + +Building docker images +---------------------- + +The `.dkr` files each create a docker image, and each should have +the command needed to run them at the top of the file. + +For example, to build BOUT-next on Arch Linux, + + $ cd arch + $ sudo docker build -t boutproject/bout-next:4cee87c-arch -f arch-bout-next.dkr . + +Note that the tag should be updated to reflect the BOUT++ commit or release +being compiled. + +Using docker images +------------------- + +To open an image as a container you can type: + + ./start-interactive.sh + +it will prompt you for the name of the image (which should either be +bout-img or bout-next-img depending on which you built) -You will find yourself at the command line logged in to the container as boutuser. You should see the BOUT++ installation and should be able to build -and run examples. +You will find yourself at the command line logged in to the container +as boutuser. You should see the BOUT++ installation and should be +able to build and run examples. -Alternatively, you can use the start-BOUT.sh script which will prompt you to create a common data folder so files can be shared between your machine and the container. This script -will also prompt you regarding the number of processors you desire. \ No newline at end of file +Alternatively, you can use: + + ./start-BOUT.sh + +which will prompt you to create a common data folder so files can be +shared between your machine and the container. This script will also +prompt you regarding the number of processors you desire. diff --git a/arch/arch-bout-master-sundials.dkr b/arch/arch-bout-master-sundials.dkr new file mode 100644 index 0000000..5078033 --- /dev/null +++ b/arch/arch-bout-master-sundials.dkr @@ -0,0 +1,75 @@ +# ================================================================================ +# Dockerfile to setup build environment for BOUT-master build +# +# Build example: +# sudo docker build -t boutproject/bout-master:3b23201-sundials-arch -f arch-bout-master-sundials.dkr . +# +# ================================================================================ + +FROM archlinux/base +MAINTAINER Ben Dudson "benjamin.dudson@york.ac.uk" + +# ---------------------------------------------------------------- +# Convenient network/system tools, python, dependencies +# ---------------------------------------------------------------- + +RUN pacman -Syu --noconfirm \ + && pacman -Sy --noconfirm emacs-nox vim nano git gcc gcc-fortran \ + fftw cblas lapack cmake sudo core/which gawk \ + wget make file m4 hdf5 netcdf netcdf-cxx \ + python-numpy python-scipy python-matplotlib ipython openmpi \ + && pacman -Scc --noconfirm + +##################### +# Install SUNDIALS + +WORKDIR / +RUN wget https://computation.llnl.gov/projects/sundials/download/sundials-2.7.0.tar.gz \ + && tar -xvzf sundials-2.7.0.tar.gz \ + && rm sundials-2.7.0.tar.gz \ + && cd sundials-2.7.0 \ + && mkdir build \ + && mkdir -p /usr/examples \ + && cd build/ \ + && cmake \ + -DCMAKE_INSTALL_PREFIX=/usr/ \ + -DEXAMPLES_INSTALL_PATH=/usr/examples \ + -DCMAKE_LINKER=/usr/lib \ + -DLAPACK_ENABLE=ON \ + -DOPENMP_ENABLE=ON \ + -DMPI_ENABLE=ON \ + ../ \ + && make \ + && make install \ + && cd / \ + && rm -r sundials-2.7.0 + +# ---------------------------------------------------------------- +# Build and install BOUT++ +# ---------------------------------------------------------------- + +# configure and build BOUT++ source code +RUN useradd -ms /bin/bash boutuser \ + && echo -e "boutforever\nboutforever" | passwd boutuser \ + && usermod -aG wheel boutuser \ + && echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers + +USER boutuser +WORKDIR /home/boutuser + +RUN git clone -b master --depth 1 git://github.com/boutproject/BOUT-dev.git BOUT-master \ + && chown boutuser /home/boutuser/BOUT-master + +WORKDIR /home/boutuser/BOUT-master + +RUN ./configure --with-sundials=/usr/ --with-fftw --with-netcdf --enable-openmp --with-cvode --with-arkode --with-lapack LIBS="-llapack -lblas" --enable-shared \ + && make \ + && make clean-remove-object-files + +ENV PYTHONPATH=/home/boutuser/BOUT-master/tools/pylib/:$PYTHONPATH +ENV PYTHONIOENCODING=utf-8 + +##################### +# Make common folder for moving data to/from host +WORKDIR /home/boutuser +RUN mkdir bout-img-shared diff --git a/arch/arch-bout-master.dkr b/arch/arch-bout-master.dkr new file mode 100644 index 0000000..bf201f6 --- /dev/null +++ b/arch/arch-bout-master.dkr @@ -0,0 +1,111 @@ +# ================================================================================ +# Dockerfile to setup build environment for BOUT-master build +# +# Build example: +# sudo docker build -t boutproject/bout-master:3b23201-arch -f arch-bout-master.dkr . +# +# ================================================================================ + +FROM archlinux/base +MAINTAINER Ben Dudson "benjamin.dudson@york.ac.uk" + +# ---------------------------------------------------------------- +# Convenient network/system tools, python, dependencies +# ---------------------------------------------------------------- + +RUN pacman -Syu --noconfirm \ + && pacman -Sy --noconfirm emacs-nox vim nano git gcc gcc-fortran \ + fftw cblas lapack cmake sudo core/which gawk \ + wget make file m4 hdf5 netcdf netcdf-cxx \ + python-numpy python-scipy python-matplotlib ipython openmpi \ + && pacman -Scc --noconfirm + +##################### +# Install SUNDIALS + +WORKDIR / +RUN wget https://computation.llnl.gov/projects/sundials/download/sundials-2.7.0.tar.gz \ + && tar -xvzf sundials-2.7.0.tar.gz \ + && rm sundials-2.7.0.tar.gz \ + && cd sundials-2.7.0 \ + && mkdir build \ + && mkdir -p /usr/examples \ + && cd build/ \ + && cmake \ + -DCMAKE_INSTALL_PREFIX=/usr/ \ + -DEXAMPLES_INSTALL_PATH=/usr/examples \ + -DCMAKE_LINKER=/usr/lib \ + -DLAPACK_ENABLE=ON \ + -DOPENMP_ENABLE=ON \ + -DMPI_ENABLE=ON \ + ../ \ + && make \ + && make install \ + && cd / \ + && rm -r sundials-2.7.0 + +##################### +# Install PETSC +# +# Notes: +# - Moved URL for hypre 2.14 release +# - Need python2 for PETSc configure, but remove after install + +WORKDIR / +RUN pacman -Sy --noconfirm core/diffutils \ + && pacman -Scc --noconfirm \ + && wget https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.14.2.tar.gz \ + && tar -xvzf petsc-lite-3.14.2.tar.gz \ + && cd petsc-3.14.2/ \ + && ./configure --with-mpi=yes --with-shared-libraries --with-precision=double --with-scalar-type=real \ +--download-hypre=https://github.com/hypre-space/hypre/archive/v2.14.0.tar.gz \ + && make -f /petsc-3.14.2/makefile all \ + && make -f /petsc-3.14.2/makefile PETSC_DIR=/petsc-3.14.2 PETSC_ARCH=arch-linux-c-debug check \ + && ln -s /petsc-3.14.2/arch-linux-c-debug/include/* /usr/include/ \ + && ln -s /petsc-3.14.2/arch-linux-c-debug/lib/*a /usr/lib/ \ + && mkdir -p /usr/lib/modules/ \ + && ln -s /petsc-3.14.2/arch-linux-c-debug/lib/modules/* /usr/lib/modules/ \ + && cd /petsc-3.14.2/arch-linux-c-debug/ \ + && rm -r externalpackages obj \ + && cd /petsc-3.14.2/ \ + && rm -r src + +ENV PETSC_DIR=/petsc-3.14.2/ +ENV PETSC_ARCH=arch-linux-c-debug + +#################### +# Cython + +RUN pacman -Sy --noconfirm cython ipython \ + && pacman -Scc --noconfirm + +# ---------------------------------------------------------------- +# Build and install BOUT++ +# ---------------------------------------------------------------- + +# configure and build BOUT++ source code +RUN useradd -ms /bin/bash boutuser \ + && echo -e "boutforever\nboutforever" | passwd boutuser \ + && usermod -aG wheel boutuser \ + && echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers + +USER boutuser +WORKDIR /home/boutuser + +RUN git clone -b master --depth 1 git://github.com/boutproject/BOUT-dev.git BOUT-master \ + && chown boutuser /home/boutuser/BOUT-master + +WORKDIR /home/boutuser/BOUT-master + +RUN ./configure --with-petsc PETSC_DIR=/petsc-3.14.2 PETSC_ARCH=arch-linux-c-debug --with-sundials=/usr/ --with-fftw --with-netcdf --enable-openmp --with-cvode --with-arkode --with-lapack LIBS="-llapack -lblas" --enable-shared --with-hypre \ + && make \ + && make python \ + && make clean-remove-object-files + +ENV PYTHONPATH=/home/boutuser/BOUT-master/tools/pylib/:$PYTHONPATH +ENV PYTHONIOENCODING=utf-8 + +##################### +# Make common folder for moving data to/from host +WORKDIR /home/boutuser +RUN mkdir bout-img-shared diff --git a/arch/arch-bout-next-sundials.dkr b/arch/arch-bout-next-sundials.dkr new file mode 100644 index 0000000..9410d73 --- /dev/null +++ b/arch/arch-bout-next-sundials.dkr @@ -0,0 +1,75 @@ +# ================================================================================ +# Dockerfile to setup build environment for BOUT-next build +# +# Build example: +# sudo docker build -t boutproject/bout-next:4cee87c-sundials-arch -f arch-bout-next-sundials.dkr . +# +# ================================================================================ + +FROM archlinux/base +MAINTAINER Ben Dudson "benjamin.dudson@york.ac.uk" + +# ---------------------------------------------------------------- +# Convenient network/system tools, python, dependencies +# ---------------------------------------------------------------- + +RUN pacman -Syu --noconfirm \ + && pacman -Sy --noconfirm emacs-nox vim nano git gcc gcc-fortran \ + fftw cblas lapack cmake sudo core/which gawk \ + wget make file m4 hdf5 netcdf netcdf-cxx \ + python-numpy python-scipy python-matplotlib ipython openmpi \ + && pacman -Scc --noconfirm + +##################### +# Install SUNDIALS + +WORKDIR / +RUN wget https://computation.llnl.gov/projects/sundials/download/sundials-2.7.0.tar.gz \ + && tar -xvzf sundials-2.7.0.tar.gz \ + && rm sundials-2.7.0.tar.gz \ + && cd sundials-2.7.0 \ + && mkdir build \ + && mkdir -p /usr/examples \ + && cd build/ \ + && cmake \ + -DCMAKE_INSTALL_PREFIX=/usr/ \ + -DEXAMPLES_INSTALL_PATH=/usr/examples \ + -DCMAKE_LINKER=/usr/lib \ + -DLAPACK_ENABLE=ON \ + -DOPENMP_ENABLE=ON \ + -DMPI_ENABLE=ON \ + ../ \ + && make \ + && make install \ + && cd / \ + && rm -r sundials-2.7.0 + +# ---------------------------------------------------------------- +# Build and install BOUT++ +# ---------------------------------------------------------------- + +# configure and build BOUT++ source code +RUN useradd -ms /bin/bash boutuser \ + && echo -e "boutforever\nboutforever" | passwd boutuser \ + && usermod -aG wheel boutuser \ + && echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers + +USER boutuser +WORKDIR /home/boutuser + +RUN git clone -b next --depth 1 git://github.com/boutproject/BOUT-dev.git BOUT-next \ + && chown boutuser /home/boutuser/BOUT-next + +WORKDIR /home/boutuser/BOUT-next + +RUN ./configure --with-sundials=/usr/ --with-fftw --with-netcdf --enable-openmp --with-cvode --with-arkode --with-lapack LIBS="-llapack -lblas" \ + && make \ + && make clean-remove-object-files + +ENV PYTHONPATH=/home/boutuser/BOUT-next/tools/pylib/:$PYTHONPATH +ENV PYTHONIOENCODING=utf-8 + +##################### +# Make common folder for moving data to/from host +WORKDIR /home/boutuser +RUN mkdir bout-img-shared diff --git a/arch/arch-bout-next.dkr b/arch/arch-bout-next.dkr new file mode 100644 index 0000000..2139fd5 --- /dev/null +++ b/arch/arch-bout-next.dkr @@ -0,0 +1,112 @@ +# ================================================================================ +# Dockerfile to setup build environment for BOUT-next build +# +# Build example: +# sudo docker build -t boutproject/bout-next:4cee87c-arch -f arch-bout-next.dkr . +# +# ================================================================================ + +FROM archlinux/base +MAINTAINER Ben Dudson "benjamin.dudson@york.ac.uk" + +# ---------------------------------------------------------------- +# Convenient network/system tools, python, dependencies +# ---------------------------------------------------------------- + +RUN pacman -Syu --noconfirm \ + && pacman -Sy --noconfirm emacs-nox vim nano git gcc gcc-fortran \ + fftw cblas lapack cmake sudo core/which gawk \ + wget make file m4 hdf5 netcdf netcdf-cxx \ + python-numpy python-scipy python-matplotlib ipython openmpi \ + && pacman -Scc --noconfirm + +##################### +# Install SUNDIALS + +WORKDIR / +RUN wget https://computation.llnl.gov/projects/sundials/download/sundials-2.7.0.tar.gz \ + && tar -xvzf sundials-2.7.0.tar.gz \ + && rm sundials-2.7.0.tar.gz \ + && cd sundials-2.7.0 \ + && mkdir build \ + && mkdir -p /usr/examples \ + && cd build/ \ + && cmake \ + -DCMAKE_INSTALL_PREFIX=/usr/ \ + -DEXAMPLES_INSTALL_PATH=/usr/examples \ + -DCMAKE_LINKER=/usr/lib \ + -DLAPACK_ENABLE=ON \ + -DOPENMP_ENABLE=ON \ + -DMPI_ENABLE=ON \ + ../ \ + && make \ + && make install \ + && cd / \ + && rm -r sundials-2.7.0 + +##################### +# Install PETSC +# +# Notes: +# - Moved URL for hypre 2.14 release +# - Need python2 for PETSc configure, but remove after install + +WORKDIR / +RUN pacman -Sy --noconfirm core/diffutils \ + && pacman -Scc --noconfirm \ + && wget https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.14.2.tar.gz \ + && tar -xvzf petsc-lite-3.14.2.tar.gz \ + && cd petsc-3.14.2/ \ + && ./configure --with-mpi=yes --with-shared-libraries --with-precision=double --with-scalar-type=real \ +--download-hypre=https://github.com/hypre-space/hypre/archive/v2.14.0.tar.gz \ + && make -f /petsc-3.14.2/makefile all \ + && make -f /petsc-3.14.2/makefile PETSC_DIR=/petsc-3.14.2 PETSC_ARCH=arch-linux-c-debug check \ + && ln -s /petsc-3.14.2/arch-linux-c-debug/include/* /usr/include/ \ + && ln -s /petsc-3.14.2/arch-linux-c-debug/lib/*a /usr/lib/ \ + && mkdir -p /usr/lib/modules/ \ + && ln -s /petsc-3.14.2/arch-linux-c-debug/lib/modules/* /usr/lib/modules/ \ + && cd /petsc-3.14.2/arch-linux-c-debug/ \ + && rm -r externalpackages obj \ + && cd /petsc-3.14.2/ \ + && rm -r src + +ENV PETSC_DIR=/petsc-3.14.2/ +ENV PETSC_ARCH=arch-linux-c-debug + +#################### +# Cython + +RUN pacman -Sy --noconfirm cython ipython \ + && pacman -Scc --noconfirm + +# ---------------------------------------------------------------- +# Build and install BOUT++ +# ---------------------------------------------------------------- + +# configure and build BOUT++ source code +RUN useradd -ms /bin/bash boutuser \ + && echo -e "boutforever\nboutforever" | passwd boutuser \ + && usermod -aG wheel boutuser \ + && echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers + +USER boutuser +WORKDIR /home/boutuser + +RUN git clone -b next --depth 1 git://github.com/boutproject/BOUT-dev.git BOUT-next \ + && chown boutuser /home/boutuser/BOUT-next + +WORKDIR /home/boutuser/BOUT-next + +RUN ./configure --with-petsc PETSC_DIR=/petsc-3.14.2 PETSC_ARCH=arch-linux-c-debug --with-sundials=/usr/ --with-fftw --with-netcdf --enable-openmp --with-cvode --with-arkode --with-lapack LIBS="-llapack -lblas" --enable-shared --with-hypre \ + && make \ + && make python \ + && make clean-remove-object-files + +ENV PYTHONPATH=/home/boutuser/BOUT-next/tools/pylib/:$PYTHONPATH +ENV PYTHONIOENCODING=utf-8 + +##################### +# Make common folder for moving data to/from host +WORKDIR /home/boutuser +RUN mkdir bout-img-shared + diff --git a/bout-3.1.dkr b/bout-3.1.dkr deleted file mode 100644 index fe67003..0000000 --- a/bout-3.1.dkr +++ /dev/null @@ -1,150 +0,0 @@ -# ================================================================================ -# Dockerfile to setup build environment for BOUT-next build -# -# Build example: sudo docker build -t boutproject/bout-next:9f4c663 -f bout-next.dkr .. -# -# ================================================================================ -FROM centos:centos7 -MAINTAINER Jarrod Leddy "jleddy@txcorp.com" - -# ---------------------------------------------------------------- -# Convenient network/system tools, python, dependencies -# ---------------------------------------------------------------- -RUN yum install -y emacs-nox vim nano git gfortran g++ gcc \ - mpich fftw-devel hdf5 blas-devel lapack-devel cmake zlib-devel hdf5-devel sudo \ - && yum clean all \ - && rm -rf /var/cache/yum - -# ---------------------------------------------------------------- -# Python -# ---------------------------------------------------------------- -RUN yum install -y python python-devel wget \ - && wget https://bootstrap.pypa.io/get-pip.py \ - && python get-pip.py \ - && rm get-pip.py -RUN pip install numpy scipy netcdf4 matplotlib ipython - -# ---------------------------------------------------------------- -# Get BOUT++ dependencies -# ---------------------------------------------------------------- - -##################### -# Install mpich -WORKDIR / -RUN yum install -y wget make file gcc-c++ \ - && wget https://www.mpich.org/static/tarballs/3.2.1/mpich-3.2.1.tar.gz \ - && tar -xzvf mpich-3.2.1.tar.gz \ - && rm mpich-3.2.1.tar.gz \ - && cd mpich-3.2.1 \ - && ./configure \ - && make \ - && make install \ - && cd / \ - && rm -r mpich-3.2.1 - -##################### -# Install SUNDIALS - -WORKDIR / -RUN wget https://computation.llnl.gov/projects/sundials/download/sundials-2.7.0.tar.gz \ - && tar -xvzf sundials-2.7.0.tar.gz \ - && rm sundials-2.7.0.tar.gz \ - && cd sundials-2.7.0 \ - && mkdir build \ - && mkdir -p /usr/examples \ - && cd build/ \ - && cmake \ - -DCMAKE_INSTALL_PREFIX=/usr/ \ - -DEXAMPLES_INSTALL_PATH=/usr/examples \ - -DCMAKE_LINKER=/usr/lib \ - -DLAPACK_ENABLE=ON \ - -DOPENMP_ENABLE=ON \ - -DMPI_ENABLE=ON \ - ../ \ - && make \ - && make install \ - && cd / \ - && rm -r sundials-2.7.0 - -##################### -# Install PETSC - -WORKDIR / -RUN yum install -y bison flex \ - && wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.5.4.tar.gz \ - && tar -xvzf petsc-lite-3.5.4.tar.gz \ - && cd petsc-3.5.4/ \ - && ./configure --with-clanguage=cxx --with-mpi=yes --with-precision=double --with-scalar-type=real \ ---download-hypre=1 --with-shared-libraries=0 --with-sundials-dir=/usr \ - && make -f /petsc-3.5.4/makefile all \ - && make -f /petsc-3.5.4/makefile PETSC_DIR=/petsc-3.5.4 PETSC_ARCH=arch-linux2-cxx-debug test \ - && ln -s /petsc-3.5.4/arch-linux2-cxx-debug/include/* /usr/include/ \ - && ln -s /petsc-3.5.4/arch-linux2-cxx-debug/lib/*a /usr/lib/ \ - && ln -s /petsc-3.5.4/arch-linux2-cxx-debug/lib/modules/* /usr/lib/modules/ \ - && cd /petsc-3.5.4/arch-linux2-cxx-debug/ \ - && rm -r externalpackages obj \ - && cd /petsc-3.5.4/ \ - && rm -r src - -ENV PETSC_DIR=/petsc-3.5.4/ -ENV PETSC_ARCH=arch-linux2-cxx-debug - - -##################### -# Install NETCDF -WORKDIR / -RUN yum install -y zlib-devel hdf5-devel m4 \ - && wget https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.4.1.tar.gz \ - && tar -xzvf netcdf-4.4.1.tar.gz \ - && rm netcdf-4.4.1.tar.gz \ - && cd /netcdf-4.4.1/ \ - && ./configure --prefix=/usr/local --disable-netcdf-4 --disable-dap --enable-parallel \ - && make \ - && make install \ - && cd / \ - && rm -r netcdf-4.4.1 - -##################### -# Install NETCDF-cxx -# WORKDIR / - -RUN wget https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx-4.2.tar.gz \ - && tar -xzvf netcdf-cxx-4.2.tar.gz \ - && rm netcdf-cxx-4.2.tar.gz \ - && cd netcdf-cxx-4.2/ \ - && ./configure --prefix=/usr/local \ - && make \ - && make install \ - && cd / \ - && rm -r netcdf-cxx-4.2 - -# ---------------------------------------------------------------- -# Build and install BOUT++ -# ---------------------------------------------------------------- -# configure and build BOUT++ source code -RUN useradd -ms /bin/bash boutuser \ - && echo -e "boutforever\nboutforever" | passwd boutuser \ - && usermod -aG wheel boutuser - -USER boutuser -WORKDIR /home/boutuser - -RUN wget https://github.com/boutproject/BOUT-dev/archive/v3.1.tar.gz \ - && tar -xzf v3.1.tar.gz \ - && chown boutuser /home/boutuser/BOUT-dev-3.1 \ - && rm v3.1.tar.gz - -WORKDIR /home/boutuser/BOUT-dev-3.1 - -RUN ./configure --with-petsc=/petsc-3.5.4 --with-sundials=/usr \ - && make - -ENV PYTHONPATH=/home/boutuser/BOUT-dev-3.1/tools/pylib/:$PYTHONPATH -ENV PYTHONIOENCODING=utf-8 - -ENV PATH=/home/boutuser/BOUT-dev-3.1/bin/:$PATH - -##################### -# Make common folder for moving data to/from host -WORKDIR /home/boutuser -RUN mkdir bout-img-shared diff --git a/bout-next.dkr b/bout-next.dkr deleted file mode 100644 index 7b96823..0000000 --- a/bout-next.dkr +++ /dev/null @@ -1,174 +0,0 @@ -# ================================================================================ -# Dockerfile to setup build environment for BOUT-next build -# -# Build example: sudo docker build -t boutproject/bout-next:a4f453c -f bout-next.dkr . -# -# ================================================================================ -FROM centos:centos7 -MAINTAINER Jarrod Leddy "jleddy@txcorp.com" - -# ---------------------------------------------------------------- -# Convenient network/system tools, python, dependencies -# ---------------------------------------------------------------- -RUN yum install -y emacs-nox vim nano git gfortran g++ gcc \ - mpich fftw-devel hdf5 blas-devel lapack-devel cmake zlib-devel hdf5-devel sudo \ - && yum clean all \ - && rm -rf /var/cache/yum - -# ---------------------------------------------------------------- -# Python -# ---------------------------------------------------------------- -RUN yum install -y https://centos7.iuscommunity.org/ius-release.rpm \ - && yum install -y python36u python36u-pip python36u-devel \ - && ln -s /usr/bin/python3.6 /usr/bin/python3 \ - && python3 -m pip install numpy scipy netcdf4 matplotlib - -# ---------------------------------------------------------------- -# Get BOUT++ dependencies -# ---------------------------------------------------------------- - -##################### -# Install mpich -WORKDIR / -RUN yum install -y wget make file gcc-c++ \ - && wget https://www.mpich.org/static/tarballs/3.2.1/mpich-3.2.1.tar.gz \ - && tar -xzvf mpich-3.2.1.tar.gz \ - && rm mpich-3.2.1.tar.gz \ - && cd mpich-3.2.1 \ - && ./configure --enable-shared \ - && make \ - && make install \ - && cd / \ - && rm -r mpich-3.2.1 - -##################### -# Install SUNDIALS - -WORKDIR / -RUN wget https://computation.llnl.gov/projects/sundials/download/sundials-2.7.0.tar.gz \ - && tar -xvzf sundials-2.7.0.tar.gz \ - && rm sundials-2.7.0.tar.gz \ - && cd sundials-2.7.0 \ - && mkdir build \ - && mkdir -p /usr/examples \ - && cd build/ \ - && cmake \ - -DCMAKE_INSTALL_PREFIX=/usr/ \ - -DEXAMPLES_INSTALL_PATH=/usr/examples \ - -DCMAKE_LINKER=/usr/lib \ - -DLAPACK_ENABLE=ON \ - -DOPENMP_ENABLE=ON \ - -DBUILD_SHARED_LIBS=ON \ - -DMPI_ENABLE=ON \ - ../ \ - && make \ - && make install \ - && cd / \ - && rm -r sundials-2.7.0 - -##################### -# Install PETSC - -WORKDIR / -RUN yum install -y bison flex \ - && wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.9.3.tar.gz \ - && tar -xvzf petsc-lite-3.9.3.tar.gz \ - && cd petsc-3.9.3/ \ - && ./configure --with-clanguage=cxx --with-mpi=yes --with-shared-libraries --with-precision=double --with-scalar-type=real \ ---download-mumps=1 --download-scalapack=1 --download-blacs=1 --download-fblas-lapack=1 \ ---download-parmetis=1 --download-ptscotch=1 --download-metis=1 --with-sundials-dir=/usr \ - && make -f /petsc-3.9.3/makefile all \ - && make -f /petsc-3.9.3/makefile PETSC_DIR=/petsc-3.9.3 PETSC_ARCH=arch-linux2-cxx-debug test \ - && ln -s /petsc-3.9.3/arch-linux2-cxx-debug/include/* /usr/include/ \ - && ln -s /petsc-3.9.3/arch-linux2-cxx-debug/lib/*a /usr/lib/ \ - && ln -s /petsc-3.9.3/arch-linux2-cxx-debug/lib/modules/* /usr/lib/modules/ \ - && cd /petsc-3.9.3/arch-linux2-cxx-debug/ \ - && rm -r externalpackages obj \ - && cd /petsc-3.9.3/ \ - && rm -r src - -ENV PETSC_DIR=/petsc-3.9.3/ -ENV PETSC_ARCH=arch-linux2-cxx-debug - -##################### -# Install SLEPC -WORKDIR / -RUN wget http://slepc.upv.es/download/distrib/slepc-3.9.2.tar.gz \ - && tar xzf slepc-3.9.2.tar.gz \ - && rm slepc-3.9.2.tar.gz \ - && cd slepc-3.9.2/ \ - && ./configure \ - && make SLEPC_DIR=$PWD PETSC_DIR=/petsc-3.9.3/ PETSC_ARCH=arch-linux2-cxx-debug \ - && export SLEPC_DIR=/slepc-3.9.2 \ - && make test \ - && rm -r /slepc-3.9.2/arch-linux2-cxx-debug/obj \ - && rm -r /slepc-3.9.2/src - -ENV SLEPC_DIR=/slepc-3.9.2 - -##################### -# Install NETCDF -WORKDIR / -RUN yum install -y zlib-devel hdf5-devel \ - && wget https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.6.1.tar.gz \ - && tar -xzvf netcdf-4.6.1.tar.gz \ - && rm netcdf-4.6.1.tar.gz \ - && cd /netcdf-4.6.1/ \ - && ./configure --prefix=/usr/local --disable-dap --enable-parallel --enable-shared \ - && make \ - && make install \ - && cd / \ - && rm -r netcdf-4.6.1 - -##################### -# Install NETCDF-cxx -WORKDIR / - -RUN wget https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx4-4.3.0.tar.gz \ - && tar -xzvf netcdf-cxx4-4.3.0.tar.gz \ - && rm netcdf-cxx4-4.3.0.tar.gz \ - && cd netcdf-cxx4-4.3.0/ \ - && ./configure --prefix=/usr/local --enable-shared \ - && make \ - && make install \ - && cd / \ - && rm -r netcdf-cxx4-4.3.0 - -#################### -# Cython - -RUN python3 -m pip install cython ipython - -# ---------------------------------------------------------------- -# Build and install BOUT++ -# ---------------------------------------------------------------- -# configure and build BOUT++ source code -RUN useradd -ms /bin/bash boutuser \ - && echo -e "boutforever\nboutforever" | passwd boutuser \ - && usermod -aG wheel boutuser - -USER boutuser -WORKDIR /home/boutuser - -RUN git clone -b next --depth 1 git://github.com/boutproject/BOUT-dev.git BOUT-next \ - && chown boutuser /home/boutuser/BOUT-next - -WORKDIR /home/boutuser/BOUT-next - -RUN ./configure --with-petsc PETSC_DIR=/petsc-3.9.3 PETSC_ARCH=arch-linux2-cxx-debug --with-sundials=/usr/ --with-fftw --with-netcdf --enable-openmp --with-cvode --with-arkode --with-slepc --with-lapack LIBS="-llapack -lblas" --localedir=$PWD/locale --enable-shared \ - && make \ - && make python \ - && make clean-remove-object-files - -ENV PYTHONPATH=/home/boutuser/BOUT-next/tools/pylib/:$PYTHONPATH -ENV PYTHONIOENCODING=utf-8 - -RUN git submodule update --init --recursive \ - && make check-unit-tests \ - && make clean-unit-tests \ - && rm tests/unit/serial_tests - -##################### -# Make common folder for moving data to/from host -WORKDIR /home/boutuser -RUN mkdir bout-img-shared diff --git a/bout.dkr b/bout.dkr deleted file mode 100644 index 1966d85..0000000 --- a/bout.dkr +++ /dev/null @@ -1,175 +0,0 @@ -# ================================================================================ -# Dockerfile to setup build environment for BOUT++ master branch -# -# Build example: sudo docker build -t boutproject/release:4.2 -f bout.dkr . -# -# ================================================================================ -FROM centos:centos7 -MAINTAINER Jarrod Leddy "jleddy@txcorp.com" - -# ---------------------------------------------------------------- -# Convenient network/system tools, python, dependencies -# ---------------------------------------------------------------- -RUN yum install -y emacs-nox vim nano git gfortran g++ gcc \ - mpich fftw-devel hdf5 blas-devel lapack-devel cmake zlib-devel hdf5-devel sudo \ - && yum clean all \ - && rm -rf /var/cache/yum - -# ---------------------------------------------------------------- -# Python -# ---------------------------------------------------------------- -RUN yum install -y https://centos7.iuscommunity.org/ius-release.rpm \ - && yum install -y python36u python36u-pip python36u-devel \ - && ln -s /usr/bin/python3.6 /usr/bin/python3 \ - && python3 -m pip install numpy scipy netcdf4 matplotlib - -# ---------------------------------------------------------------- -# Get BOUT++ dependencies -# ---------------------------------------------------------------- - -##################### -# Install mpich -WORKDIR / -RUN yum install -y wget make file gcc-c++ \ - && wget https://www.mpich.org/static/tarballs/3.2.1/mpich-3.2.1.tar.gz \ - && tar -xzvf mpich-3.2.1.tar.gz \ - && rm mpich-3.2.1.tar.gz \ - && cd mpich-3.2.1 \ - && ./configure --enable-shared \ - && make \ - && make install \ - && cd / \ - && rm -r mpich-3.2.1 - -##################### -# Install SUNDIALS - -WORKDIR / -RUN wget https://computation.llnl.gov/projects/sundials/download/sundials-2.7.0.tar.gz \ - && tar -xvzf sundials-2.7.0.tar.gz \ - && rm sundials-2.7.0.tar.gz \ - && cd sundials-2.7.0 \ - && mkdir build \ - && mkdir -p /usr/examples \ - && cd build/ \ - && cmake \ - -DCMAKE_INSTALL_PREFIX=/usr/ \ - -DEXAMPLES_INSTALL_PATH=/usr/examples \ - -DCMAKE_LINKER=/usr/lib \ - -DLAPACK_ENABLE=ON \ - -DOPENMP_ENABLE=ON \ - -DBUILD_SHARED_LIBS=ON \ - -DMPI_ENABLE=ON \ - ../ \ - && make \ - && make install \ - && cd / \ - && rm -r sundials-2.7.0 - -##################### -# Install PETSC - -WORKDIR / -RUN yum install -y bison flex \ - && wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.9.3.tar.gz \ - && tar -xvzf petsc-lite-3.9.3.tar.gz \ - && cd petsc-3.9.3/ \ - && ./configure --with-clanguage=cxx --with-mpi=yes --with-shared-libraries --with-precision=double --with-scalar-type=real \ ---download-mumps=1 --download-scalapack=1 --download-blacs=1 --download-fblas-lapack=1 \ ---download-parmetis=1 --download-ptscotch=1 --download-metis=1 --with-sundials-dir=/usr \ - && make -f /petsc-3.9.3/makefile all \ - && make -f /petsc-3.9.3/makefile PETSC_DIR=/petsc-3.9.3 PETSC_ARCH=arch-linux2-cxx-debug test \ - && ln -s /petsc-3.9.3/arch-linux2-cxx-debug/include/* /usr/include/ \ - && ln -s /petsc-3.9.3/arch-linux2-cxx-debug/lib/*a /usr/lib/ \ - && ln -s /petsc-3.9.3/arch-linux2-cxx-debug/lib/modules/* /usr/lib/modules/ \ - && cd /petsc-3.9.3/arch-linux2-cxx-debug/ \ - && rm -r externalpackages obj \ - && cd /petsc-3.9.3/ \ - && rm -r src - -ENV PETSC_DIR=/petsc-3.9.3/ -ENV PETSC_ARCH=arch-linux2-cxx-debug - -##################### -# Install SLEPC -WORKDIR / -RUN wget http://slepc.upv.es/download/distrib/slepc-3.9.2.tar.gz \ - && tar xzf slepc-3.9.2.tar.gz \ - && rm slepc-3.9.2.tar.gz \ - && cd slepc-3.9.2/ \ - && ./configure \ - && make SLEPC_DIR=$PWD PETSC_DIR=/petsc-3.9.3/ PETSC_ARCH=arch-linux2-cxx-debug \ - && export SLEPC_DIR=/slepc-3.9.2 \ - && make test \ - && rm -r /slepc-3.9.2/arch-linux2-cxx-debug/obj \ - && rm -r /slepc-3.9.2/src - -ENV SLEPC_DIR=/slepc-3.9.2 - -##################### -# Install NETCDF -WORKDIR / -RUN yum install -y zlib-devel hdf5-devel \ - && wget https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.6.1.tar.gz \ - && tar -xzvf netcdf-4.6.1.tar.gz \ - && rm netcdf-4.6.1.tar.gz \ - && cd /netcdf-4.6.1/ \ - && ./configure --prefix=/usr/local --disable-dap --enable-parallel --enable-shared \ - && make \ - && make install \ - && cd / \ - && rm -r netcdf-4.6.1 - -##################### -# Install NETCDF-cxx -WORKDIR / - -RUN wget https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx4-4.3.0.tar.gz \ - && tar -xzvf netcdf-cxx4-4.3.0.tar.gz \ - && rm netcdf-cxx4-4.3.0.tar.gz \ - && cd netcdf-cxx4-4.3.0/ \ - && ./configure --prefix=/usr/local --enable-shared \ - && make \ - && make install \ - && cd / \ - && rm -r netcdf-cxx4-4.3.0 - -#################### -# Cython - -RUN python3 -m pip install cython ipython - -# ---------------------------------------------------------------- -# Build and install BOUT++ -# ---------------------------------------------------------------- -# configure and build BOUT++ source code -RUN useradd -ms /bin/bash boutuser \ - && echo -e "boutforever\nboutforever" | passwd boutuser \ - && usermod -aG wheel boutuser - -USER boutuser -WORKDIR /home/boutuser - -RUN git clone -b master --depth 1 git://github.com/boutproject/BOUT-dev.git BOUT-dev \ - && chown boutuser /home/boutuser/BOUT-dev - -WORKDIR /home/boutuser/BOUT-dev - -RUN ./configure --with-petsc PETSC_DIR=/petsc-3.9.3 PETSC_ARCH=arch-linux2-cxx-debug --with-sundials=/usr/ --with-fftw --with-netcdf --enable-openmp --with-cvode --with-arkode --with-slepc --with-lapack LIBS="-llapack -lblas" --localedir=$PWD/locale --enable-shared \ - && make \ - && make python \ - && make clean-remove-object-files - -ENV PYTHONPATH=/home/boutuser/BOUT-dev/tools/pylib/:$PYTHONPATH -ENV PYTHONIOENCODING=utf-8 - -RUN git submodule update --init --recursive \ - && make check-unit-tests \ - && make clean-unit-tests \ - && rm tests/unit/serial_tests - -##################### -# Make common folder for moving data to/from host -WORKDIR /home/boutuser -RUN mkdir bout-img-shared - diff --git a/buildBOUT.sh b/buildBOUT.sh deleted file mode 100755 index fa145dc..0000000 --- a/buildBOUT.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -source ./shellfunc.sh ; echo "" - -echo "------------------------------------------" -echo " Build BOUT++ image " -echo "------------------------------------------" -echo "" - -echo "Enter Dockerfile name prefix" -read DOCKER_NAME - -HOSTNAME=`hostname -s` -DOCKERFILE="$DOCKER_NAME.dkr" -IMAGE_NAME="$DOCKER_NAME-img" -SCR_NAME="/scr_eris/jleddy/projects/BOUT-docker/" -# CONTRIB_DIR="/opt/contrib" -# -# if [ ! -d ./contrib ]; then -# echo "contrib directory needs to be local for Dockerfile to accept" -# runcmd "cp -R $CONTRIB_DIR ." -# fi - -if [ ! -d $SCR_NAME ];then - echo "Directory $SCR_NAME not found. Check build script" - exit -fi - -echo "DOCKERFILE = $DOCKERFILE" -echo "IMAGE_NAME = $IMAGE_NAME" -echo "SCR_NAME = $SCR_NAME" -echo "" - -# -# The -f gives the file name of the 'Dockerfile' -# The last argument sets the PATH to be used to find files in the -# 'Dockerfile' and to resolve the '-f' option -# -runcmd "sudo docker build -t '$IMAGE_NAME' -f $DOCKERFILE $SCR_NAME" - -echo "" -echo "docker images:" -echo "" -sudo docker images