1. 常用非线性求解库Ceres

#===========================================================================================
# Ceres Solver install
#============================================================================================
# Dependencies: CMake, google-glog, gflags, BLAS & LAPACK, Eigen3, SuiteSparse and CXSparse.
sudo apt install cmake
sudo apt install libgoogle-glog-dev
sudo apt install libatlas-base-dev liblapack
sudo apt install libeigen3-dev
sudo apt install libsuitesparse-dev
# cmake and make
git clone https://ceres-solver.googlesource.com/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
sudo make install

2. 常用C++扩展库Boost

#============================================================================================
# Boost install
#============================================================================================
# remove existed boost
rm -f /usr/lib/libboost*
rm -fr 'find / -name libboost*'
# download Boost by wget
sudo apt install wget
wget https://dl.bintray.com/boostorg/release/1.58.0/source/boost_1_58_0.tar.gz
tar -zxvf boost_1_58_0.tar.gz
cd boost_1_58_0
# install dependencies
sudo apt update
sudo apt install build-essential g++ python-dev autotools-dev libicu-dev libbz2-dev libboost-all-dev
# build environment and compile
./bootstrap.sh && ./b2
# install
sudo ./b2 install

可能会出现下面的提示,构建工程的时候注意一下就是了。

# //////////////////////////////////////////////////////////////////////////////////////////////////////////
# The following dir should be added to compiler include paths: ~/Downloads/mvs_project/boost_1_58_0
# The following dir should be added to linker library paths: ~/Downloads/mvs_project/boost_1_58_0/stage/lib
# //////////////////////////////////////////////////////////////////////////////////////////////////////////

3. 常用视觉计算处理库OpenCV

#============================================================================================
# OpenCV Install
#============================================================================================
# refresh and upgrade and pre-installed packages/libraries:
sudo apt update
# install some developer tools
sudo apt install build-essential cmake pkg-config # OpenCV needs to be able to load various image file formats from disk such as JPEG, PNG, TIFF, etc. In order to load these images from disk, OpenCV actually calls other image I/O libraries that actually facilitate the loading and decoding process.
sudo apt install libjpeg8-dev libtiff5-dev libjasper-dev libpng12-dev # Use the following commands to install packages used to process video streams and access frames from cameras
sudo apt install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev # OpenCV ships out-of-the-box with a very limited set of GUI tools, which allow you to debug your code and build very simple applications. The “highgui” module relies on the GTK library
sudo apt install libgtk--dev # install libraries that are used to optimize various functionalities inside OpenCV, such as matrix operations:
sudo apt install libatlas-base-dev gfortran # installing the Python development headers and libraries for both Python 2.7 and Python 3.5
sudo apt install python2.-dev python3.-dev
sudo pip install numpy && sudo pip3 install numpy

安装好依赖项之后进行编译安装

#============================================================================================
# config cmake
#============================================================================================
mkdir build && cd build cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_GTK_3_X=ON -DWITH_TBB=OFF -DWITH_V4L=ON .. make sudo make install

在cmake步骤,如果需要使用opencv_contrib里面的功能,需要加上下面的命令

#============================================================================================
# if opencv_contrib is needed then add the following commands when cmake
#============================================================================================
-D OPENCV_EXTRA_MODULES_PATH=opencv_contrib_path/modules \
-D BUILD_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF

