config cgal4.7 on ubuntu

21 篇文章 0 订阅

1. download the installation program from https://github.com/CGAL/cgal/releases/tag/releases/CGAL-4.7


here, i choose CGAL-4.7.zip


2. then extract to somewhere(here, I extract them to /opt

sudo unzip CGAL-4.7 -d /opt


3.Then we need to install boost, qt5.5.1, cmake-gui on ubuntu. Here you can refer to the following links:

http://blog.csdn.net/seamanj/article/details/50658460

http://blog.csdn.net/seamanj/article/details/50595966

http://blog.csdn.net/seamanj/article/details/50658469

4. At this moment, we should set some environment variables

input the following command in terminal:

sudo gedit ~/.profile

then we append the file with sentences below:

export Qt5_DIR=/opt/Qt5.5.1/5.5/gcc_64/lib/cmake/Qt5
export QTDIR=/opt/Qt5.5.1

5. In terminal, open cmake-gui


6.After generating, go to /opt/CGAL-4.7/build and input 'make' command to compile


7. Afterwards, we install the generated lib and other things into our system by using the following command:

sudo make install

8. compile example



9.compile demo

A.config libQGLViewer

goto the official website : http://libqglviewer.com/download.html

and download the linux version: libQGLViewer-2.6.3.tar.gz

then we extract it to /opt  by inputting the following command:

sudo tar -xzf libQGLViewer-2.6.3.tar.gz -C /opt

At this time, there are two ways to build it:

the first is to go to /opt/libQGLViewer-2.6.3 andopen libQGLViewer-2.6.3.pro to build

the second way is to go to /opt/libQGLViewer-2.6.3/QGLViewer interminal and input the following commands:

qmake

make

sudo make install

more detail can see in the following part which copiedfrom http://libqglviewer.com/installUnix.html

UsingQt Creator

Open QGLViewer.pro and"build all". Optionaly makeinstall toinstall the application system wide.

Using make

qmake (see options below)
make
sudo make install [optional]

Thefollowing files are installed (you need root privileges to install,since these are system directories):

  • Thelibrary (libQGLViewer-2.6.3.so)in /usr/lib

  • Theheader files and designer plugin code in /usr/include/QGLViewer

  • Thedocumentation and the examples in /usr/share/doc/QGLViewer

Optional qmake parameterslet you customize your makeinstall targetinstallation directories:

qmake [PREFIX=...]
[INCLUDE_DIR=...] [LIB_DIR=...] [DOC_DIR=...] [QGLVIEWER_STATIC=yes]

Atypical usage would be qmakePREFIX=$HOME.Default values are:

- Param -      - Default value
-
PREFIX         /usr
LIB_DIR        PREFIX/lib
INCLUDE_DIR    PREFIX/include
DOC_DIR       
PREFIX/share/doc

The QGLVIEWER_STATIC=yes optionwill compile a static version of the library.



B.configTBB

navigate to the download link https://www.threadingbuildingblocks.org/download

choose linux version to download and extract to /opt by inputting thefollowing sentence:

sudotar -vxf tbb44_20151115oss_lin.tgz -C /opt

afterwards,some environment variables need setting

export TBBROOT=/opt/tbb44_20151115oss
export TBB_ARCH_PLATFORM=ia32/gcc4.4



C.configEIGEN

download the source archivefrom http://bitbucket.org/eigen/eigen/get/3.2.6.tar.bz2

using the following command to extract:

sudo tar -vxjf eigen-eigen-c58038c56923.tar.bz2 -C /opt

then we add an environment variable in ~/.profile

export EIGEN3_DIR=/opt/eigen-eigen-c58038c56923


please note that particularly, when we are using the Eigen library in qt, we must pay attention to the case of the letters or we will not find the files


#include <Eigen/Core>



Following three steps we have done above, now we can compile our demo




Then we run the program and the result will look like below:







At last, we give all the environment variables we have set in this passage:

export Qt5_DIR=/opt/Qt5.5.1/5.5/gcc_64/lib/cmake/Qt5
export QTDIR=/opt/Qt5.5.1
export EIGEN3_DIR=/opt/eigen-eigen-c58038c56923
export TBBROOT=/opt/tbb44_20151115oss
export TBB_ARCH_PLATFORM=ia32/gcc4.4



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值