一、配置opencv
1、安装依赖
sudo apt-get install cmake sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg-dev libswscale-dev libtiff5-dev libavresample-dev libgphoto2-dev sudo apt-get install libgtk2.0-dev sudo apt-get install pkg-config apt install ffmpeg
2、下载源码
下载地址:https://opencv.org/releases/
笔者下载的是3.2
解压之后
cd opencv mkdir build cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUDA=OFF ..(关掉cuda编译是担心两者日后冲突); make -j16(大约需要十分钟) make install
3、配置环境
在/etc/ld.so.conf中加上 /usr/loacal/lib,其中/user/loacal是opencv安装路径
之后,ldconfig;
打开 /etc/bash.bashrc
加入:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig export PKG_CONFIG_PATH source /etc/bash.bashrc
4、检验
pkg-config opencv --modversion
二、编译tensorflow
1.安装bazel
https://github.com/bazelbuild/bazel/releases?after=0.15.1
我下载的是0.15.0,tensorflow是1.11.0
运行命令:
chmod +x bazel-0.15.0-installer-linux-x86_64.sh 再./bazel-0.15.0-installer-linux-x86_64.sh
参考博客:https://blog.csdn.net/darkrabbit/article/details/81262556
安装完毕
2、安装gflag glog
https://blog.csdn.net/calvinpaean/article/details/99761765
3、编译tensorflow
我下载的是1.11.0 下载地址传送门:https://github.com/tensorflow/tensorflow/releases?after=v1.13.0-rc2
解压之后./configure,基本都是n 选择cuda的时候选y
而后进入 tensorflow/contrib/makefile 目录下,运行./build_all_linux.sh会安装相关的依赖
但是!这些下载链接基本上都挂啦,所以需要手动下载至相应的文件夹tensorflow/contrib/makefile/downloads/
安装eigen3:
1、apt-get方式(假设默认安装到/usr/local/include里(可在终端中输入locate eigen3查看位置),若实际中默认安装到了/usr/include的话,可以对应替换下面命令的相应部分)
运行命令:
sudo apt-get install libeigen3-dev
运行命令:(参考第二种方法的最下面的说明)
sudo cp -r /usr/local/include/eigen3/Eigen /usr/local/include
执行复制命令,将Eigen文件夹及其内容放在/usr/include
安装protobuf3.6:
https://blog.csdn.net/u010918487/article/details/82947157
ft2build.h: No such file or directory:
https://blog.csdn.net/SundayO/article/details/100892401
没有找到absl:
git clone https://github.com/abseil/abseil-cpp,然后把该库加到搜索目录里面(比如usr/local/include)
openssl/ssl.h: No such file or directory: