Skip to content

Instantly share code, notes, and snippets.

@julesghub
Created September 14, 2017 05:16
Show Gist options
  • Save julesghub/efdb5ab57dcb1a3f6ac0ec1b659eb091 to your computer and use it in GitHub Desktop.
Save julesghub/efdb5ab57dcb1a3f6ac0ec1b659eb091 to your computer and use it in GitHub Desktop.
uw2 docker dev with petsc-3.7.6
# get the development version
FROM underworldcode/underworld2_untested:dev
MAINTAINER [email protected]
# modify original underworldcode/underworld2 images
RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive \
apt-get remove petsc-dev -yq && \
apt-get autoremove -yq && \
apt-get install -yq \
wget libmumps-dev liblapack-dev gfortran
# download petsc-lite-3.7.6
ENV PETSC_DIR /apps/petsc
RUN mkdir -p $PETSC_DIR
WORKDIR $PETSC_DIR
RUN wget -qO - http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.7.6.tar.gz | tar zxv
# install petsc-lite-3.7.6
ENV PETSC_PREFIX=/usr/local/petsc-3.7.6
ENV PETSC_DIR $PETSC_DIR/petsc-3.7.6
WORKDIR $PETSC_DIR
RUN ./configure --prefix=$PETSC_PREFIX --with-scalapack-lib=-lscalapack-openmpi \
--download-hdf5=yes --download-mpi4py=yes --with-shared-libraries --with-pic=1 \
--useThreads=0 --with-debugging=0 --with-mumps=1 && \
make all && make install && chmod +rx $PETSC_DIR
ENV PETSC_DIR $PETSC_PREFIX
ENV HDF5_DIR $PETSC_DIR
ENV PYTHONPATH $PETSC_DIR/libs:$PYTHONPATH
# Reuse the existing underworld repository and reconfigure and compile
WORKDIR /root/underworld2/libUnderworld
# get underworld, compile, delete some unnecessary files, trust notebooks, copy to workspace
RUN ./configure.py --with-debugging=0 && \
./compile.py && \
rm .sconsign.dblite && \
rm -fr .sconf_temp && \
cd build && \
rm -fr libUnderworldPy && \
rm -fr StGermain && \
rm -fr gLucifer && \
rm -fr Underworld && \
rm -fr StgFEM && \
rm -fr StgDomain && \
rm -fr PICellerator && \
rm -fr Solvers
# expose notebook port
EXPOSE 8888
# expose glucifer port
EXPOSE 9999
# setup space for working in
VOLUME /workspace/user_data
WORKDIR /workspace
# launch notebook
CMD ["jupyter", "notebook", " --no-browser"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment