forked from NumCosmo/NumCosmo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-clmm-jupyter
122 lines (97 loc) · 3.4 KB
/
Dockerfile-clmm-jupyter
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
ARG BASE_CONTAINER=jupyter/base-notebook
FROM $BASE_CONTAINER AS compile-image
USER root
# Install basic stuff
RUN apt-get update && apt-get install -y \
nano \
wget \
git \
cmake \
pkg-config
# Install compilers
RUN apt-get update && apt-get install -y \
gcc-8 \
gfortran-8
# Install GLib and GObject related packages
RUN apt-get update && apt-get install -y \
gtk-doc-tools \
gobject-introspection \
libgirepository1.0-dev \
libglib2.0-dev
# Install package building tools
RUN apt-get update && apt-get install -y \
autoconf \
automake \
autotools-dev \
libtool \
bison \
flex
# Install dependencies
RUN apt-get update && apt-get install -y \
libgsl-dev \
libgmp-dev \
libmpfr-dev \
libcfitsio-dev \
libfftw3-dev \
libnlopt-dev \
liblapack-dev \
libopenblas-dev \
libhdf5-dev \
libflint-arb-dev
WORKDIR /root
RUN ln -s $(which gfortran-8) /usr/bin/gfortran
RUN git clone https://github.com/tmcclintock/cluster_toolkit.git
RUN cd cluster_toolkit && python setup.py install --root=/root
RUN git clone -b "issue/254/clmm_numcosmo_cmp" https://github.com/LSSTDESC/CLMM.git
RUN cd CLMM && python setup.py install --root=/root && mkdir -p /root/usr/share/CLMM/examples && cp -rf examples/* /root/usr/share/CLMM/examples
RUN git clone https://bitbucket.org/bdiemer/colossus.git
RUN cd colossus && python setup.py install --root=/root
#RUN git clone https://github.com/cmbant/forutils.git
#RUN cd forutils && make
RUN git clone --recursive https://github.com/cmbant/CAMB.git
RUN cd CAMB && python setup.py install --root=/root
RUN conda install --quiet --yes numpy
RUN git clone https://github.com/LSSTDESC/CCL.git
RUN cd CCL && python setup.py install --root=/root
# NumCosmo (Creates a NumCosmo dir and copy everything from context to it)
RUN cd && mkdir NumCosmo usr
COPY . /root/NumCosmo/
WORKDIR /root/NumCosmo
RUN NOCONFIGURE=yes ./autogen.sh
RUN CC=gcc-8 FC=gfortran-8 F90=gfortran-8 F77=gfortran-8 CFLAGS="-O3 -g -Wall" FCFLAGS="-O3 -g -Wall" ./configure --prefix=/usr --enable-opt-cflags
RUN make -j12
RUN make install DESTDIR=/root
FROM $BASE_CONTAINER AS runtime-image
USER root
# Install python gobject support
RUN conda install --quiet --yes \
pygobject numpy matplotlib astropy scipy ipywidgets pyyaml && \
conda clean --all -f -y && \
npm cache clean --force && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER
# Install dependencies (runtime only)
RUN apt-get update && apt-get install -y \
libgfortran5 \
libgsl23 \
libgmp10 \
libmpfr6 \
libcfitsio5 \
libfftw3-double3 \
libfftw3-single3 \
libnlopt0 \
liblapack3 \
libopenblas-base \
libhdf5-100 \
libflint-arb2
COPY --from=compile-image /root/usr /usr
COPY --from=compile-image /root/opt /opt
# Set environment variables
ENV CUBACORES=1
ENV OMP_NUM_THREADS=1
ENV OMP_THREAD_LIMIT=1
ENV GI_TYPELIB_PATH="/usr/lib/girepository-1.0"
RUN cp -rf /usr/share/numcosmo-0.15.2/notebooks/* work/
RUN cp -rf /usr/share/CLMM/examples/* work/
# Switch back to jovyan to avoid accidental container runs as root
USER $NB_UID