如果卡在ippicv下载的地方,可以手动下载配置路径,重新cmake(附下载地址:OpenCV3.4.5对应的是ippicv-2019

# ippicv_2019_lnx_inte164_general_20180723.tgz
# save the tarball as you want, and then change the configuration
"opencv-3.4.5/3rdparty/ippicv/ippicv.cmake"
# change row from the following
"https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_COMMIT}ippicv/"
# to your saved path
"file:~/Downloads/"

安装完成后需要进行如下的配置,以保证正常调用

cd /etc/ld.so.conf.d
sudo vim opencv.conf
# add in end of the file
"/usr/local/lib" and then update sudo ldconfig

4. 李代数库Sophus

#============================================================================================
# Install Sophus
#============================================================================================
sudo apt install git -y git clone https://github.com/strasdat/Sophus.git cd Sophus git checkout a621ff # Compile and install
mkdir build && cd build cmake .. make sudo make install

5. 线性和非线性方程组求解库g2o,类似于Ceres

#============================================================================================
# Ubuntu Install g2o
#============================================================================================
# Dependencies
sudo apt install libqt4-dev qt4-cmake libqglviewer.dev libsuitesparse-dev libcxsparse3.1.2 libcholmod-dev -y # Compile and install
git clone https://github.com/RainerKuemmerle/g2o cd g2o mkdir build && cd build cmake .. make sudo make install

6. 可视化依赖库OpenGL及其拓展glew

#============================================================================================
# Ubuntu install opengl
#============================================================================================
sudo apt install build-essential libgl1-mesa-dev sudo apt install freeglut3-dev libglew-dev libsdl2-dev libsdl2-image-dev libglm-dev libfreetype6-dev #============================================================================================
# Ubuntu install glew
#============================================================================================
apt-cache search glew sudo apt install libglew-dbg libglew-dev libglew1. libglewmx-dbg libglewmx-dev libglewmx1. glew-utils sudo apt install libxmu-dev

如果在C++工程编译链接时出现下面的错误,解决方案如下

#============================================================================================
# Problem
# CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
# Please set them or make sure they are set and tested correctly in the CMake files:
# GLUT_Xmu_LIBRARY (ADVANCED)
# linked by target "openglsupport" in directory {$PATH} # -- Configuring incomplete, errors occurred!
#============================================================================================
# Solution
sudo apt install libxmu-dev

7. C++开源线性代数库Eigen

该库提供了快速的有关矩阵的线性代数运算,包括解方程等功能。此库不同于其他库的特殊之处在于,它是一个纯用头文件搭建起来的库,因此在使用中没有.so或.a 之类的二进制文件,只需引入Eigen的头文件即可。

#============================================================================================
# Ubuntu Insall Eigen
#============================================================================================
# Default install path is /usr/include/eigen3
sudo apt install libeigen3-dev

当需要编译包含 Eigen 头文件的项目时,需要在 CMakeLists.txt 中指定 Eigen 的头文件目录。

#============================================================================================
# CMakeLists.txt
#============================================================================================
# add include headers
include_directories( "/usr/local/eigen3" )

8. 另外如果在ldconfig时出现下面的错误,按如下方法解决

#============================================================================================
# Problem /sbin/ldconfig.real: /usr/local/cuda-9.0/lib64/libcudnn.so. is not a symbolic link
#============================================================================================
# Solution: Create the new link manually
ls -lh /usr/local/cuda-9.0/lib64/libcudnn.so.
sudo ln -sf /usr/local/cuda-9.0/lib64/libcudnn.so.7.1. /usr/local/cuda-9.0/lib64/libcudnn.so.

Ubuntu16.04常用C++库安装及环境配置的更多相关文章

  1. 在vc中使用xtremetoolkit界面库-----安装及环境配置

    近期想用一下xtremetoolkitPro界面库.网上的使用教程资源也不多,当中着实遇到了很多的困难,毕竟是首次使用. 首先当然是配置发开环境了: 我使用的是vc6.0+xtremetoolkitP ...

  2. 阿里云ECS服务器环境搭建——ubuntu16.04图形界面的安装

    阿里云ECS服务器环境搭建——ubuntu16.04图形界面的安装 最近琢磨着想在服务器上搭建一个hexo博客,于是就在阿里云上买了一个云服务器ECS,远程接入后默认给的是一个命令窗口,没有图形界面, ...

  3. Ubuntu16.04下,erlang安装和rabbitmq安装步骤

    文章来源: Ubuntu16.04下,erlang安装和rabbitmq安装步骤 准备工作,先下载erlang和rabbitmq的安装包,注意他们的版本,版本不对可能会导致rabbitmq无法启动,这 ...

  4. ubuntu16.04下Hyperledger之搭建Fabric环境简单操作(五步启动e2e_cli)

    如果你已经安装好go等工具.git及checkout相关代及下载相关镜像,您只需下面5步就能up e2e_cli~/go/src/github.com/hyperledger/fabric$ sudo ...

  5. Ubuntu16.04 LTS下apt安装WireShark

    Ubuntu16.04 LTS下apt安装WireShark 安装与配置 首先通过apt安装WireShark: $ sudo apt install wireshark 会同时安装许多的依赖包,其中 ...

  6. 路由器安装ubuntu-16.04.1-server-amd64出现“无法安装busybox-initramfs”错误。向目标系统中安装busybox-initramfs软件包时出现一个错误。请检查/var/log/syslog或查看第四虚拟控制台以获得详细

    公司的路由器要ubuntu服务器进行路由网络功能的管理,在安装的时候出现下面的错误提示: 安装ubuntu-16.04.1-server-amd64出现“无法安装busybox-initramfs”错 ...

  7. ubuntu16.04下sublime text3安装和配置

    ubuntu16.04下sublime text3安装和配置 2018年04月20日 10:31:08 zhengqijun_ 阅读数:1482 1.安装方法 1)使用ppa安装 sudo add-a ...

  8. Ubuntu16.04上用源代码安装ICE

    ubuntu16.04上用源代码安装ICE

  9. ROS入门笔记(二):ROS安装与环境配置及卸载(重点)

    ROS入门笔记(二):ROS安装与环境配置及卸载(重点) [TOC] 1 ROS安装步骤 1.1 ROS版本 ROS目前只支持在Linux系统上安装部署, 它的首选开发平台是Ubuntu. 发布时间 ...

随机推荐

  1. CH 4302 Interval GCD 题解

    题意 给定一个长度为N的数列A,以及M条指令 (N≤5* 10^5, M<=10^5),每条指令可能是以下两种之一: "C l r d",表示把 A[l],A[l+1],-, ...

  2. Ansible实现批量管理服务器

    Ansible介绍: a. ansible是一个基于Python开发的自动化运维工具b. ansible是一个基于ssh协议实现远程管理的工具c. ansible软件可以实现多种批量管理操作(批量系统 ...

  3. 机器学习Label Encoder和One Hot Encoder

    标签编码(Label Encoder) 在本例中第一列是Country, 如果我们要运行任何模型, 数据中不能包含文本 所以要对文本进行处理 接下来,我们从sklearn库中导入LabelEncode ...

  4. redis持久化的两种方式RDB和AOF

    原文链接:http://www.cnblogs.com/tdws/p/5754706.html Redis的持久化过程中并不需要我们开发人员过多的参与,我们要做的是什么呢?除了深入了解RDB和AOF的 ...

  5. Android studio初次安装启动时弹出unable to access android sdk add-on list提示的解决方法

    一.问题描述 初次安装Android Studio,启动后,报错如下: unable to access android sdk add-on lis 如图: 二.原因分析 AS启动后,会在默认路径下 ...

  6. 解决python -m pip install --upgrade pip 升级不成功问题

    1.使用命令出现. You are , however version is available. You should consider upgrading via the 'python -m p ...

  7. Fliptile(枚举+DFS)

    Problem Description Farmer John knows that an intellectually satisfied cow is a happy cow who will g ...

  8. JAVA WEB中的Servlet过滤器

    实现一个Servlet过滤器,可以对用户登录情况进行控制.要求如下: 1)访问路径是admin下的资源,需要登录,如果用户没有登录,自动转向用户登录页面.用户登录成功后,再次访问admin下的资源不需 ...

  9. Falsk中的Request、Response

    Flask 中的Response 1.HTTPResponse('helloword') "helloword" from flask import Flask # 实例化Flas ...

  10. jenkins插件之Publish Over SSH的使用

    1,安装 在插件管理选项搜索Publish Over SSH,然后点击安装即可完成 2,安装完成之后,就可以在jenkins的配置系统中找到Publish Over SSH 配置完服务器之后,然后在项 ...