-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSingularity.PHI1.0.def
197 lines (163 loc) · 4.49 KB
/
Singularity.PHI1.0.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
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
Bootstrap: docker
From: ubuntu:22.04
%help
Container for PHI v.1.0
https://github.com/at-cg/PHI
Includes
PHI
HTSlib
Samtools
BCFtools
sdsl-lite
libhandlegraph
gbwt
gbwtgraph
gurobi
vg
Licensed by CC-BY
%labels
VERSION "PHI v.1.0"
Maintainer Francois Sabot <[email protected]>
March, 2025
%post
# faster apt downloads
export DEBIAN_FRONTEND=noninteractive
export LC_ALL=C
(
. /etc/os-release
cat << _EOF_ > mirror.txt
deb mirror://mirrors.ubuntu.com/mirrors.txt ${UBUNTU_CODENAME} main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt ${UBUNTU_CODENAME}-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt ${UBUNTU_CODENAME}-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt ${UBUNTU_CODENAME}-security main restricted universe multiverse
_EOF_
mv /etc/apt/sources.list /etc/apt/sources.list.bak
cat mirror.txt /etc/apt/sources.list.bak > /etc/apt/sources.list
)
# apt dependencies
apt update
apt install -y \
apt-utils \
autoconf \
automake \
gcc \
build-essential \
software-properties-common \
tar \
unzip \
wget \
zlib1g-dev \
sudo \
cmake \
libstdc++-12-dev \
bzip2 \
xz-utils \
lz4 \
zstd \
git-all \
libbz2-dev \
liblzma-dev \
libncurses5-dev
# Installation based on installdeps file
#Main folder
cd /opt
git clone https://github.com/at-cg/PHI
export PHIDIR=/opt/PHI
#Subfolders
mkdir -p $PHIDIR/extra
mkdir -p $PHIDIR/extra/plugins
mkdir -p $PHIDIR/extra/lib
mkdir -p $PHIDIR/extra/bin
mkdir -p $PHIDIR/extra/include
#Install folder
mkdir -p $PHIDIR/temp_bin
cd $PHIDIR/temp_bin
# htslib
git clone https://github.com/samtools/htslib.git
cd htslib
git submodule update --init --recursive
autoreconf -i
./configure --prefix=$PHIDIR/extra
make -j4
make install
cd ..
# samtools
git clone https://github.com/samtools/samtools.git
cd samtools
autoheader
autoconf -Wno-syntax
./configure --prefix=$PHIDIR/extra
make -j4
make install
cd ..
# bcftools
git clone https://github.com/samtools/bcftools.git
cd bcftools
make -j4
cp bcftools $PHIDIR/extra/bin/
cp -r plugins/* $PHIDIR/extra/plugins/
cd ..
# sdsl-lite
git clone https://github.com/vgteam/sdsl-lite.git
cd sdsl-lite
cd build
cmake ..
make -j4
cp -r lib/* $PHIDIR/extra/lib/.
cp -r external/libdivsufsort/lib/* $PHIDIR/extra/lib/
cd ../..
# libhandlegraph
git clone https://github.com/vgteam/libhandlegraph.git
cd libhandlegraph
mkdir -p build
cd build
cmake ..
make -j4 CPPFLAGS="-I../../sdsl-lite/include" LDFLAGS="-L../../sdsl-lite/build/lib/ -L../../sdsl-lite/build/external/libdivsufsort/lib/"
#A VERIFIER !!
cp libhandlegraph.a $PHIDIR/extra/lib/
cp libhandlegraph.so $PHIDIR/extra/lib/
cd ../..
# gbwt
git clone https://github.com/jltsiren/gbwt.git
cd gbwt
make -j4 CPPFLAGS="-I../sdsl-lite/include -I../libhandlegraph/src/include/" LDFLAGS="-L../sdsl-lite/build/lib/ -L../sdsl-lite/build/external/libdivsufsort/lib/ -L../libhandlegraph/build/"
cp -r lib/* $PHIDIR/extra/lib/
cd ..
# gbwtgraph
git clone https://github.com/jltsiren/gbwtgraph.git
cd gbwtgraph
make CPPFLAGS="-I../sdsl-lite/include -I../gbwt/include -I../libhandlegraph/src/include/" \
LDFLAGS="-L../gbwt/lib -L../sdsl-lite/build/lib/ -L../sdsl-lite/build/external/libdivsufsort/lib/ -L../libhandlegraph/build/" -j4
cp bin/gfa2gbwt $PHIDIR/extra/bin/
cp -r lib/* $PHIDIR/extra/lib/
cd ..
# zlib
wget --no-check-certificate https://zlib.net/current/zlib.tar.gz
tar -xvf zlib.tar.gz
cd zlib-*
./configure --prefix=$PHIDIR/extra
make -j4
make install
cd ..
# vg
wget https://github.com/vgteam/vg/releases/download/v1.60.0/vg -O $PHIDIR/extra/bin/vg
chmod +x $PHIDIR/extra/bin/vg
# gurobi
wget --no-check-certificate https://packages.gurobi.com/11.0/gurobi11.0.2_linux64.tar.gz
tar -xvf gurobi11.0.2_linux64.tar.gz
cd gurobi1102/linux64
cp -r lib/* $PHIDIR/extra/lib/.
cp -r include/* $PHIDIR/extra/include/.
cd $PHIDIR/temp_bin
# Cleaning
rm -rf $PHIDIR/temp_bin
#Install PHI itself
cd /opt/PHI
export PATH=/opt/PHI/extra/bin:/opt/PHI/extra/include:$PATH
export LD_LIBRARY_PATH=/opt/PHI/extra/lib:$LD_LIBRARY_PATH
make -j4
%environment
export PATH=/opt/PHI/extra/bin:/opt/PHI:$PATH
export LD_LIBRARY_PATH=/opt/PHI/extra/lib:$LD_LIBRARY_PATH
%runscript
exec "$@"