一、配置GLFW
git clone https://github.com/glfw/glfw.git
cd glfw cmake .
sudo make install
make clean
二、配置EIGEN
git clone https://gitlab.com/libeigen/eigen.git
cd eigen
mkdir build
cmake ..
make install
该方法默认安装在:
/usr/local/include/eigen3 /usr/local/share/eigen3
参考以下方式卸载:
sudo rm -rf /usr/include/eigen3 /usr/lib/cmake/eigen3 /usr/share/doc/libeigen3-dev /usr/share/pkgconfig/eigen3.pc /var/lib/dpkg/info/libeigen3-dev.list /var/lib/dpkg/info/libeigen3-dev.md5sums
运行命令:
sudo cp -r /usr/local/include/eigen3/Eigen /usr/local/include
执行复制命令,将Eigen文件夹及其内容放在/usr/include,因为eigen3 被默认安装到了usr/local/include里了(或者是usr/include里,这两个都差不多,都是系统默认的路径),在很多程序中include时经常使用#include <Eigen/Dense>而不是使用#include <eigen3/Eigen/Dense>所以要做下处理,否则一些程序在编译时会因找不到Eigen/Dense而报错。上面指令将usr/local/include/eigen3文件夹中的Eigen文件递归地复制到上一层文件夹(直接放到/usr/local/include中,否则系统无法默认搜索到 -> 此时只能在CMakeLists.txt用include_libraries(绝对路径了))
三、修改./src中的cmakeLists之后进行编译安装时出现错误:
/home/cuda101/anaconda3/lib/libpng16.so.16: undefined reference to `inflateValidate@ZLIB_1.2.9'
基本上就是ubuntu自带的zlib库版本是1.2.8,怎么更新都更新不了,然后下载了zlib 1.2.11安装后就好了
Zilb官网链接,下载提示中报错的包即可,或者更高版本的包。
下载:curl -O http://www.zlib.net/zlib-1.2.11.tar.gz
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure; make; make install