-
Notifications
You must be signed in to change notification settings - Fork 4
/
Singularity_colmap_vsfm
195 lines (161 loc) · 4.98 KB
/
Singularity_colmap_vsfm
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
Bootstrap: docker
From: ubuntu:20.04
%labels
Maintainer: Suxing Liu, Wes Bonelli
#########
#%setup
mkdir ${SINGULARITY_ROOTFS}/srv/images
mkdir ${SINGULARITY_ROOTFS}/srv/images/sparse
mkdir ${SINGULARITY_ROOTFS}/srv/images/sparse/0
mkdir ${SINGULARITY_ROOTFS}/opt/code/
#########
%files
./* /opt/code
##Just grabbing default packages from ubuntu repository
%post
apt-get -ym update
DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
wget \
cmake \
tzdata \
build-essential \
libboost-program-options-dev \
libboost-filesystem-dev \
libboost-graph-dev \
libboost-regex-dev \
libboost-system-dev \
libboost-test-dev \
libeigen3-dev \
libsuitesparse-dev \
libfreeimage-dev \
libgoogle-glog-dev \
libgflags-dev \
libglew-dev \
qtbase5-dev \
libqt5opengl5-dev \
libcgal-dev
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
unzip \
nano \
glew-utils \
imagemagick \
libgtk2.0-dev \
libglew-dev \
libdevil-dev \
libboost-all-dev \
libatlas-cpp-0.6-dev \
libatlas-base-dev \
libatlas3-base \
liblapack3 \
libblas3 \
libblas-dev \
libcminpack-dev \
libgfortran5 \
libmetis-edf-dev \
libparmetis-dev \
libjpeg-turbo8 \
libgsl-dev \
freeglut3-dev \
dos2unix
#apt-get -ym install libcgal-qt5-dev
apt-get -ym install libatlas-base-dev libsuitesparse-dev
git clone https://ceres-solver.googlesource.com/ceres-solver
git clone https://github.com/colmap/colmap.git
# Install ceres-solver
cd ceres-solver
git checkout $(git describe --tags) # Checkout the latest release
mkdir build
cd build
cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF
make
#make -j20
make install
cd ../..
# Install colmap
cd colmap
git checkout master
mkdir build
cd build
# cmake -DCMAKE_EXE_LINKER_FLAGS="-static -ldl -lc" \
# -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" ..
cmake ../
#make -j20
make
make install
# Install VisualSFM
cd /opt/code/
wget http://ccwu.me/vsfm/download/VisualSFM_linux_64bit.zip
unzip VisualSFM_linux_64bit.zip
rm VisualSFM_linux_64bit.zip
cd vsfm
sed -i 's/LIB_LIST +=/LIB_LIST += -no-pie /' /opt/code/vsfm/makefile
make
# Install SiftGPU
cd /opt/code/
wget https://github.com/pitzer/SiftGPU/archive/master.zip
unzip master.zip
rm master.zip
mv SiftGPU-master SiftGPU
#cp patches/siftgpu.patch /opt/code/SiftGPU/siftgpu.patch
cd /opt/code/SiftGPU
#patch -p0 < siftgpu.patch
make
cp /opt/code/SiftGPU/bin/libsiftgpu.so /opt/code/vsfm/bin
# Install PBA
cd /opt/code/
wget http://grail.cs.washington.edu/projects/mcba/pba_v1.0.5.zip
unzip pba_v1.0.5.zip
rm pba_v1.0.5.zip
cd /opt/code/pba
dos2unix makefile_no_gpu
make -f makefile_no_gpu
cp -v /opt/code/pba/bin/libpba_no_gpu.so /opt/code/vsfm/bin/libpba.so
#Install CMVS-PMVS
cd /opt/code/
wget https://github.com/pmoulon/CMVS-PMVS/archive/master.zip
unzip master.zip
rm master.zip
mv CMVS-PMVS-master CMVS-PMVS
mkdir -p /opt/code/CMVS-PMVS/program/build
cd /opt/code/CMVS-PMVS/program/build
cmake ..
make install
cp /opt/code/CMVS-PMVS/program/build/main/cmvs /opt/code/vsfm/bin/
cp /opt/code/CMVS-PMVS/program/build/main/pmvs2 /opt/code/vsfm/bin/
cp /opt/code/CMVS-PMVS/program/build/main/genOption /opt/code/vsfm/bin/
# Install Graclus
cd /opt/code/
wget http://www.cs.utexas.edu/users/dml/Software/graclus1.2.tar.gz
tar xzf graclus1.2.tar.gz
rm graclus1.2.tar.gz
#cp patches/graclus.patch /opt/code/graclus1.2/graclus.patch
sed -i 's/COPTIONS = -DNUMBITS=32/COPTIONS = -DNUMBITS=64/' /opt/code/graclus1.2/Makefile.in
cd /opt/code/graclus1.2
#patch -p0 < graclus.patch
make
# Install vlfeat
cd /opt/code/
wget http://www.vlfeat.org/download/vlfeat-0.9.19-bin.tar.gz
tar xzf vlfeat-0.9.19-bin.tar.gz
rm vlfeat-0.9.19-bin.tar.gz
cp -v /opt/code/vlfeat-0.9.19/bin/glnxa64/* /opt/code/vsfm/bin/
# Add configuration file
cp config/nv.ini /opt/code/vsfm/bin/nv.ini
mkdir /lscratch /db /work /scratch
chmod -R a+rwx /opt/code
mkdir -p /opt/code/vsfm/bin/log && \
mkdir -p /opt/code/vsfm/bin/temp/log && \
touch /opt/code/vsfm/bin/temp/temp.pgm && \
touch /opt/code/vsfm/bin/temp/temp.sift.sift && \
ln -s /opt/code/vsfm/bin/temp/temp.pgm /opt/code/vsfm/bin/temp.pgm && \
ln -s /opt/code/vsfm/bin/temp/temp.sift.sift /opt/code/vsfm/bin/temp.sift.sift && \
ln -s /opt/code/vsfm/bin/temp/log /opt/code/vsfm/bin/log
strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so
%environment
PATH=$PATH:/opt/code/vsfm/bin/
export PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/code/vsfm/bin/
export LD_LIBRARY_PATH
%runscript
/opt/code/vsfm/bin/VisualSFM "$@"