-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
67 lines (57 loc) · 1.79 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM ubuntu:14.04
# Install a few packages, as root
RUN apt-get update \
&& apt-get install -y \
wget \
mpich \
make \
git \
libx11-dev \
&& rm -rf /var/lib/apt/lists/*
# Create a new user and copy the current branch of Warp
# into the Docker container
RUN useradd --create-home warp_user
RUN mkdir /home/warp_user/warp/
COPY ./ /home/warp_user/warp/
RUN chown -R warp_user /home/warp_user/warp/
# Grant sudo access without password
RUN echo 'warp_user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# Switch to the new user
WORKDIR /home/warp_user
USER warp_user
# Install miniconda
RUN cd /home/warp_user \
&& wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh \
&& bash miniconda.sh -b \
&& rm miniconda.sh
ENV PATH /home/warp_user/miniconda2/bin:$PATH
# Install python dependencies for warp
RUN conda update conda \
&& conda install --yes \
numpy \
scipy \
pytest \
h5py \
&& conda clean --tarballs
# Install matplotlib and mpi4py via pip
RUN pip install matplotlib mpi4py
# Install Forthon
RUN pip install --upgrade pip \
&& pip install Forthon
# Compile warp
RUN cd warp/pywarp90 \
&& echo 'FCOMP= -F gfortran' >> Makefile.local \
&& echo 'FCOMP= -F gfortran --fcompex mpif90' >> Makefile.local.pympi \
&& echo "if parallel:" >> setup.local.py \
&& echo " library_dirs += ['/usr/lib/x86_64-linux-gnu']" >> setup.local.py \
&& echo " libraries = fcompiler.libs + ['mpichf90', 'mpich', 'opa', 'mpl']" >> setup.local.py \
&& make install \
&& make pinstall
# Install pygist
RUN git clone https://bitbucket.org/dpgrote/pygist.git \
&& cd pygist \
&& python setup.py config \
&& python setup.py install
# Prepare the run directory
RUN mkdir run/
WORKDIR /home/warp_user/run/