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.youkuaiyun.com/seamanj/article/details/50658460
http://blog.youkuaiyun.com/seamanj/article/details/50595966
http://blog.youkuaiyun.com/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