stereolabs / zed-opencv

ZED SDK interface sample for OpenCV
https://www.stereolabs.com/docs/opencv/
MIT License
137 stars 79 forks source link

Installing_OpenCV on Jetson TK1 error #2

Closed wkyoun closed 8 years ago

wkyoun commented 8 years ago

I tried to install opencv on Jetson TK1 as described in http://elinux.org/Jetson/Installing_OpenCV

When I type sudo make -j4 install, error is as followings:

CUDA 6.5 is installed correctly as we can find it in the following results:

there are some similar errors : http://ubuntuforums.org/showthread.php?t=2244063 http://www.btday.com/cmake-error-while-configuring-cuda-with-opencv/

http://code.opencv.org/issues/3814 http://code.opencv.org/issues/3938

ubuntu@tegra-ubuntu:~/opencv-2.4.9/build$ sudo make -j4 install

-- Detected version of GNU GCC: 48 (408)
-- Could NOT find Jasper (missing:  JASPER_LIBRARIES JASPER_INCLUDE_DIR) 
-- checking for module 'gstreamer-base-0.10'
--   package 'gstreamer-base-0.10' not found
-- checking for module 'libdc1394-2'
--   package 'libdc1394-2' not found
-- checking for module 'libdc1394'
--   package 'libdc1394' not found
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
-- CUDA detected: 6.5
-- CUDA NVCC target flags: -gencode;arch=compute_32,code=sm_32
-- Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY     JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 
-- Assume that non-module dependency is available: cudart (for module opencv_core)
-- Assume that non-module dependency is available: nppc (for module opencv_core)
-- Assume that non-module dependency is available: nppi (for module opencv_core)
-- Assume that non-module dependency is available: npps (for module opencv_core)
-- 
-- General configuration for OpenCV 2.4.9 =====================================
--   Version control:               unknown
-- 
--   Platform:
--     Host:                        Linux 3.10.40-gdacac96 armv7l
--     CMake:                       2.8.12.2
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/make
--     Configuration:               Release
-- 
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ Compiler:                /usr/bin/c++  (ver 4.8.4)
--     C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=address     -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef     -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor     -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -O3 -DNDEBUG      -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=address     -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef     -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor     -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -g  -O0 -DDEBUG     -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=address     -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-    prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing     -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -O3 -DNDEBUG          -DNDEBUG
--     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=address     -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-    prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing     -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -g  -O0 -DDEBUG     -D_DEBUG
--     Linker flags (Release):      
--     Linker flags (Debug):        
--     Precompiled headers:         YES
-- 
--   OpenCV modules:
--     To be built:                 core flann imgproc highgui features2d calib3d ml video legacy     objdetect photo gpu ocl nonfree contrib python stitching superres ts videostab
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 androidcamera dynamicuda java viz
-- 
--   GUI: 
--     QT:                          NO
--     GTK+ 2.x:                    YES (ver 2.24.23)
--     GThread :                    YES (ver 2.40.2)
--     GtkGlExt:                    NO
--     OpenGL support:              NO
--     VTK support:                 NO
-- 
--   Media I/O: 
--     ZLib:                        /usr/lib/arm-linux-gnueabihf/libz.so (ver 1.2.8)
--     JPEG:                        /usr/lib/arm-linux-gnueabihf/libjpeg.so (ver )
--     PNG:                         /usr/lib/arm-linux-gnueabihf/libpng.so (ver 1.2.50)
--     TIFF:                        /usr/lib/arm-linux-gnueabihf/libtiff.so (ver 42 - 4.0.3)
--     JPEG 2000:                   build (ver 1.900.1)
--     OpenEXR:                     build (ver 1.7.1)
-- 
--   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  NO
--     FFMPEG:                      YES
--       codec:                     YES (ver 54.35.0)
--       format:                    YES (ver 54.20.4)
--       util:                      YES (ver 52.3.0)
--       swscale:                   YES (ver 2.1.1)
--       gentoo-style:              YES
--     GStreamer:                   NO
--     OpenNI:                      NO
--     OpenNI PrimeSensor Modules:  NO
--     PvAPI:                       NO
--     GigEVisionSDK:               NO
--     UniCap:                      NO
--     UniCap ucil:                 NO
--     V4L/V4L2:                    Using libv4l (ver 1.0.1)
--     XIMEA:                       NO
--     Xine:                        NO
-- 
--   Other third-party libraries:
--     Use IPP:                     NO
--     Use Eigen:                   YES (ver 3.2.0)
--     Use TBB:                     NO
--     Use OpenMP:                  NO
--     Use GCD                      NO
--     Use Concurrency              NO
--     Use C=:                      NO
--     Use Cuda:                    YES (ver 6.5)
--     Use OpenCL:                  YES
-- 
--   NVIDIA CUDA
--     Use CUFFT:                   YES
--     Use CUBLAS:                  NO
--     USE NVCUVID:                 NO
--     NVIDIA GPU arch:             32
--     NVIDIA PTX archs:
--     Use fast math:               NO
-- 
--   OpenCL:
--     Version:                     dynamic
--     Include path:                /home/ubuntu/opencv-2.4.9/3rdparty/include/opencl/1.2
--     Use AMD FFT:                 NO
--     Use AMD BLAS:                NO
-- 
--   Python:
--     Interpreter:                 /usr/bin/python2 (ver 2.7.6)
--     Libraries:                   /usr/lib/arm-linux-gnueabihf/libpython2.7.so (ver 2.7.6)
--     numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.8.2)
--     packages path:               lib/python2.7/dist-packages
-- 
--   Java:
--     ant:                         NO
--     JNI:                         NO
--     Java tests:                  NO
-- 
--   Documentation:
--     Build Documentation:         NO
--     Sphinx:                      NO
--     PdfLaTeX compiler:           NO
-- 
--   Tests and samples:
--     Tests:                       NO
--     Performance tests:           NO
--     C/C++ Examples:              NO
-- 
--   Install path:                  /usr/local
-- 
--   cvconfig.h is in:              /home/ubuntu/opencv-2.4.9/build
-- -----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/opencv-2.4.9/build
[  0%] Built target opencv_core_pch_dephelp
[  5%] [  5%] Built target libjasper
Built target opencv_flann_pch_dephelp
[  5%] Built target opencv_imgproc_pch_dephelp
[  5%] [  5%] Built target opencv_features2d_pch_dephelp
Built target opencv_highgui_pch_dephelp
[ 15%] Built target IlmImf
[ 16%] Built target opencv_calib3d_pch_dephelp
[ 17%] Built target opencv_video_pch_dephelp
[ 17%] Built target opencv_ml_pch_dephelp
[ 18%] Built target opencv_objdetect_pch_dephelp
[ 18%] [ 18%] Built target opencv_legacy_pch_dephelp
Built target opencv_photo_pch_dephelp
[ 18%] Built target opencv_ts_pch_dephelp
[ 19%] [ 19%] Built target opencv_gpu_pch_dephelp
[ 19%] Built target opencv_nonfree_pch_dephelp
Built target opencv_ocl_pch_dephelp
[ 19%] [ 19%] Built target opencv_videostab_pch_dephelp
Built target opencv_contrib_pch_dephelp
[ 19%] [ 20%] Built target opencv_stitching_pch_dephelp
Built target opencv_superres_pch_dephelp
[ 20%] Built target pch_Generate_opencv_core
[ 21%] Built target pch_Generate_opencv_flann
[ 21%] Built target pch_Generate_opencv_imgproc
[ 21%] Built target pch_Generate_opencv_highgui
[ 21%] [ 21%] Built target pch_Generate_opencv_features2d
Built target pch_Generate_opencv_ml
[ 21%] [ 22%] Built target pch_Generate_opencv_video
Built target pch_Generate_opencv_calib3d
[ 23%] Built target pch_Generate_opencv_objdetect
[ 24%] Built target pch_Generate_opencv_legacy
[ 24%] Built target pch_Generate_opencv_photo
[ 24%] Built target pch_Generate_opencv_gpu
[ 24%] Built target pch_Generate_opencv_ts
[ 24%] Built target pch_Generate_opencv_ocl
[ 24%] [ 24%] Built target pch_Generate_opencv_nonfree
Built target pch_Generate_opencv_contrib
[ 24%] Built target pch_Generate_opencv_stitching
[ 25%] Built target pch_Generate_opencv_superres
[ 26%] Built target pch_Generate_opencv_videostab
Linking CXX shared library ../../lib/libopencv_core.so
[ 30%] Built target opencv_core
Linking CXX shared library ../../lib/libopencv_flann.so
Linking CXX shared library ../../lib/libopencv_ml.so
Linking CXX shared library ../../lib/libopencv_imgproc.so
[ 31%] Built target opencv_flann
[ 34%] Built target opencv_ml
[ 40%] Built target opencv_imgproc
Linking CXX shared library ../../lib/libopencv_photo.so
Linking CXX shared library ../../lib/libopencv_video.so
Linking CXX shared library ../../lib/libopencv_highgui.so
[ 41%] Built target opencv_photo
[ 42%] Built target opencv_video
[ 45%] Built target opencv_highgui
Linking CXX shared library ../../lib/libopencv_features2d.so
Linking CXX shared library ../../lib/libopencv_objdetect.so
[ 47%] Built target opencv_objdetect
[ 49%] Built target opencv_features2d
[ 50%] Built target opencv_ts
Linking CXX shared library ../../lib/libopencv_calib3d.so
[ 52%] Built target opencv_calib3d
Linking CXX shared library ../../lib/libopencv_ocl.so
Linking CXX shared library ../../lib/libopencv_legacy.so
[ 58%] Built target opencv_ocl
[ 70%] Built target opencv_legacy
[ 70%] Built target opencv_haartraining_engine
Linking CXX executable ../../bin/opencv_haartraining
Linking CXX executable ../../bin/opencv_createsamples
Linking CXX executable ../../bin/opencv_performance
[ 70%] Building NVCC (Device) object modules/gpu/CMakeFiles/cuda_compile.dir/src/nvidia/core/.    /cuda_compile_generated_NCVPyramid.cu.o
[ 71%] Built target opencv_createsamples
[ 71%] Built target opencv_haartraining
[ 71%] Built target opencv_performance
Linking CXX executable ../../bin/opencv_traincascade
[ 72%] Built target opencv_traincascade

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(51): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(52): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(53): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(54): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(55): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(56): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(57): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(58): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(61): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(62): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(63): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(64): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(65): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(66): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(67): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(68): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(119): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(120): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(121): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(122): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(123): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(124): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(125): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(126): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(127): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(128): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(129): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(130): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(131): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(132): error: a     storage class is not allowed in an explicit specialization

