首先深吸一口气,花了两天时间。。。
1.各种依赖包
#install dependencies for CGAL.i
sudo apt-get update
sudo apt-get install freeglut3, freeglut3-dev binutils-gold g++ cmake libglew-dev g++ mesa-common-dev build-essential libglew1.5-dev libglm-dev
sudo apt-get install libgmp3-dev
sudo apt-get install libmpfr-dev libmpfr-doc libmpfr4 libmpfr4-dbg
如果安装出现问题,就是需要sudo apt-get update (速度慢可以更换安装源)
2.建立链接
#fix some lib linking issues. Might not be needed depending on the setup.
sudo rm /usr/lib/x86_64-linux-gnu/libGL.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.1 /usr/lib/x86_64-linux-gnu/libGL.so
#sudo ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so /usr/lib/x86_64-linux-gnu/libGL.so
这个问题我研究了一天,明明路径下存在该文件,编辑时候报错没有该文件,google查找是建立链接,必要时候需要先locate XX.so 查看哪些路径下面有,[第二次装,又在这翻了跟头,浪费了一上午时间T T ]
3.安装cmake,网上有各种资源
4.安装eigen#install eigen3
eigen3不兼容,需要安装更低的3.2版本,链接:https://pan.baidu.com/s/1pNt9xoB
解压,进入该目录,mkdir build, cd build,cmake ..
5.安装doxygen,网上也有各种资源
#install doxygen.
sudo apt-get install doxygen
6。安装CGAL
#make CGAL.
wget https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.8.1/CGAL-4.8.1.tar.xz
tar -xvf CGAL-4.8.1.tar.xz
cd CGAL-4.8.1/
cmake .
make
cd ..
需要测试通过
//编译: g++ test.cpp -lCGAL -lCGAL_Core -lgmp
//
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/convex_hull_2.h>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_2 Point_2;
typedef std::vector<Point_2> Points;
int main()
{
Points points, result;
points.push_back(Point_2(0,0));
points.push_back(Point_2(10,0));
points.push_back(Point_2(10,10));
points.push_back(Point_2(6,5));
points.push_back(Point_2(4,1));
CGAL::convex_hull_2( points.begin(), points.end(), std::back_inserter(result) );
std::cout << result.size() << " points on the convex hull" << std::endl;
return 0;
}
————————————————
版权声明:本文为CSDN博主「alaclp」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/miscclp/article/details/44087749
/
https://blog.csdn.net/miscclp/article/details/44087749
6安装gudhi
#make gudhi.
cd gudhi
mkdir build
cd build
#cmake -DCGAL_DIR=/your/path/CGAL-4.8.1/ .. && make
cmake -DCGAL_DIR=/home/dmic/CGAL-4.8.1/ .. && make
cd ..
最重要的一点要把cypthon路径添加到PYTHONPATH
vim ~/.bashrc
export PYTHONPATH=${PATHONPATH}:/home/dmic/tmp/gudhi/build/cython/
不要忘记sourcr ~/.bashrc
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
import gudhi没毛病啊!成功了啊!果然还是要靠自己!在此diss一下某度,×××××××,遇到问题千万要google!某度只会让你火大!!!!