编译报错:
-- Found TBB: /usr/include (found suitable version "2020.1", minimum required is "4.4") found components: tbb tbbmalloc
-- Could NOT find MKL (missing: MKL_INCLUDE_DIR MKL_LIBRARIES)
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Found Eigen version: 3.3.7
CMake Error at wrap/CMakeLists.txt:32 (target_link_libraries):
The "debug" argument must be followed by a library.
-- Configuring incomplete, errors occurred!
See also "/opt/ykcnnc/libs/libs/gtsam-4.0.2/build/CMakeFiles/CMakeOutput.log".
See also "/opt/ykcnnc/libs/libs/gtsam-4.0.2/build/CMakeFiles/CMakeError.log".
解决方案:
1. 找到gtsam/wrap/CMakeLists.txt文件,注释掉debug部分
set(WRAP_BOOST_LIBRARIES
optimized
${Boost_FILESYSTEM_LIBRARY_RELEASE}
${Boost_SYSTEM_LIBRARY_RELEASE}
${Boost_THREAD_LIBRARY_RELEASE}
# debug
#${Boost_FILESYSTEM_LIBRARY_DEBUG}
#${Boost_SYSTEM_LIBRARY_DEBUG}
#${Boost_THREAD_LIBRARY_DEBUG}
)
2. 找到gtsam/CMakeLists.txt文件,注释掉debug部分
if (GTSAM_DISABLE_NEW_TIMERS)
message("WARNING: GTSAM timing instrumentation manually disabled")
list_append_cache(GTSAM_COMPILE_DEFINITIONS_PUBLIC DGTSAM_DISABLE_NEW_TIMERS)
else()
if(Boost_TIMER_LIBRARY)
list(APPEND GTSAM_BOOST_LIBRARIES
optimized ${Boost_TIMER_LIBRARY_RELEASE}
optimized ${Boost_CHRONO_LIBRARY_RELEASE}
#debug ${Boost_TIMER_LIBRARY_DEBUG}
#debug ${Boost_CHRONO_LIBRARY_DEBUG}
)
else()
list(APPEND GTSAM_BOOST_LIBRARIES rt) # When using the header-only boost timer library, need -lrt
message("WARNING: GTSAM timing instrumentation will use the older, less accurate, Boost timer library because boost older than 1.48 was found.")
endif()
endif()