-
Notifications
You must be signed in to change notification settings - Fork 1
/
wsclean.def
107 lines (86 loc) · 3.49 KB
/
wsclean.def
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
Bootstrap: debootstrap
MirrorURL: http://archive.ubuntu.com/ubuntu/
OSVersion: jammy
%labels
APPLICATION_NAME Ubuntu LTS + Nvidia CUDA + wsclean
OS_VERSION 22.04 + CUDA 12.4.0
APPLICATION_URL https://developer.nvidia.com/cuda-zone
SYSTEM_NAME ilifu
SYSTEM_SINGULARITY_VERSION 2.6.1
SYSTEM_URL http://www.ilifu.ac.za
AUTHOR_NAME ilifu support
AUTHOR_EMAIL [email protected]
%environment
# Set system locale
export LC_ALL=C
# Nvidia CUDA Path
export CPATH="/usr/local/cuda/include:$CPATH"
export PATH="/usr/local/cuda/bin:$PATH"
export PYTHONPATH="$PYTHONPATH:/opt/build/EveryBeam/lib/python3.10"
export LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH"
export CUDA_HOME="/usr/local/cuda"
%post
##############################################################################
# Setting up Environment
# Nvidia CUDA Path
export CPATH="/usr/local/cuda/include:$CPATH"
export PATH="/usr/local/cuda/bin:$PATH"
export LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH"
export CUDA_HOME="/usr/local/cuda"
# Fix command prompt in Singularity 3.5.2
printf 'export PS1="\u@$SINGULARITY_NAME:\w$ "' > /.singularity.d/env/999-psvars.sh
###############################################################################
# Update Ubuntu Cache and begin install
apt update -y
apt-get install -y software-properties-common
apt-get install -y wget gcc libxml2 curl gpg-agent build-essential git vim
# Packages
apt-add-repository universe
apt-get update
apt-get install -y casacore-dev cmake g++ git pkg-config libblas-dev libboost-date-time-dev libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libcfitsio-dev libfftw3-dev libgsl-dev libhdf5-dev liblapack-dev libopenmpi-dev libpython3-dev pkg-config
apt-get install -y git vim python3 python3-pip python3-distutils python-is-python3 bzip2
# Install EveryBeam
# EveryBeam dependencies https://everybeam.readthedocs.io/en/latest/build-instructions.html
apt-get -y install wget git make cmake g++ doxygen libboost-all-dev libhdf5-dev libfftw3-dev libblas-dev liblapack-dev libxml2-dev libgtkmm-3.0-dev libpython3-dev python3-distutils
apt-get -y install casacore-dev libcfitsio-dev wcslib-dev
python -m pip install sphinx sphinx_rtd_theme breathe myst-parser
mkdir -p /opt/build
cd /opt/build
export GIT_SSL_NO_VERIFY=1
git clone --recursive -j4 https://git.astron.nl/RD/EveryBeam.git
cd EveryBeam
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/build/EveryBeam -DBUILD_WITH_PYTHON=On ..
make install
#Create /usr/local/cuda for binding
mkdir -p /usr/local/cuda-12.4
# Clean Up
apt clean
apt autoclean
apt autoremove -y
# Create first-run script to complete installation
cat > /opt/build/first-run.sh <<EOF;
#!/bin/bash
export IDGAPI_DIR=/usr/local/idg
export GIT_SSL_NO_VERIFY=1
cd /opt/build
ln -s /usr/local/cuda-12.4 /usr/local/cuda
for LIB in \$(ls /.singularity.d/libs); do ln -s /.singularity.d/libs/\$LIB /usr/lib/x86_64-linux-gnu/\$LIB; done
git clone https://gitlab.com/astron-idg/idg.git
cd idg
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/idg/ ..
cmake -DBUILD_LIB_CUDA=ON .
make -j 4
make install
cd /opt/build
git clone -b v3.5 https://gitlab.com/aroffringa/wsclean.git
cd wsclean
git submodule update --init --recursive
mkdir -p build
cd build
cmake -DPORTABLE=Yes -DIDGAPI_DIR=/usr/local/idg -DEveryBeam_DIR=/opt/EveryBeam/lib/everybeam ..
make -j 4
make install
EOF
chmod +x /opt/build/first-run.sh