возникли проблемы с установкой aruco lib в Ubuntu 14.04, где у меня нет прав sudo и нет доступа к /usr/...
Я скачал .zip aruco lib и сделал следующее:
mkdir build
cd build
cmake .. (gives me: -- Build files have been written to: software/aruco-2.0.19/build
make (gives me some warning msg but nothing critical)
make install (gives an error)
make install дает мне:
-- Install configuration: "Debug"
CMake Error at cmake_install.cmake:36 (FILE):
file cannot create directory: /usr/local/lib/cmake. Maybe need
administrative privileges.
Теперь простой вопрос:
как указать в файле Makefile папки сборки путь для установкибиблиотека локально
Ну, я хотел бы использовать эту библиотеку с ros, и я включил ее в пакет cpp, как это в CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.3)
PROJECT(ros_aruco)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
FIND_PACKAGE(catkin REQUIRED COMPONENTS roscpp tf std_msgs sensor_msgs geometry_msgs message_generation genmsg cv_bridge image_transport)
#INCLUDE_DIRECTORIES("/hri/localdisk/markus/software/aruco-2.0.19/src")
SET(ARUCO_INCLUDE_DIRS "/hri/localdisk/markus/software/aruco-2.0.19/src") ## headers!
SET(CMAKE_MODULE_PATH "/hri/localdisk/markus/software/aruco-2.0.19/build") ## path to Findaruco.cmake
#SET(CMAKE_MODULE_PATH ${ARUCO_PATH}/lib/cmake)
#SET(ARUCO_INCLUDE_DIRS ${ARUCO_PATH}/include/aruco)
## System dependencies are found with CMake's conventions
FIND_PACKAGE(aruco REQUIRED)
FIND_PACKAGE(OpenCV REQUIRED)
INCLUDE(FindPkgConfig)
SET(ROS_BUILD_TYPE Release)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -march=core-avx-i -O2")
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
${catkin_INCLUDE_DIRS}
${ARUCO_INCLUDE_DIRS}
)
add_executable(ros_aruco
src/ros_aruco.cpp
)
add_dependencies(ros_aruco ${catkin_EXPORTED_TARGETS})
# give .so librarys:
target_link_libraries(ros_aruco
${catkin_LIBRARIES}
${OpenCV_LIBS}
"/hri/localdisk/markus/software/aruco-2.0.19/build/src"
)
При компиляции сэтот код я получаю эту ошибку, которую я хотел бы решить:
CMakeFiles/ros_aruco.dir/src/ros_aruco.cpp.o: In function `main':
ros_aruco.cpp:(.text.startup+0x18d): undefined reference to `aruco::CameraParameters::readFromXMLFile(std::string)'
ros_aruco.cpp:(.text.startup+0x1cf): undefined reference to `aruco::CameraParameters::resize(cv::Size_<int>)'
ros_aruco.cpp:(.text.startup+0x49a): undefined reference to `aruco::CameraParameters::CameraParameters(aruco::CameraParameters const&)'
ros_aruco.cpp:(.text.startup+0x4bd): undefined reference to `aruco::MarkerDetector::detect(cv::Mat const&, std::vector<aruco::Marker, std::allocator<aruco::Marker> >&, aruco::CameraParameters, float, bool)'
ros_aruco.cpp:(.text.startup+0xfce): undefined reference to `aruco::CvDrawingUtils::draw3dCube(cv::Mat&, aruco::Marker&, aruco::CameraParameters const&, bool)'
ros_aruco.cpp:(.text.startup+0xfe7): undefined reference to `aruco::CvDrawingUtils::draw3dAxis(cv::Mat&, aruco::Marker&, aruco::CameraParameters const&)'
CMakeFiles/ros_aruco.dir/src/ros_aruco.cpp.o: In function `_GLOBAL__sub_I_current_image_copy':
ros_aruco.cpp:(.text.startup+0x1fa0): undefined reference to `aruco::CameraParameters::CameraParameters()'
ros_aruco.cpp:(.text.startup+0x1fbe): undefined reference to `aruco::MarkerDetector::MarkerDetector()'
ros_aruco.cpp:(.text.startup+0x1fcd): undefined reference to `aruco::MarkerDetector::~MarkerDetector()'