OpenCV with CMake 3.5.2 and CMake 2.XX

I find it difficult to solve the specific question that I have: I can’t pinpoint the culprit.

System: Jetson TX1, arm64 core, 32-bit user space, opencv4tegra

The situation:. Created projects using:

find_package( OpenCV ) 

And it worked perfectly and compiled.

Malfunction . I built from source and installed CMake 3.5.2. Now I can no longer build projects that depend on OpenCV. I get linker errors that the dot cannot find:

 opencv_dep_cudart 

I assume the problems are caused in OpenCVCConfig.cmake , around this point:

 # Import target "opencv_core" for configuration "Release" set_property(TARGET opencv_core APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_target_properties(opencv_core PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "opencv_dep_cudart;opencv_dep_nppc;opencv_dep_nppi;opencv_dep_npps;dl;m;pthread;rt;tbb" IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libopencv_core.so.2.4.12" IMPORTED_SONAME_RELEASE "libopencv_core.so.2.4" ) 

From file: /usr/share/OpenCV/OpenCVModules-release.cmake

However, this file does not change between versions of CMake, because it is an OpenCV file. So it should be how it is handled.

Returning my CMake back to 2.8.12.2 manually allowed me to create again. The following is an example of a make command using OpenCV. Check out the correct cuda libraries:

 Linking CXX executable DuoInterfaceTest /usr/local/bin/cmake -E cmake_link_script CMakeFiles/DuoInterfaceTest.dir/link.txt --verbose=1 /usr/bin/c++ -O2 -g -DNDEBUG -std=gnu++11 CMakeFiles/DuoInterfaceTest.dir/src/mainTest.cpp.o -o DuoInterfaceTest -L/home/ubuntu/catkin_ws/duointerface/lib/linux/arm -rdynamic libDuoInterface.a /usr/lib/libopencv_vstab.so.2.4.12 /usr/lib/libopencv_tegra.so.2.4.12 /usr/lib/libopencv_imuvstab.so.2.4.12 /usr/lib/libopencv_facedetect.so.2.4.12 /usr/lib/libopencv_esm_panorama.so.2.4.12 /usr/lib/libopencv_detection_based_tracker.so.2.4.12 /usr/lib/libopencv_videostab.so.2.4.12 /usr/lib/libopencv_video.so.2.4.12 /usr/lib/libopencv_ts.a /usr/lib/libopencv_superres.so.2.4.12 /usr/lib/libopencv_stitching.so.2.4.12 /usr/lib/libopencv_photo.so.2.4.12 /usr/lib/libopencv_objdetect.so.2.4.12 /usr/lib/libopencv_ml.so.2.4.12 /usr/lib/libopencv_legacy.so.2.4.12 /usr/lib/libopencv_imgproc.so.2.4.12 /usr/lib/libopencv_highgui.so.2.4.12 /usr/lib/libopencv_gpu.so.2.4.12 /usr/lib/libopencv_flann.so.2.4.12 /usr/lib/libopencv_features2d.so.2.4.12 /usr/lib/libopencv_core.so.2.4.12 /usr/lib/libopencv_contrib.so.2.4.12 /usr/lib/libopencv_calib3d.so.2.4.12 /usr/lib/libopencv_tegra.so.2.4.12 /usr/lib/libopencv_stitching.so.2.4.12 /usr/lib/libopencv_gpu.so.2.4.12 /usr/lib/libopencv_photo.so.2.4.12 /usr/lib/libopencv_legacy.so.2.4.12 /usr/local/cuda-7.0/lib/libcufft.so /usr/lib/libopencv_video.so.2.4.12 /usr/lib/libopencv_objdetect.so.2.4.12 /usr/lib/libopencv_ml.so.2.4.12 /usr/lib/libopencv_calib3d.so.2.4.12 /usr/lib/libopencv_features2d.so.2.4.12 /usr/lib/libopencv_highgui.so.2.4.12 /usr/lib/libopencv_imgproc.so.2.4.12 /usr/lib/libopencv_flann.so.2.4.12 /usr/lib/libopencv_core.so.2.4.12 /usr/local/cuda-7.0/lib/libcudart.so /usr/local/cuda-7.0/lib/libnppc.so /usr/local/cuda-7.0/lib/libnppi.so /usr/local/cuda-7.0/lib/libnpps.so -ldl -lm -lpthread -lrt -ltbb -lDUO -Wl,-rpath,/home/ubuntu/catkin_ws/duointerface/lib/linux/arm:/usr/local/cuda-7.0/lib 

Thoughts? I would like to be able to keep the new CMake on my system, but I don’t understand enough to fix this problem. If you think this is too system-unique, I’ll bring up a question.

+8
opencv cmake
source share
1 answer

As Michael Mayregger noted, you need to insert into the assembly directory by doing

 sudo cmake .. -DCUDA_USE_STATIC_CUDA_RUNTIME=false 

But another thing that I noticed is that if I try to make after this, it will not work unless I do the cmake command twice .

+2
source share

All Articles