Closed UselessHua closed 4 months ago
Thank you very much for trying MC-Calib. Please tell me more about your problem. On what OS are you trying to install the toolbox? Could you give me more details on what led to this error?
If it helps, I am also seeing this on Ubunty 20.04.
Thank you very much for the additional feedback. Could you please share the entire error message? I will try to replicate it but I assume it is a problem with libraries versions. If possible could you report the version of all your dependencies ? An easy fix is to use the docker provided with MC-Calib (if you are familiar with it).
I can comment line and it works.
@vswdigitall please follow the issue template so we can better understand your setup and resolve the issue faster.
What's on the line CMakeLists.txt:51
? I believe CMakeLists.txt has been modified in your case compared to the one found in master
branch?
For current master, i can't cmake your code. Only if disable line 74 it works. Line 51 solved by installing doxygen.
Please provide the full output from the cmake command to start with @vswdigitall
-- Boost version: 1.74.0 Doxygen build started CMake Error at CMakeLists.txt:74 (find_library): Could not find McCalib using the following names:
-- Configuring incomplete, errors occurred! See also "/home/vsw/MC-Calib/CMakeFiles/CMakeOutput.log". CMake process exited with exit code 1.
Elapsed time: 00:00.
I just modified CMakeLists.txt for both of ROOT and 'McCalib' directory like below and run separated build steps;
--- CMakeLists.txt.ORIG 2023-11-29 10:20:39.458403852 +0900
+++ CMakeLists.txt 2023-11-29 10:23:51.189940669 +0900
@@ -1,9 +1,44 @@
+project(McCalib)
file(GLOB MC_CALIB_HEADERS include/*.hpp include/*.h)
file(GLOB MC_CALIB_SOURCES CONFIGURE_DEPENDS src/*.cpp)
+# OpenCV
+find_package(OpenCV REQUIRED)
+include_directories( ${OpenCV_INCLUDE_DIRS} )
+
+# CERES
+find_package(Ceres REQUIRED)
+
+# Boost related setup
+set(Boost_USE_STATIC_LIBS ON)
+set(Boost_USE_MULTITHREADED ON)
+find_package(Boost COMPONENTS log system filesystem REQUIRED)
+message(STATUS "Boost version: ${Boost_VERSION}")
+
+# This is needed if your Boost version is newer than your CMake version
+# or if you have an old version of CMake (<3.5)
+if(NOT TARGET Boost::filesystem)
+ add_library(Boost::filesystem IMPORTED INTERFACE)
+ set_property(TARGET Boost::filesystem PROPERTY
+ INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR})
+ set_property(TARGET Boost::filesystem PROPERTY
+ INTERFACE_LINK_LIBRARIES ${Boost_LIBRARIES})
+endif()
+
+include_directories(
+ include
+ /usr/include/opencv4
+ /usr/include/eigen3
+ /usr/local/lib
+)
+
add_library(McCalib STATIC ${MC_CALIB_HEADERS} ${MC_CALIB_SOURCES})
set_target_properties(McCalib PROPERTIES VERSION "${PROJECT_VERSION}")
target_include_directories(McCalib PUBLIC include)
target_include_directories(McCalib PUBLIC src)
target_link_libraries(McCalib PUBLIC -L/usr/local/lib ${OpenCV_LIBS} ${CERES_LIBRARIES} Boost::log Boost::system Boost::filesystem)
+
+# Install library
+install(TARGETS ${PROJECT_NAME} DESTINATION ../${PROJECT_NAME})
+
--- CMakeLists.txt.ORIG 2023-11-29 10:26:05.823796525 +0900
+++ CMakeLists.txt 2023-11-29 10:26:30.226668818 +0900
@@ -72,6 +72,7 @@
##########################################################################
add_subdirectory(apps/create_charuco_boards)
add_subdirectory(McCalib)
-find_library(McCalib REQUIRED)
+#find_library(McCalib REQUIRED)
+find_library(McCalib NAMES libMcCalib.a PATHS McCalib/build REQUIRED)
add_subdirectory(apps/calibrate)
add_subdirectory(tests)
Build 'libMcCalib.a'
cd McCalib
mkdir build && cd build
cmake DCMAKE_BUILD_TYPE=Release .. && make -j 8
Build 'calibrate' and 'create_charuco_boards'
cd <ROOT> ## of MC-Calib sources
mkdir build && cd build
cmake DCMAKE_BUILD_TYPE=Release .. && make -j 8
Strange things is, libMcCalib.a seems rebuilt during second build step. Anyway it's working in my case.
@nukbridge thank you for providing the solution.
How to solve this problem and how to find McCalib?