Install Colmap in Centos7

1. Install gcc

  1. install gcc g++ etc via yum
  2. update gcc to higher version (I choose 5.4)

tar -xvf gcc-5.4.0.tar.bz2
cd gcc-5.4.0
./contrib/download_prerequisits
mkdir build
cd build
…/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
make
make install

mv gcc gcc-old
mv g++ g+±old
mv c++ c+±old
ls -s /usr/local/bin/gcc /usr/bin/gcc
ln -s /usr/local/bin/g++ /usr/bin/g++
ln -s /usr/local/bin/c++ /usr/bin/c++​

2. install cmake & boost & etc

  • cmake

install cmake with high version

detail can be seen here

  • BOOST

down load boost from offfical site

tar xvf boost-xxxxx
./bootstrap.sh –prefix=/usr/local/
./b2
./b2 install

  • other

install others

sudo yum install \
    gflags-devel \
    glog-devel \
    glew-devel \
    atlas \
    atlas-devel \
    lapack-devel \
    blas-devel \
    qt5-qtbase-devel

3. install gflag and glog

I faced a lots of error of Gflag namespace of the same type:
undefined reference to 'google::FlagRegisterer::FlagRegisterer’

It turns out that GFLAG library have changed its name sapce in its latest version from “google” to “gflags”, as a result some google library will not find the correct function with namespace “google”.
在这里插入图片描述

this solution seen from github gflags

And be sure you install them after you update gcc. As if you did not update gcc, gflags will be made in some old version gcc properity, which will lead more errors.

If you accidently make glfag and glog by old gcc. go to usr/local/lib/libglog.so and update this file by the new built glog. As the glog built with old version will be install here, will the new won’t. So you need to update this library maunally.

4. install freeimage and ceres

  • freeimage

git clone https://github.com/leapmotion/FreeImage
cd FreeImage
make && make install

  • ceres

do not use “make -j” as it will cause memory error by occupying all the memory of the system.

git clone https://github.com/ceres-solver/ceres-solver
cd ceres-solver
mkdir build && cd build
cmake …
make
make intall

5. cuda

download and install from cuda site
在这里插入图片描述

6. colmap

git clone https://github.com/colmap/colmap
cd colmap
mkdir build && cd build
# For CentOS users, use following command.
# CentOS ships BOOST lib only with shared lib.
cmake … -DBOOST_STATIC=OFF
make
make install

that will be helpful

7. can be done

similar step can be done as following (from):

在这里插入图片描述

发布了16 篇原创文章 · 获赞 4 · 访问量 2188

猜你喜欢

转载自blog.csdn.net/weixin_44492024/article/details/103418472
今日推荐