/home/ubuntu/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(133): error: a     storage class is not allowed in an explicit specialization

31 errors detected in the compilation of "/tmp/tmpxft_00007bdf_00000000-6_NCVPyramid.cpp1.ii".
CMake Error at cuda_compile_generated_NCVPyramid.cu.o.cmake:264 (message):
  Error generating file
  /home/ubuntu/opencv-2.4.9/build/modules/gpu/CMakeFiles/cuda_compile.dir/src/nvidia/core/.    /cuda_compile_generated_NCVPyramid.cu.o

make[2]: *** [modules/gpu/CMakeFiles/cuda_compile.dir/src/nvidia/core/.    /cuda_compile_generated_NCVPyramid.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [modules/gpu/CMakeFiles/opencv_gpu.dir/all] Error 2
make: *** [all] Error 2
wkyoun commented 8 years ago

I cannot compile OpenCV2.4.9 due to the above circumstance

but, OpenCV2.4.10.1 is compiled correctly on Jetson TK1,

Is OpenCV2.4.9 only compatible with ZED camera?

In ZED_Developer_Guide.pdf (https://www.stereolabs.com/developers/documentation/ZED_Developer_Guide.pdf) it only refer opencv 2.4.9

Installing the ZED SDK – Linux Before you start developing applications witht he ZED, download     and install CUDA 6.5 toolkit .Compile and install OpenCV2.4.9
wkyoun commented 8 years ago

I fount solution but it seems incomplete

I change -DWITH_CUDA=ON -> OFF

as described in http://elinux.org/Jetson/Installing_OpenCV

But I don't know whether it is complete solution or not.

cmake -DWITH_CUDA=ON -DCUDA_ARCH_BIN="3.2" -DCUDA_ARCH_PTX=""     -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF ..

cmake -DWITH_CUDA=OFF -DCUDA_ARCH_BIN="3.2" -DCUDA_ARCH_PTX=""     -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF ..
axjensen commented 8 years ago

I use OpenCV version 2.4.11 on Jetson TK1 and everything seems to work fine. I believe, that I use these settings for cmake (I can check later): cmake -DWITH_CUDA=ON -DCUDA_ARCH_BIN="3.2" -DCUDA_ARCH_PTX="3.0" -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF

adujardin commented 8 years ago

Hi,

The ZED SDK is compatible with OpenCV 2.4.X (>=2.4.9 tested). On the Jetson, we only use the version provided by the Jetpack (closed source but optimized by Nvidia).

However, the solution provided by @axjensen should work. By default the jetson gpu arch (3.2) is not built.

You can also disable CUDA support for OpenCV if that solve your compilation issues and if you don't use it. The ZED SDK doesn't need it.

wkyoun commented 8 years ago

@adujardin Did you mean that ZED SDK can be used with OpenCV 2.4.X (>=2.4.9 tested)? I will try openCV 2.4.11 and let you know the results. Thank you