日期:2021/12/6
论文链接:https://arxiv.org/abs/2011.10202
1
问题描述
执行命令:
cmake .. -DBUILD_BINDINGS_PYTHON=OFF -DBUILD_BINDINGS_MATLAB=OFF -DBUILD_TESTS=ON
时,出现如下报错:
CMake Error at CMakeLists.txt:35 (find_package):
By not providing “FindEigen3.cmake” in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by “Eigen3”, but
CMake did not find one.
Could not find a package configuration file provided by “Eigen3” with any
of the following names:
Eigen3Config.cmake
eigen3-config.cmake
Add the installation prefix of “Eigen3” to CMAKE_PREFIX_PATH or set
“Eigen3_DIR” to a directory containing one of the above files. If “Eigen3”
provides a separate development package or SDK, be sure it has been
installed.
如下图所示:
解决方法
参考链接:https://www.cnblogs.com/sea-stream/p/9798681.html
1)找到FindEigen3.cmake文件,复制到Clipper文件夹下,我的文件地址为:/usr/lib/x86_64-linux-gnu/cmake/CGAL。
2)在工程的CMakeLists.txt里面添加这句话:
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
如下图所示:
2
问题描述
执行命令:
cmake .. -DBUILD_BINDINGS_PYTHON=OFF -DBUILD_BINDINGS_MATLAB=OFF -DBUILD_TESTS=ON
时,出现如下报错:
CMake Error at CMakeLists.txt:73 (add_library):
Target “clipper” links to target “Eigen3::Eigen” but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at test/CMakeLists.txt:3 (add_executable):
Target “tests” links to target “Eigen3::Eigen” but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
如下图所示:
解决方法
在cmakelist.txt中
add_library(clipper SHARED)
target_sources(clipper PRIVATE
src/find_dense_cluster.cpp
src/affinity.cpp
src/utils.cpp
src/invariants/euclidean_distance.cpp
src/invariants/pointnormal_distance.cpp)
target_link_libraries(clipper PUBLIC Eigen)
改为:
add_library(clipper SHARED)
target_sources(clipper PRIVATE
src/find_dense_cluster.cpp
src/affinity.cpp
src/utils.cpp
src/invariants/euclidean_distance.cpp
src/invariants/pointnormal_distance.cpp)
target_link_libraries(clipper PUBLIC Eigen3::Eige)
再次编译,运行结果如下:
对于这个报错,采用与上面同样的解决方法,将test文件夹下的CMakeLists.txt进行修改,可以成功编译。
3
如果要编译python部分的话,需要将cmake文件夹下的pybind11.cmake.in移动到Clipper文件夹下。
日期:2021/12/9
1 ubuntu20.04 编译运行Clipper
一遍过,没有丝毫报错。
2 ubuntu18.04 编译运行Clipper
出现两个报错。
1 usr/bin/ld: 找不到 -lgtest
如下图所示:
解决方法:
安装gtest。
参考教程:https://www.cnblogs.com/helloworldcode/p/9606838.html
2 xxx未定义的引用
如下图所示:
解决方法:
对于“xxx未定义的引用”的问题,原因有很多,解决方法也各不相同。
此处是将build文件夹中编译生成的文件全部删除,然后重新编译来解决的。