我的最终目标是让 python 包 graph_tool
在我的系统上工作,如果可能的话,也在 ipynb 上工作。我已经brew install graph-tool
,as indicated here ,但这仍然不够。
所以我关注Anaconda instructions here ,并且我取得了不错的进展,直到找不到 CGAL 库。
注意:为了遵守 Anaconda 说明,我安装了 anaconda3 并创建了一个新的 conda 环境(名为 py36env)来 conda 安装所有必需的软件包(必须也与 python 3.6 匹配)
entire ./configure output 。下面是一个片段:
(py36env) $ ./configure --prefix=/Users/tamtran/anaconda3/envs/py36env/ --with-python-module-path=/Users/tamtran/anaconda3/envs/py36env/lib/python3.6/site-packages --with-cgal=/Users/tamtran/anaconda3/envs/py36env/
.
.
checking whether CGAL is available in /Users/tamtran/anaconda3/envs/py36env/... no
configure: error: CGAL library not found.
entire config.log 。下面是一个片段:
configure:21200: checking whether CGAL is available in /Users/tamtran/anaconda3/envs/py36env/
configure:21236: g++ -std=gnu++14 -o conftest -fopenmp -O3 -fvisibility=default -fvisibility-inlines-hidden -Wno-deprecated -Wall -Wextra -ftemplate-backtrace-limit=0 -DNDEBUG -I/Users/tamtran/anaconda3/envs/py36env//include -pthread -I/usr/local/include -L/Users/tamtran/anaconda3/envs/py36env//lib -lCGAL -lCGAL_Core -lgmp -lboost_thread-mt -lpthread conftest.cpp -lgmp -lgmp >&5
| #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
| #include <CGAL/convex_hull_2.h>
| typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
| CGAL::convex_hull_2(points.begin(),points.end(),std::back_inserter(result));
configure:21278: error: CGAL library not found.
CGAL_CPPFLAGS='-I/Users/tamtran/anaconda3/envs/py36env//include'
CGAL_FLAGS=''
CGAL_LDFLAGS='-L/Users/tamtran/anaconda3/envs/py36env//lib -lCGAL -lCGAL_Core -lgmp -lboost_thread-mt -lpthread'
注意:即使没有 --with-cgal
标签,也会出现同样的问题。 (我认为)CGAL 搜索目录位于 py36env 内也很重要,因为与 python3.6 匹配的 CGAL 位于其中,而 CGAL-python3.5 位于 conda 根环境中。没有 CGAL 目录的 ./configure
输出的唯一区别是:
checking whether CGAL is available in /usr... no
checking whether CGAL is available in /usr/local... no
checking whether CGAL is available in /opt... no
checking whether CGAL is available in /opt/local... no
最佳答案
在 mac os x 上您必须使用 -lcgal(正在使用brew)
例如在 fedora linux -lCGAL
关于配置:错误:找不到 CGAL 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46922619/