forked from tikk3r/flocs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSingularity.lofar_sksp_py2
368 lines (329 loc) · 18.9 KB
/
Singularity.lofar_sksp_py2
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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
#Bootstrap: shub
#From: tikk3r/lofar-grid-hpccloud:lofar_sksp_base
# If building from a base image locally enable this instead.
Bootstrap: localimage
From: lofar_sksp_fedora_base.sif
%environment
export PYTHONPATH=
export INSTALLDIR=/opt/lofar
. $INSTALLDIR/init.sh
ulimit -n 4096
source $INSTALLDIR/pyenv-py2/bin/activate
%post
# General environment settings.
export J=6
export INSTALLDIR=/opt/lofar
export PYTHON_VERSION=2.7
# Enable MKL on AMD CPUs
export MKL_DEBUG_CPU_TYPE=5
# Path to where the patch for python-casacore's setup is stored.
export PYTHON_CASACORE_PATCH=$INSTALLDIR/python-casacore/python_casacore_setup_patch.patch
export PATCH_LOFAR=$INSTALLDIR/lofar/lofar.patch
# Settings relevant to the installed software.
export AOFLAGGER_VERSION=v2.15.0
export CASACORE_VERSION=v2.4.1
#export CASACORE_VERSION=latest
#export CASACORE_VERSION=v3.3.0
# Leave at latest, release versions crash for some reason.
export CASAREST_VERSION=latest
export DYSCO_VERSION=v1.0.1
export LOFAR_VERSION=3_2_18
#export LOFAR_VERSION=3_2_9
#export LOFAR_VERSION=4_0_17
export LOSOTO_VERSION=2.0
# Haven't figured out how to successfully build 1.9.2 yet...
export PYBDSF_VERSION=6ce374d
#export PYTHON_CASACORE_VERSION=v3.3.0
export PYTHON_CASACORE_VERSION=v2.2.1
export WSCLEAN_VERSION=latest
export HDF5_USE_FILE_LOCKING=FALSE
export CC=`which gcc`
export CXX=`which g++`
export CFLAGS="-mno-avx512f -mno-avx512pf -mno-avx512er -mno-avx512cd -mno-avx512vl -mno-avx512bw -mno-avx512dq -mno-avx512ifma -mno-avx512vbmi"
export CXXFLAGS="-std=c++11 -mno-avx512f -mno-avx512pf -mno-avx512er -mno-avx512cd -mno-avx512vl -mno-avx512bw -mno-avx512dq -mno-avx512ifma -mno-avx512vbmi"
export CPLUS_INCLUDE_PATH="/usr/include/c++/9:$CPLUS_INCLUDE_PATH:/usr/include/python2.7:$INSTALLDIR/casacore/include:/usr/include/boost:/usr/include/cfitsio"
export CPATH=/opt/intel/mkl/include:${INSTALLDIR}/casacore/include:$INSTALLDIR/LOFARBeam/include:$INSTALLDIR/idg/include:$INSTALLDIR/aoflagger/include:$CPATH
export CMAKE_PREFIX_PATH=$INSTALLDIR/aoflagger:$INSTALLDIR/casacore:$INSTALLDIR/lofar:$INSTALLDIR/LOFARBeam
export LD_LIBRARY_PATH=$INSTALLDIR/aoflagger/lib:$INSTALLDIR/casacore/lib:$INSTALLDIR/idg/lib:$INSTALLDIR/LOFARBeam/lib:LD_LIBRARY_PATH
export make=`which make`
export OLD_PYTHONPATH=$PYTHONPATH
mkdir -p $INSTALLDIR
ln -s /usr/lib64/libboost_python37.so /usr/lib64/libboost_python3.so
ln -s /usr/lib64/libboost_numpy37.so /usr/lib64/libboost_numpy3.so
ln -s /usr/lib64/libboost_python27.so /usr/lib64/libboost_python.so
ln -s /usr/lib64/libboost_numpy27.so /usr/lib64/libboost_numpy.so
#
# Setup the Python environment.
#
wget https://raw.githubusercontent.com/tikk3r/lofar-grid-hpccloud/fedora/requirements.txt -O $INSTALLDIR/requirements.txt
wget https://raw.githubusercontent.com/tikk3r/lofar-grid-hpccloud/fedora/requirements3.txt -O $INSTALLDIR/requirements3.txt
pip install xmlrunner
pip3 install xmlrunner
pip --no-cache-dir install "virtualenv<20"
virtualenv $INSTALLDIR/pyenv-py3 --python=python3
source $INSTALLDIR/pyenv-py3/bin/activate
pip install numpy
export HDF5_VERSION=1.8.20
pip install --no-binary h5py h5py
pip install -r $INSTALLDIR/requirements3.txt
pip install lofar-h5plot
deactivate
virtualenv $INSTALLDIR/pyenv-py2 --python=python2
source $INSTALLDIR/pyenv-py2/bin/activate
pip install numpy
pip install --no-binary h5py h5py
pip install -r $INSTALLDIR/requirements.txt
#
# Install difmap
#
mkdir -p $INSTALLDIR/difmap
cd $INSTALLDIR/difmap
wget ftp://ftp.astro.caltech.edu/pub/difmap/difmap2.5e.tar.gz
tar xf difmap2.5e.tar.gz
cd uvf_difmap
wget https://raw.githubusercontent.com/nealjackson/loop3_difmap/master/corplt.c -O difmap_src/corplt.c
sed -i.bak -e '97d' configure
sed -i.bak -e '97 i PGPLOT_LIB=/usr/lib64/libpgplot.so.5' configure
./configure linux-i486-gcc
export PGPLOT_LIB=/usr/lib64/libpgplot.so.5
export CFLAGS="-L/usr/lib64/libpgplot.so.5"
./makeall
export CFLAGS="-mno-avx512f -mno-avx512pf -mno-avx512er -mno-avx512cd -mno-avx512vl -mno-avx512bw -mno-avx512dq -mno-avx512ifma -mno-avx512vbmi"
#
# Install PyBDSF
#
mkdir -p ${INSTALLDIR}/pybdsf
if [ "${PYBDSF_VERSION}" = "latest" ]; then cd ${INSTALLDIR}/pybdsf && git clone https://github.com/lofar-astron/pybdsf pybdsf && cd pybdsf; fi
if [ "${PYBDSF_VERSION}" != "latest" ]; then cd ${INSTALLDIR}/pybdsf && git clone https://github.com/lofar-astron/pybdsf && cd ${INSTALLDIR}/pybdsf/pybdsf && git checkout ${PYBDSF_VERSION}; fi
mkdir -p ${INSTALLDIR}/pybdsf/lib/python${PYTHON_VERSION}/site-packages/
mkdir -p ${INSTALLDIR}/pybdsf/lib64/python${PYTHON_VERSION}/site-packages/
#export PYTHONPATH=${INSTALLDIR}/pybdsf/lib/python${PYTHON_VERSION}/site-packages:${INSTALLDIR}/pybdsf/lib64/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
cd ${INSTALLDIR}/pybdsf/pybdsf
python setup.py install # --prefix=${INSTALLDIR}/pybdsf
#
# Install CASAcore
#
mkdir -p ${INSTALLDIR}/casacore/build
mkdir -p ${INSTALLDIR}/casacore/data
cd $INSTALLDIR/casacore && git clone https://github.com/casacore/casacore.git src
if [ "${CASACORE_VERSION}" != "latest" ]; then cd ${INSTALLDIR}/casacore/src && git checkout tags/${CASACORE_VERSION}; fi
# Backport patch UVFITS for LOFAR. This is fixed in recent versions > May 26 2020
wget https://patch-diff.githubusercontent.com/raw/casacore/casacore/pull/1033.patch -O $INSTALLDIR/casacore/1033.patch
cd $INSTALLDIR/casacore/src && patch --fuzz 3 -p1 < $INSTALLDIR/casacore/1033.patch
cd ${INSTALLDIR}/casacore/data && wget --retry-connrefused ftp://anonymous@ftp.astron.nl/outgoing/Measures/WSRT_Measures.ztar
cd ${INSTALLDIR}/casacore/data && tar xf WSRT_Measures.ztar
#cd ${INSTALLDIR}/casacore/build && cmake -DCMAKE_INSTALL_PREFIX=${INSTALLDIR}/casacore/ -DDATA_DIR=${INSTALLDIR}/casacore/data -DBUILD_PYTHON=True -DUSE_OPENMP=True -DUSE_FFTW3=TRUE -DUSE_HDF5=True -DBUILD_PYTHON3=True ../src/
cd ${INSTALLDIR}/casacore/build && cmake -DCMAKE_INSTALL_PREFIX=${INSTALLDIR}/casacore/ -DDATA_DIR=${INSTALLDIR}/casacore/data -DBUILD_PYTHON=True -DUSE_OPENMP=True -DUSE_FFTW3=TRUE -DUSE_HDF5=True -DBUILD_PYTHON3=False ../src/
cd ${INSTALLDIR}/casacore/build && $make -s -j ${J}
cd ${INSTALLDIR}/casacore/build && $make install
rm -rf $INSTALLDIR/casacore/src
rm -rf $INSTALLDIR/casacore/build
#
# Install Python-CASAcore
#
# Finding libraries is broken, patch the setup to include the previously installed boost and casacore libraries.
mkdir ${INSTALLDIR}/python-casacore
cd ${INSTALLDIR}/python-casacore && git clone https://github.com/casacore/python-casacore && wget https://raw.githubusercontent.com/tikk3r/lofar-grid-hpccloud/master/patches/python_casacore_setup_patch.patch
if [ "$PYTHON_CASACORE_VERSION" != "latest" ]; then cd ${INSTALLDIR}/python-casacore/python-casacore && git checkout tags/${PYTHON_CASACORE_VERSION}; fi
cd ${INSTALLDIR}/python-casacore/python-casacore
python setup.py build_ext -I${INSTALLDIR}/casacore/include/:/usr/include/python2.7 -L${INSTALLDIR}/casacore/lib/:/usr/lib64/
mkdir -p ${INSTALLDIR}/python-casacore/lib/python${PYTHON_VERSION}/site-packages/
mkdir -p ${INSTALLDIR}/python-casacore/lib64/python${PYTHON_VERSION}/site-packages/
#export PYTHONPATH=${INSTALLDIR}/python-casacore/lib/python${PYTHON_VERSION}/site-packages:${INSTALLDIR}/python-casacore/lib64/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
cd ${INSTALLDIR}/python-casacore/python-casacore
python setup.py install #--prefix=${INSTALLDIR}/python-casacore/
#
# Install Dysco
#
mkdir -p $INSTALLDIR/dysco/build
cd $INSTALLDIR/dysco && git clone https://github.com/aroffringa/dysco.git src && cd src
cd $INSTALLDIR/dysco/build && cmake -DCMAKE_INSTALL_PREFIX=$INSTALLDIR/dysco -DCASACORE_ROOT_DIR=$INSTALLDIR/casacore -DPORTABLE=True ../src && $make -s -j $J && $make install
rm -rf $INSTALLDIR/dysco/src
#
# Install AOFlagger
#
mkdir -p ${INSTALLDIR}/aoflagger/build
if [ "${AOFLAGGER_VERSION}" = "latest" ]; then cd ${INSTALLDIR}/aoflagger && git clone git://git.code.sf.net/p/aoflagger/code aoflagger && cd ${INSTALLDIR}/aoflagger/aoflagger; fi
if [ "${AOFLAGGER_VERSION}" != "latest" ]; then cd ${INSTALLDIR}/aoflagger && git clone git://git.code.sf.net/p/aoflagger/code aoflagger && cd ${INSTALLDIR}/aoflagger/aoflagger && git checkout tags/${AOFLAGGER_VERSION}; fi
cd ${INSTALLDIR}/aoflagger/build && cmake -DCMAKE_INSTALL_PREFIX=${INSTALLDIR}/aoflagger/ -DCASACORE_ROOT_DIR=${INSTALLDIR}/casacore -DBUILD_SHARED_LIBS=ON -DPORTABLE=True ../aoflagger
cd ${INSTALLDIR}/aoflagger/build && $make -s -j ${J}
cd ${INSTALLDIR}/aoflagger/build && $make install
rm -rf $INSTALLDIR/aoflagger/build
rm -rf $INSTALLDIR/aoflagger/src
#
# Install LOFAR
#
mkdir -p ${INSTALLDIR}/lofar/build/gnucxx11_opt
if [ "${LOFAR_VERSION}" = "latest" ]; then cd ${INSTALLDIR}/lofar && svn checkout https://svn.astron.nl/LOFAR/trunk src; fi
if [ "${LOFAR_VERSION}" != "latest" ]; then cd ${INSTALLDIR}/lofar && svn checkout https://svn.astron.nl/LOFAR/tags/LOFAR-Release-${LOFAR_VERSION} src; fi
cd $INSTALLDIR/lofar && svn update --depth=infinity $INSTALLDIR/lofar/src/CMake
wget https://raw.githubusercontent.com/tikk3r/lofar-grid-hpccloud/master/patches/lofar.patch
patch $INSTALLDIR/lofar/src/CMake/variants/GNUCXX11.cmake $PATCH_LOFAR
cd ${INSTALLDIR}/lofar/build/gnucxx11_opt
#cmake -DCMAKE_PREFIX_PATH=$INSTALLDIR/aoflagger:$INSTALLDIR/casacore:$INSTALLDIR/dysco -DBUILD_PACKAGES="StationResponse pystationresponse ParmDB pyparmdb Pipeline MS" -DCMAKE_INSTALL_PREFIX=$INSTALLDIR/lofar/ -DUSE_LOG4CPLUS=OFF -DUSE_OPENMP=True ${INSTALLDIR}/lofar/src/
cmake -DCMAKE_PREFIX_PATH=$INSTALLDIR/aoflagger:$INSTALLDIR/casacore:$INSTALLDIR/dysco -DBUILD_PACKAGES="Pipeline" -DCMAKE_INSTALL_PREFIX=$INSTALLDIR/lofar/ -DUSE_LOG4CPLUS=OFF -DUSE_OPENMP=True -DBUILD_PYTHON3=OFF ${INSTALLDIR}/lofar/src/
$make -s -j $J
$make install
rm -rf $INSTALLDIR/lofar/build
rm -rf $INSTALLDIR/lofar/src
#
# Install the standalone StationResponse libraries.
#
echo Installing LOFARBeam...
mkdir -p $INSTALLDIR/LOFARBeam/build
cd $INSTALLDIR/LOFARBeam
#git clone https://github.com/lofar-astron/LOFARBeam.git src && cd src && git checkout db8d082
git clone https://github.com/lofar-astron/LOFARBeam.git src
cd build
# Install in the existing lofar python folder
cmake -DCMAKE_INSTALL_PREFIX=$INSTALLDIR/lofar ../src
$make -j $J
$make install
touch /opt/lofar/lofar/lib64/python2.7/site-packages/lofar/__init__.py
rm -rf $INSTALLDIR/LOFARBeam/src
#
# Install DPPP
#
mkdir -p $INSTALLDIR/DPPP/build
git clone https://github.com/lofar-astron/DP3.git $INSTALLDIR/DPPP/src
cd $INSTALLDIR/DPPP/src # && git checkout 8cda70f
cd $INSTALLDIR/DPPP/build
#cmake3 -DCMAKE_CXX_FLAGS="-D_GLIB_USE_CXX_ABI=1 -DBOOST_NO_CXX11_SCOPED_ENUMS" -DCMAKE_INSTALL_PREFIX:PATH=$INSTALLDIR/DPPP -DLOFAR_STATION_RESPONSE_DIR:PATH=$INSTALLDIR/LOFARBeam/include -DLOFAR_STATION_RESPONSE_LIB:FILEPATH=$INSTALLDIR/LOFARBeam/lib/libstationresponse.so -DIDGAPI_LIBRARIES=$INSTALLDIR/idg/lib/libidg-api.so -DIDGAPI_INCLUDE_DIRS=$INSTALLDIR/idg/include -DAOFLAGGER_INCLUDE_DIR=$INSTALLDIR/aoflagger/include -DAOFLAGGER_LIB=$INSTALLDIR/aoflagger/lib/libaoflagger.so ../src
cmake3 -DCMAKE_CXX_FLAGS="-D_GLIB_USE_CXX_ABI=1 -DBOOST_NO_CXX11_SCOPED_ENUMS" -DCMAKE_INSTALL_PREFIX:PATH=$INSTALLDIR/DPPP -DLOFAR_STATION_RESPONSE_DIR:PATH=$INSTALLDIR/lofar/include -DLOFAR_STATION_RESPONSE_LIB:FILEPATH=$INSTALLDIR/lofar/lib/libstationresponse.so -DIDGAPI_LIBRARIES=$INSTALLDIR/idg/lib/libidg-api.so -DIDGAPI_INCLUDE_DIRS=$INSTALLDIR/idg/include -DAOFLAGGER_INCLUDE_DIR=$INSTALLDIR/aoflagger/include -DAOFLAGGER_LIB=$INSTALLDIR/aoflagger/lib/libaoflagger.so ../src
$make -s -j $J && $make install
rm -rf $INSTALLDIR/DPPP/src
############################################
# Install Python packages for Python 2 now #
############################################
#
# Install RMextract
#
#export PYTHONPATH=$INSTALLDIR/RMextract/lib64/python$PYTHON_VERSION/site-packages:$PYTHONPATH
mkdir -p ${INSTALLDIR}/RMextract/build
#mkdir -p ${INSTALLDIR}/RMextract/lib64/python$PYTHON_VERSION/site-packages
cd ${INSTALLDIR}/RMextract/build
git clone https://github.com/lofar-astron/RMextract.git src
cd src
python setup.py build --add-lofar-utils
python setup.py install --add-lofar-utils #--prefix=${INSTALLDIR}/RMextract
#
# Install LoSoTo
#
#export PYTHONPATH=/opt/lofar/losoto/lib/python$PYTHON_VERSION/site-packages/:$PYTHONPATH
mkdir -p ${INSTALLDIR}/losoto/build
#mkdir -p ${INSTALLDIR}/losoto/lib/python$PYTHON_VERSION/site-packages
cd ${INSTALLDIR}/losoto/build
git clone https://github.com/revoltek/losoto.git src
cd src
python setup.py build
python setup.py install #--prefix=${INSTALLDIR}/losoto
#
# Install LSMTool.
#
mkdir -p $INSTALLDIR/lsmtool/lib/python$PYTHON_VERSION/site-packages
#export PYTHONPATH=$INSTALLDIR/lsmtool/lib/python$PYTHON_VERSION/site-packages:$PYTHONPATH
cd $INSTALLDIR/lsmtool
git clone https://github.com/darafferty/LSMTool.git lsmtool
cd $INSTALLDIR/lsmtool/lsmtool
python setup.py install #--prefix=$INSTALLDIR/lsmtool
############################################
# Install Python packages for Python 3 now #
############################################
deactivate
source $INSTALLDIR/pyenv-py3/bin/activate
#
# Install LoSoTo
#
#export PYTHONPATH=/opt/lofar/losoto/lib/python$PYTHON_VERSION/site-packages/:$PYTHONPATH
rm -rf ${INSTALLDIR}/losoto/build
mkdir -p ${INSTALLDIR}/losoto/build
#mkdir -p ${INSTALLDIR}/losoto/lib/python$PYTHON_VERSION/site-packages
cd ${INSTALLDIR}/losoto/build
git clone https://github.com/revoltek/losoto.git src
cd src
python setup.py build
python setup.py install #--prefix=${INSTALLDIR}/losoto
# Switch back to py2 to wrap up installation
deactivate
source $INSTALLDIR/pyenv-py2/bin/activate
#
# Install-WSClean
#
#export CMAKE_PREFIX_PATH=/opt/intel/mkl/lib/intel64:$INSTALLDIR/casacore:$INSTALLDIR/dysco:$INSTALLDIR/idg:$INSTALLDIR/lofar:$INSTALLDIR/LOFARBeam:/usr/lib64
#export LD_LIBRARY_PATH=/opt/intel/mkl/lib/intel64:$LD_LIBRARY_PATH
mkdir ${INSTALLDIR}/wsclean
if [ "$WSCLEAN_VERSION" != "latest" ]; then cd ${INSTALLDIR}/wsclean && wget http://downloads.sourceforge.net/project/wsclean/wsclean-${WSCLEAN_VERSION}/wsclean-${WSCLEAN_VERSION}.tar.bz2 && tar -xjf wsclean-${WSCLEAN_VERSION}.tar.bz2 && cd wsclean-${WSCLEAN_VERSION}; fi
#if [ "$WSCLEAN_VERSION" = "latest" ]; then cd ${INSTALLDIR}/wsclean && git clone git://git.code.sf.net/p/wsclean/code src && cd src && git checkout d171a5 && cd wsclean; fi
if [ "$WSCLEAN_VERSION" = "latest" ]; then cd ${INSTALLDIR}/wsclean && git clone git://git.code.sf.net/p/wsclean/code src && cd src && cd wsclean; fi
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=$INSTALLDIR/wsclean -DPORTABLE=True -DIDGAPI_LIBRARIES=$INSTALLDIR/idg/lib/libidg-api.so -DIDGAPI_INCLUDE_DIRS=$INSTALLDIR/idg/include ..
$make -j ${J}
$make install
#
# Install DS9
#
mkdir -p $INSTALLDIR/ds9/bin
cd $INSTALLDIR/ds9
wget http://ds9.si.edu/download/fedora30/ds9.fedora30.8.1.tar.gz
tar xf ds9*.tar.gz -C $INSTALLDIR/ds9/bin
echo "Installation directory contents:"
ls ${INSTALLDIR}
#
# Clean up unnecessary packages
#
export PYTHONPATH=$OLD_PYTHONPATH
#dnf -y remove dnf-plugins-core patch yum-utils git svn wget automake autoconf cmake make
dnf -y clean all
#
# init-lofar
#
ln -s /opt/lofar/DPPP/bin/DPPP /opt/lofar/lofar/bin/NDPPP
ln -s /opt/lofar/DPPP/bin/makesourcedb /opt/lofar/lofar/bin/makesourcedb
ln -s $INSTALLDIR/pyenv-py3/bin/h5plot /usr/bin/h5plot
echo export INSTALLDIR=$INSTALLDIR > $INSTALLDIR/init.sh
echo export HDF5_USE_FILE_LOCKING=FALSE >> $INSTALLDIR/init.sh
echo source \$INSTALLDIR/lofar/lofarinit.sh >> $INSTALLDIR/init.sh
echo export PYTHONPATH=\$INSTALLDIR/dppp:\$INSTALLDIR/lofar/lib64/python2.7/site-packages >> $INSTALLDIR/init.sh
echo export PATH=\$INSTALLDIR/aoflagger/bin:\$PATH >> $INSTALLDIR/init.sh
echo export PATH=\$INSTALLDIR/casacore/bin:\$PATH >> $INSTALLDIR/init.sh
echo export PATH=\$INSTALLDIR/ds9/bin:\$PATH >> $INSTALLDIR/init.sh
echo export PATH=\$INSTALLDIR/DPPP/bin:\$PATH >> $INSTALLDIR/init.sh
echo export PATH=\$INSTALLDIR/difmap/uvf_difmap:\$PATH >> $INSTALLDIR/init.sh
echo export PATH=\$INSTALLDIR/dysco/bin:\$PATH >> $INSTALLDIR/init.sh
echo export PATH=\$INSTALLDIR/lofar/bin:\$PATH >> $INSTALLDIR/init.sh
echo export PATH=\$INSTALLDIR/wsclean/bin:\$PATH >> $INSTALLDIR/init.sh
echo export LD_LIBRARY_PATH=\$INSTALLDIR/aoflagger/lib:\$INSTALLDIR/casacore/lib:\$INSTALLDIR/DPPP/lib:\$INSTALLDIR/dysco/lib:\$INSTALLDIR/idg/lib:\$INSTALLDIR/lofar/lib:\$INSTALLDIR/lofar/lib64:\$INSTALLDIR/LOFARBeam/lib:\$LD_LIBRARY_PATH >> $INSTALLDIR/init.sh
echo export LD_LIBRARY_PATH=/opt/intel/mkl/lib/intel64:\$LD_LIBRARY_PATH >> $INSTALLDIR/init.sh
echo export OPENBLAS_NUM_THREADS=64 >> $INSTALLDIR/init.sh
echo export OPENBLAS_MAX_THREADS=64 >> $INSTALLDIR/init.sh
echo export OMP_NUM_THREADS=64 >> $INSTALLDIR/init.sh
echo export OMP_MAX_THREADS=64 >> $INSTALLDIR/init.sh
echo export MKL_DEBUG_CPU_TYPE=5 >> $INSTALLDIR/init.sh
echo export PYTHONPATH=\$INSTALLDIR/dppp:\$INSTALLDIR/lofar/lib64/python2.7/site-packages:\$PYTHONPATH >> $INSTALLDIR/init_py2.sh
echo source \$INSTALLDIR/pyenv-py2/bin/activate >> $INSTALLDIR/init_py2.sh
echo "measures.directory: $INSTALLDIR/casacore/data" > $INSTALLDIR/.casarc
echo export CASARCFILES=\$INSTALLDIR/.casarc >> $INSTALLDIR/init.sh
#
# entrypoint
#
%runscript
. $INSTALLDIR/init.sh
ulimit -n 4096
%help
This Singularity image contains an install of LOFAR 4.0.17. In order to run your pipelines, you may need to know where the software is installed. The root directory is /opt/lofar, with most software installed as follows:
* AOFlagger: $INSTALLDIR/aoflagger
* Casacore: $INSTALLDIR/casacore
* Difmap: $INSTALLDIR/difmap
* DP3: $INSTALLDIR/DPPP
* Dysco: $INSTALLDIR/dysco
* DS9: $INSTALLDIR/ds9
* Dysco: $INSTALLDIR/dysco
* LOFAR: $INSTALLDIR/lofar
* WSClean: $INSTALLDIR/wsclean
Python packages such as losoto, lsmtool and RMextract are available in the respective virtual environments: /opt/lofar/pyenv-py2 and /opt/lofar/pyenv-py3. These can be activated by sourcing /opt/lofar/pyenv-py{2,3}/bin/activate. By default the Python 3 environment is active.
To execute a command directly, use
singularity exec -B <paths,that,need,to,be,accessible> <path to image> <command> <arguments>
for example, to run a genericpipeline parset, the following command can be used:
singularity exec lofar.simg genericpipeline.py -d -c pipeline.cfg pipeline.parset
To enter a shell within the image, use
singularity shell -B <paths,that,need,to,be,accessible> <path to image>