一、安装boost
下载地址:Boost C++ Libraries - Browse /boost at SourceForge.net
我安装的是1.77.0的版本
./bootstrap.sh --prefix=/usr/local/boost
./b2
./b2 install
配置环境变量
vim ~/.bashrcexport BOOST_INCLUDE=/usr/local/boost/include
export BOOST_LIB=/usr/local/boost/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/boost/libsource ~/.bashrc
其余的步骤见:linux安装CGAL(非root)_qq_39128828的博客-CSDN博客_linux安装cgal
二、安装cmake
conda install cmake
cmake --version 查看cmake版本
which cmake 查看安装位置
三、安装cgal
1. 下载cgal
cgal官网安装源码:下载 CGAL 以获得 Linux
https://github.com/CGAL/cgal/releases/download/v5.3.2/CGAL-5.3.2.tar.xz
解压:
tar -zxvf CGAL-5.3.tar.gz
2. 安装gmp
下载地址:Gnu Mp 比格纳姆图书馆 (gmplib.org)
解压:
tar xf gmp-6.2.1.tar.xz
cd gmp-6.2.1
./configure --prefix=/usr/local/gmp
make
make check
sudo make install
# 配置刚才的安装路径
vim ~/.bashrc
export LD_LIBRARY_PATH=/usr/local/gmp/lib:$LD_LIBRARY_PATH
source ~/.bashrc
3. 安装mpfr
下载地址:https://www.mpfr.org/mpfr-current/
解压:
tar xf mpfr-4.1.0.tar.xz
运行:
./configure --prefix==/usr/local/mpfr --with-gmp==/usr/local/gmp
make
make check
sudo make install
4. 安装cgal
添加环境变量:
vim ~/.bashrc
export PATH=/usr/local/gmp/bin:$PATH
export PATH=/usr/local/mpfr/bin:$PATH
source ~/.bashrc
默认路径需要root权限,添加参数-DCMAKE_INSTALL_PREFIX
cmake . -DCMAKE_INSTALL_PREFIX=/home/lyl/download/CGAL-5.3/cmakemakemake install
参考链接:
Linux(Ubuntu)安装CGAL(非root)_ubuntu20安装cgal库-CSDN博客