gpt4 book ai didi

c++ - 图形工具:在 Linux 中编译并连接到本地 CGAL 库? (没有须藤)

转载 作者:行者123 更新时间:2023-11-28 04:38:19 25 4
gpt4 key购买 nike

[Ubuntu]

我在本地编译了CGAL:

/path/to/cgal/
/lib/
libCGAL_Core.so libCGAL_Core.so.13.0.2
libCGAL_ImageIO.so.13 libCGAL.so libCGAL.so.13.0.2
libCGAL_Core.so.13 libCGAL_ImageIO.so
libCGAL_ImageIO.so.13.0.2 libCGAL.so.13
/include/
/CGAL/
version.h compiler_config.h

而且我已经设法满足除 cgal 之外的所有图形工具要求(至少检查了 cgal 的所有要求):

./configure --with-boost=/path/to/boost --with-cgal=/path/to/cgal

然后我获得了所有成功,直到收到以下错误消息:

checking for __gmpz_init in -lgmp... yes
checking for __gmpz_init in -lgmp... (cached) yes
checking whether CGAL is available in /path/to/cgal... no
configure: error: CGAL library not found.

// the harshest part is that it seems to be searching in the correct
// directory.

我尝试在 cgal 构建目录中指定不同的点。我使用的 cgal 编译命令是(来自构建目录):

cmake path/to/cgal_src_dir -DCMAKE_BUILD_TYPE=Release;

接下来,我尝试添加包括:

./configure --with-boost=$boost --with-cgal=path/to/cgal CPPFLAGS="-I path/to/cgal/include -I $HOME/.local/include" LDFLAGS="-L path/to/cgal/lib -L $HOME/.local/lib -Wl,-rpath=$HOME/.local/lib"

我承认我不理解 -Wl,-rpath= 部分,我从 graph-tool 安装指南中复制了它。 .local/lib 文件夹包含其他组件的文件,例如 gmp、expat、sparsehash 等。

最佳答案

这不是确切的答案,但根据 OP 的要求将有助于完成安装,所以请不要盲目投票。

要创建 libcgal 的 debian 包,请打开您的 CMakeList.txt 并在文件末尾添加:

#--------------------------------------------------------------------
# Create debian files
#--------------------------------------------------------------------
if (UNIX AND NOT APPLE)
SET(CPACK_GENERATOR "DEB")
SET(CPACK_PACKAGE_NAME "libcgal-all")
SET(CPACK_PACKAGE_VERSION "${CGAL_VERSION}")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "C++ library for computational geometry (development files)\n CGAL (Computational Geometry Algorithms Library) makes the most important of the solutions and methods developed in computational geometry available to users in industry and academia in a C++ library. The goal is to provide easy access to useful, reliable geometric algorithms.\n .\n This package contains the header files and static libraries for libCGAL.so, libCGAL_Core.so, and libCGAL_ImageIO.so. The header files and static libraries for libCGAL_Qt4.so can be found in the package libcgal-qt4-dev.")
SET(CPACK_PACKAGE_CONTACT "bordeo")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-dev, libboost-thread-dev, libboost-system-dev, libboost-program-options-dev, libgmp10-dev, libmpfr-dev, zlib1g-dev")
SET(CPACK_DEBIAN_PACKAGE_REPLACES "libcgal10, libcgal-dev")
INCLUDE(CPack)
endif()

如果您没有任何依赖项,请删除整行 SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libcln6, libcln-dev, libreadline6, libreadline6-dev, flex, bison"),并更改 其他看起来合适的

现在转到终端并在 cgal 目录中发出以下命令

mkdir build
cd build
cmake-gui ..
# set CMAKE_INSTALL_PREFIX to `~/.local
cmake ..
make -j4
cpack ..

您会发现您的 debian 已构建。将 debian 提取或安装到 ~/.local

完成后,转到图形工具目录并开始构建

./configure --prefix="/wherever"  --with-boost=/path/to/boost --with-cgal=~/.local
make -j4
make install

希望这能解决您的问题。

关于c++ - 图形工具:在 Linux 中编译并连接到本地 CGAL 库? (没有须藤),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50807433/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com