Ubuntu下安装cgal4.5.2计算几何库
来源:互联网 发布:北大青鸟网络课程介绍 编辑:程序博客网 时间:2024/06/05 07:59
摘要:cgal是一个开源的计算几何库, 博文记录了其编译、安装和使用方法。
1 库下载
站点:http://www.cgal.org/
下载:https://gforge.inria.fr/frs/download.php/file/34514/CGAL-4.5.2.zip
2 解压缩、编译与安装
shell下进入解压文件夹
1)库配置文件生成命令:
cmake .
提示缺少gmp和mpfr库
安装缺少的库:
sudo apt-get install libgmp-dev libmpfr-dev
然后cmake .
提示成功
2)编译
make
约5秒编译完成
3)安装
sudo make install
头文件安装位置:/usr/local/include/CGAL/
库文件位置:/usr/local/lib/
相应的库有:libCGAL.so, libCGAL_ImageIO.so, libCGAL_Qt4.so, libCGAL_Core.so
3 程序测试
//编译: g++ test.cpp -lCGAL -lCGAL_Core -lgmp //-lmpfr#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;}
//编译: g++ test.cpp -lCGAL -lCGAL_Core -lgmp
0 0
- Ubuntu下安装cgal4.5.2计算几何库
- Ubuntu下安装python科学计算库
- 计算几何-几何库
- config cgal4.7 on ubuntu
- 在ubuntu下安装一些python库做科学计算
- win7下VS2013配置CGAL4.7
- cgal4.4 + vs2010 + win7 or win8安装
- Win7-64bts-VS2012-CGAL4.7 安装
- centos7.2 1511 安装CGAL4-7
- 计算几何库
- 计算几何库
- Liuctic计算几何库
- ubuntu下安装python科学计算环境和机器学习的TensorFlow库
- [转载]在Ubuntu下安装Python科学计算环境
- ubuntu环境下科学计算云平台安装配置
- ubuntu下计算md5
- Ubuntu GSL科学计算库安装配置
- 计算几何几何函数库
- cocos2d-x 3.2 文字显示方法代码
- 机器可以怎样学习
- Valid Parentheses
- 数据结构--remove方法对LinkedList类的使用注意
- HDU 3887 Counting Offspring(dfs序的应用)
- Ubuntu下安装cgal4.5.2计算几何库
- Adobe Photoshop CS6提示”无法完成请求,因为文件格式模块不能解析该文件“
- 几个项目规划畅想etc.
- opencv2在视频帧序列中运用鼠标extract rectangle region
- 自学数据挖掘十大算法之PageRank
- LeetCode: Rotate Array
- 3.5学习内容 宽带测速原理,RESTful架构,rpc个人理解
- 增强现实追加2
- innodb优化转载篇