-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathDockerfile
More file actions
126 lines (113 loc) · 3.18 KB
/
Dockerfile
File metadata and controls
126 lines (113 loc) · 3.18 KB
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
123
124
125
126
FROM debian:buster
LABEL maintainer="goran.jelic-cizmek@unige.ch"
# download required packages and libraries
RUN apt-get update && \
apt-get install -yqq --no-install-recommends --no-install-suggests \
ca-certificates \
libfftw3-dev \
libgsl-dev \
libhdf5-mpich-dev \
mpich \
make \
g++ \
git \
subversion \
libcfitsio-dev \
libcurl4-gnutls-dev \
libtool \
autoconf \
automake
# downloading LATField2 and gevolution
RUN git clone https://github.com/daverio/LATfield2 latfield2
RUN git clone https://github.com/gevolution-code/gevolution-1.2 gevolution
# downloading extra optional dependencies
RUN git clone https://github.com/lesgourg/class_public class
RUN svn checkout https://svn.code.sf.net/p/healpix/code/trunk healpix
WORKDIR /class
# building the CLASS library
RUN make -j libclass.a
WORKDIR /healpix
# building the healpix library
# NOTE: there are missing files that autoconf needs to install,
# so we run that first
RUN autoreconf --install src/common_libraries/libsharp/
RUN autoreconf --install src/cxx/
RUN export FITSDIR="/usr/lib/x86_64-linux-gnu" && \
./configure --auto=c,cpp
RUN make -j c-all cpp-all
WORKDIR /gevolution
# compiling gevolution
RUN make \
INCLUDE+="\
-I/latfield2 \
-I/usr/include/hdf5/mpich \
-L/usr/lib/x86_64-linux-gnu/hdf5/mpich \
-I/class/include \
-L/class \
-I/healpix/include \
-L/healpix/lib" \
DGEVOLUTION+="\
-DHAVE_CLASS \
-DHAVE_HEALPIX" \
LIB="\
-lclass \
-fopenmp \
-lcfitsio \
-lchealpix \
-lfftw3 \
-lm \
-lhdf5 \
-lgsl \
-lgslcblas"
# linking the gevolution binary so it's executable anywhere (since /bin is in $PATH)
RUN ln -s /gevolution/gevolution /bin/gevolution
# compiling lccat
RUN make lccat
# linking it
RUN ln -s /gevolution/lccat /bin/lccat
# compiling lcmap
RUN make lcmap \
INCLUDE+="\
-I/healpix/include \
-I/healpix/include/healpix_cxx \
-L/healpix/lib" \
DGEVOLUTION+="\
-DHAVE_HEALPIX" \
LIB="\
-lcfitsio \
-lchealpix \
-lfftw3 \
-lm \
-lgsl \
-lgslcblas"
# linking it
RUN ln -s /gevolution/lcmap /bin/lcmap
# the linker doesn't find the healpix library by default, so we need to set it explicitly
ENV LD_LIBRARY_PATH "/healpix/lib"
# set the entry point
WORKDIR /data
# copy the settings files
RUN cp -a \
/gevolution/settings.ini \
/gevolution/sc1_crystal.dat \
/gevolution/class_tk.dat \
/data/
# making the output dir since gevolution doesn't build one by itself
RUN mkdir -p /data/output
# OPTIONAL: to run gevolution outside of the container without
# having to specify all of these parameters;
# of course, you can override this behavior
# by specifing the command after the container name;
# for instance, if you want to run the container interactively with a shell,
# you can instead use:
# `docker run -ti gevolution /bin/bash`
# if you want to use `lccat`, you can use:
# `docker run -ti gevolution lccat`
CMD [ \
"mpirun", \
"-np", "4", \
"gevolution", \
"-n", "2", \
"-m", "2", \
"-s", "settings.ini" \
]