Dependency Libs and App
Create compile folder, then download all the dependency files to this folder.
$ sudo mkdir ~/vsfm
Dependency:
VisualSFM
SiftGPU
Multicore Bundle Adjustment
PMVS-2
CMVS
Graclus 1.2
Steps
Step 1:Build VisualSFM
$ unzip VisualSFM_linux_64bit.zip
$ cd vsfm
$ make
Step 2:Build SiftGPU-V400
$ unzip SiftGPU-V400.zip
$ cd SiftGPU
$ make
$ cp bin/libsiftgpu.so ../vsfm/bin
Step 3:Build Multicore Bundle Adjustment (a.k.a. “pba”)
Uncompress the zip files, enter the path:pba/src/pba, and edit the two source files of “SparseBundleCU.h” and “pba.h”. Adding follows lib to the file start.
#include <stdlib.h>
The default compile is with GPU version, if no GPU, you should delete the makefile file in PBA folder, rename makefile_no_gpu to makefile, then just make it.
$ cd ~/vsfm/pba
$ make
Step 4:Build Hack PMVS-2
compile this file according to the follows command:
$ tar xf pmvs-2.tar.gz
$ cd pmvs-2/program/main/
$ cp mylapack.o mylapack.o.backup
$ make clean
$ cp mylapack.o.backup mylapack.o
$ make depend
$ make
Step 5:Build Graclus 1.2
Uncompress the Graclus, then edit the Makefile.in file, set the “-DNUMBITS=64” item:
# What options to be used by the compiler
COPTIONS = -DNUMBITS=64
$ cd ~/vsfm/Graclus
$ make
Step 6:Build Graclus 1.2
$ cd ~/vsfm
$ tar xf cmvs-fix2.tar.gz
$ cp pmvs-2/program/main/mylapack.o cmvs/program/main/
add follows line to the “cmvs/program/main/genOption.cc” file
#include <stdlib.h>
Next, edit the CMVS Makefile(in cmvs/program/main), remember change the path(/home/scott/vsfm/) to your own.
#Your INCLUDE path (e.g., -I/usr/include)
YOUR_INCLUDE_PATH =
#Your metis directory (contains header files under graclus1.2/metisLib/)
YOUR_INCLUDE_METIS_PATH = -I/home/scott/vsfm/graclus1.2/metisLib
#Your LDLIBRARY path (e.g., -L/usr/lib)
YOUR_LDLIB_PATH = -L/home/scott/vsfm/graclus1.2
After these, compile all the files, then copy the three executable files.
$ cd ~/vsfm/cmvs/program/main
$ make
$ cp cmvs ~/vsfm/vsfm/bin
$ cp pmvs2 ~/vsfm/vsfm/bin
$ cp genOption ~/vsfm/vsfm/bin
Step 7:Running VisualSFM
Add VisualSFM to your own path(LD_LIBRARY_PATH). Please change the “/home/scott/vsfm/” to your own path.
$ sudo vim ~/.bashrc
export PATH=$PATH:/home/scott/vsfm/vsfm/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/scott/vsfm/vsfm/bin
All can’t understand thing, please find the origin:
VisualSFM of Offical