-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
266 lines (239 loc) · 10 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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
FROM ubuntu:jammy
# Suppress debconf warnings
ENV DEBIAN_FRONTEND noninteractive
# Install dependencies
RUN echo 'deb http://us.archive.ubuntu.com/ubuntu jammy main multiverse' >> /etc/apt/sources.list && \
apt-get update -y && \
apt-get --no-install-recommends -y install \
build-essential \
autoconf \
autotools-dev \
automake \
autogen \
libtool \
pkg-config \
csh \
gcc \
gfortran \
wget \
git \
libcfitsio-dev \
pgplot5 \
swig3.0 \
python3 \
python3-pip \
python3-dev \
libfftw3-3 \
libfftw3-bin \
libfftw3-dev \
libfftw3-single3 \
libx11-dev \
libpng-dev \
libpnglite-dev \
libxml2 \
libxml2-dev \
libltdl-dev \
gsl-bin \
libgsl-dev \
libglib2.0-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get -y clean
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 \
&& ln -s /usr/bin/swig3.0 /usr/bin/swig
# Install python3 packages
RUN pip3 install setuptools -U && \
pip3 install numpy -U && \
pip3 install scipy -U && \
pip3 install watchdog && \
pip3 install matplotlib -U && \
pip3 install bilby -U && \
pip3 install -U setuptools setuptools_scm pep517 && \
pip3 install -U emcee && \
pip3 install jupyterlab -U && \
pip3 install git+https://github.com/FRBs/sigpyproc3 && \
pip3 install astropy -U
# PGPLOT
ENV PGPLOT_DIR /usr/lib/pgplot5
ENV PGPLOT_FONT /usr/lib/pgplot5/grfont.dat
ENV PGPLOT_INCLUDES /usr/include
ENV PGPLOT_BACKGROUND white
ENV PGPLOT_FOREGROUND black
ENV PGPLOT_DEV /xs
ENV PSRHOME /software
WORKDIR $PSRHOME
# Pull all repos
RUN wget http://www.atnf.csiro.au/people/pulsar/psrcat/downloads/psrcat_pkg.tar.gz && \
tar -xvf psrcat_pkg.tar.gz -C $PSRHOME && \
git clone https://bitbucket.org/psrsoft/tempo2.git && \
git clone git://git.code.sf.net/p/psrchive/code psrchive && \
git clone https://github.com/SixByNine/psrxml.git && \
git clone https://github.com/straten/epsic.git && \
git clone git://git.code.sf.net/p/tempo/tempo && \
git clone git://git.code.sf.net/p/dspsr/code dspsr && \
git clone https://github.com/scottransom/presto.git
#PSRCAT
ENV PSRCAT_FILE $PSRHOME/psrcat_tar/psrcat.db
ENV PATH $PATH:$PSRHOME/psrcat_tar
WORKDIR $PSRHOME/psrcat_tar
RUN sed -i s/gcc/'gcc -fcommon'/g makeit && /bin/bash makeit && \
rm -f ../psrcat_pkg.tar.gz
# PSRXML
ENV PSRXML=$PSRHOME/psrxml
ENV PATH=$PATH:$PSRXML/install/bin
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PSRXML/install/lib
ENV C_INCLUDE_PATH=$C_INCLUDE_PATH:$PSRXML/install/include
WORKDIR $PSRXML
RUN autoreconf --install --warnings=none
RUN ./configure --prefix=$PSRXML/install && \
make -j && \
make install && \
rm -rf .git
# tempo
ENV TEMPO=$PSRHOME/tempo
ENV PATH=$PATH:$PSRHOME/tempo/bin
WORKDIR $PSRHOME/tempo
RUN ./prepare && \
./configure --prefix=$PSRHOME/tempo && \
make && \
make install
WORKDIR $PSRHOME
#calceph
RUN wget https://www.imcce.fr/content/medias/recherche/equipes/asd/calceph/calceph-3.5.3.tar.gz && \
tar -xvzf calceph-3.5.3.tar.gz
ENV CALCEPH=$PSRHOME"/calceph-3.5.3" \
PATH=$PATH:$CALCEPH"/install/bin" \
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CALCEPH"/install/lib" \
C_INCLUDE_PATH=$C_INCLUDE_PATH:$CALCEPH"/install/include"
WORKDIR $CALCEPH
RUN ./configure --prefix=$CALCEPH/install --with-pic --enable-shared --enable-static --enable-fortran --enable-thread && \
make && \
make check && \
make install
# tempo2
ENV TEMPO2=$PSRHOME/tempo2/T2runtime
ENV PATH=$PATH:$PSRHOME/tempo2/T2runtime/bin
ENV C_INCLUDE_PATH=$C_INCLUDE_PATH:$PSRHOME/tempo2/T2runtime/include
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PSRHOME/tempo2/T2runtime/lib
WORKDIR $PSRHOME/tempo2
RUN sync && perl -pi -e 's/chmod \+x/#chmod +x/' bootstrap # Get rid of: returned a non-zero code: 126.
RUN ./bootstrap && \
./configure --x-libraries=/usr/lib/x86_64-linux-gnu --enable-shared --enable-static --with-pic F77=gfortran && \
make -j $(nproc) && \
make install && \
make plugins-install && \
rm -rf .git
COPY gbt2gps.clk $TEMPO2/clock/
COPY mk2utc.clk $TEMPO2/clock/
# PSRCHIVE
ENV PSRCHIVE=$PSRHOME/psrchive
ENV PATH=$PATH:$PSRCHIVE/install/bin
ENV C_INCLUDE_PATH=$C_INCLUDE_PATH:$PSRCHIVE/install/include
ENV LD_LIBRARY_PATH=c$LD_LIBRARY_PATH:$PSRCHIVE/install/lib
ENV PYTHONPATH $PSRCHIVE/install/lib/python2.7/site-packages
WORKDIR $PSRCHIVE
#RUN git checkout 844461775b4b6f4b4e786d323ae82224b63c0e85
RUN ./bootstrap && \
./configure --prefix=$PSRCHIVE/install --x-libraries=/usr/lib/x86_64-linux-gnu --with-psrxml-dir=$PSRXML/install --enable-shared --enable-static F77=gfortran LDFLAGS="-L"$PSRXML"/install/lib" LIBS="-lpsrxml -lxml2" && \
make -j $(nproc) && \
make && \
make install
# DSPSR
ENV DSPSR=$PSRHOME/dspsr
ENV PATH=$PATH:$DSPSR/install/bin
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DSPSR/install/lib
ENV C_INCLUDE_PATH=$C_INCLUDE_PATH:$DSPSR/install/include
WORKDIR $DSPSR
RUN ./bootstrap && \
echo "apsr asp bcpm bpsr caspsr cpsr cpsr2 dummy fits kat lbadr lbadr64 lump lwa puma2 sigproc ska1 " > backends.list && \
./configure --prefix=$DSPSR/install && \
make -j $(nproc) && \
make && \
make install
ENV PSRFITSDEFN /software/psrchive/install/share/psrheader.fits
# PRESTO 4
ENV PRESTO=$PSRHOME/presto
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PRESTO/lib
ENV C_INCLUDE_PATH=$C_INCLUDE_PATH:$PRESTO/include
WORKDIR $PRESTO/src
# The following is necessary if your system isn't Ubuntu 20.04
RUN make cleaner
# Now build from scratch
RUN make libpresto slalib
WORKDIR $PRESTO/src
RUN make makewisdom && \
make prep && \
make -j 1 && \
make clean
ENV PATH="$PRESTO/bin/:${PATH}"
WORKDIR $PRESTO
RUN pip3 install $PRESTO && \
sed -i 's/env python/env python3/' $PRESTO/bin/*py
# python3 tests/test_presto_python.py
LABEL Vivek Venkatraman Krishnan "[email protected]"
ENV PYTHONPATH $PYTHONPATH:$PSRCHIVE/install/lib/python3.10/site-packages/
RUN echo 'deb http://us.archive.ubuntu.com/ubuntu jammy main multiverse' >> /etc/apt/sources.list && \
apt-get update -y && \
apt-get --no-install-recommends -y install nano vim emacs && \
rm -rf /var/lib/apt/lists/* && \
apt-get -y clean
WORKDIR $PSRHOME
RUN echo "" >> .bashrc && \
echo "if [ -e \$PSRHOME/source_this.bash ]; then" >> .bashrc && \
echo " source \$PSRHOME/source_this.bash" >> .bashrc && \
echo "fi" >> .bashrc && \
echo "" >> .bashrc && \
echo "alias rm='rm -i'" >> source_this.bash && \
echo "alias mv='mv -i'" >> source_this.bash && \
echo "export OSTYPE=linux" >> source_this.bash && \
echo "" >> source_this.bash && \
echo "# Up arrow search" >> source_this.bash && \
echo "export HISTFILE=\$HOME/.bash_eternal_history" >> source_this.bash && \
echo "export HISTFILESIZE=" >> source_this.bash && \
echo "export HISTSIZE=" >> source_this.bash && \
echo "export HISTCONTROL=ignoreboth" >> source_this.bash && \
echo "export HISTIGNORE=\"l:ll:lt:ls:bg:fg:mc:history::ls -lah:..:ls -l;ls -lh;lt;la\"" >> source_this.bash && \
echo "export HISTTIMEFORMAT=\"%F %T \"" >> source_this.bash && \
echo "export PROMPT_COMMAND=\"history -a\"" >> source_this.bash && \
echo "bind '\"\e[A\":history-search-backward'" >> source_this.bash && \
echo "bind '\"\e[B\":history-search-forward'" >> source_this.bash && \
echo "" >> source_this.bash && \
echo "# tempo" >> source_this.bash && \
echo "export TEMPO=\$PSRHOME/tempo" >> source_this.bash && \
echo "export PATH=\$PATH:\$TEMPO/bin" >> source_this.bash && \
echo "" >> source_this.bash && \
echo "# tempo2" >> source_this.bash && \
echo "export TEMPO2=\$PSRHOME/tempo2/T2runtime" >> source_this.bash && \
echo "export PATH=\$PATH:\$TEMPO2/bin" >> source_this.bash && \
echo "export C_INCLUDE_PATH=\$C_INCLUDE_PATH:\$TEMPO2/include" >> source_this.bash && \
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$TEMPO2/lib" >> source_this.bash && \
echo "" >> source_this.bash && \
echo "# tempo2" >> source_this.bash && \
echo "export TEMPO2=\$PSRHOME/tempo2/T2runtime" >> source_this.bash && \
echo "export PATH=\$PATH:\$TEMPO2/bin" >> source_this.bash && \
echo "export C_INCLUDE_PATH=\$C_INCLUDE_PATH:\$TEMPO2/include" >> source_this.bash && \
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$TEMPO2/lib" >> source_this.bash && \
echo "export PYTHONPATH=\$PYTHONPATH:\$PSRCHIVE/install/lib/python3.6/site-packages/" >> source_this.bash && \
echo "" >> source_this.bash && \
echo "# DSPSR" >> source_this.bash && \
echo "export DSPSR=\$PSRHOME/dspsr" >> source_this.bash && \
echo "export PATH=\$PATH:\$DSPSR/install/bin" >> source_this.bash && \
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$DSPSR/install/lib" >> source_this.bash && \
echo "export C_INCLUDE_PATH=\$C_INCLUDE_PATH:\$DSPSR/install/include" >> source_this.bash && \
echo "export PSRFITSDEFN=/software/psrchive/install/share/psrheader.fits" >> source_this.bash && \
echo "# PRESTO" >> source_this.bash && \
echo "export PRESTO=$PSRHOME/presto" >> source_this.bash && \
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PRESTO/lib" >> source_this.bash && \
echo "export C_INCLUDE_PATH=$C_INCLUDE_PATH:$PRESTO/include" >> source_this.bash && \
echo 'export PS1="\[\e[4;30m\]\u@\h\[\e[0m\]:\[\e[1;10m\]\w\[\e[0m\]\$ (docker)> "' >> source_this.bash && \
echo 'alias ls="ls --color=auto"' >> source_this.bash && \
echo 'alias ll="ls -l"' >> source_this.bash && \
echo 'alias LL="ls -lL"' >> source_this.bash && \
echo 'alias lt="ls -lrt --color"' >> source_this.bash && \
echo 'alias lh="ls -lh --color"' >> source_this.bash && \
echo 'alias rm="rm -i"' >> source_this.bash && \
echo 'alias cp="cp -i"' >> source_this.bash && \
echo 'alias mv="mv -i"' >> source_this.bash && \
echo 'alias emacs="emacs -nw"' >> source_this.bash && \
echo "" >> source_this.bash
CMD ["bash"]