Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
FROM ubuntu:jammy

RUN apt-get update && \
DEBIAN_FRONTEND='noninteractive' \
DEBCONF_NONINTERACTIVE_SEEN='true' \
apt-get install --yes \
gfortran \
build-essential \
git \
curl \
libblas-dev \
liblapack-dev \
autoconf \
automake \
autoconf-archive \
libpython2.7-dev \
libpython2.7 \
python2.7 \
libtool \
libc6-dev \
mpich \
sudo \
nano

RUN useradd \
--create-home \
lithomop_user && echo "lithomop_user:password" | chpasswd


RUN sudo adduser lithomop_user sudo

# Need to create this link so that pythia will compile
RUN ln -s /usr/bin/python2.7 /usr/bin/python;

WORKDIR /home/lithomop_user

USER lithomop_user

#apt will install pip3, so need to do this to install pip 2.7
RUN curl -L -O "https://bootstrap.pypa.io/pip/2.7/get-pip.py"; echo "password" | sudo -S python2.7 get-pip.py; pip install setuptools; pip install ez_setup;


ENV PETSC_DIR="/home/lithomop_user/petsc-2.3.3-p16"
ENV PETSC_ARCH="/home/lithomop_user/petsc-2.3.3-p16/lib/linux-gnu-c-debug"
Comment on lines +43 to +44

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PETSC_ARCH should either be unset ("prefix install") or just the identifier (as in linux-gnu-c-debug, or whatever you specify).

ENV PATH="/home/lithomop_user/petsc-2.3.3-p16/externalpackages/mpich2-1.0.5p4/bin:${PATH}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a build directory (for --download-mpich), but you installed an mpich from apt above (you might have wanted libmpich-dev).


RUN curl -L -O "https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-2.3.3.tar.gz"; tar -xvf petsc-2.3.3.tar.gz; cd petsc-2.3.3-p16; mkdir externalpackages; cd externalpackages; curl -L -O "https://www.mpich.org/static/downloads/1.0.5p4/mpich2-1.0.5p4.tar.gz"; tar -xvf mpich2-1.0.5p4.tar.gz; cd mpich2-1.0.5p4; ./configure; echo "password" | sudo -S make all; echo "password" | sudo -S make install;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need petsc-2.3.3 (released in 2007) or can we use a later version?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest removing the manual download of mpich and instead use the system version from apt.

RUN cd petsc-2.3.3-p16; ./config/configure.py PETSC_ARCH=linux-gnu-c-debug --with_mpi=1; make all PETSC_ARCH=linux-gnu-c-debug; make install PETSC_ARCH=linux-gnu-c-debug;

RUN curl -L -O "https://github.com/geodynamics/pythia/releases/download/v0.8.1.16/pythia-0.8.1.16.tar.gz"; tar -xvf pythia-0.8.1.16.tar.gz; cd pythia-0.8.1.16; curl -L -O "https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg"; echo "password" | sudo -S python setup.py build; echo "password" | sudo -S python setup.py build install;

#ENV PYTHONPATH=/usr/bin/python

RUN git clone --recurse-submodules 'https://github.com/jarettbakerdunn/lithomop.git'; cd lithomop; git checkout devel; git fetch; git pull; curl -L -O "https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg"; mkdir aux-config; autoreconf -i;

RUN cd lithomop; git checkout devel; git fetch; git pull; mv docker/ez_setup.py /home/lithomop_user/.local/lib/python2.7/site-packages/; rm /home/lithomop_user/lithomop/m4/cit_python.m4; mv docker/cit_python.m4 /home/lithomop_user/lithomop/m4/;

RUN cd lithomop; autoupdate; automake --add-missing; autoreconf;
WORKDIR /home/lithomop_user/lithomop
Loading