同一个包在电脑的Ubuntu16.04下可以编译,却无法在tx2的Ubuntu16.04下编译,而且没有缺少包。
报错
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CHOLMOD_LIBRARY
cmakelists 相关代码
find_package(SuiteSparse REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR} ${CHOLMOD_INCLUDE_DIR})
cs_add_executable(xxx src/xxx.cpp)
target_link_libraries(xxx ${CHOLMOD_LIBRARY})
SuiteSparse和CHOLMOD应该是有很大关联的,找到SuiteSparse就应该找到CHOLMOD_LIBRARY了。但在tx2上明明都安装了,却无论如何都没有找到。
解决
把库连接改成一下形式,最终解决问题
target_link_libraries(xxx cholmod)