0

I'm trying to install opencv3.2. following the tutorial here. I got the the point here:

$ cmake -D CMAKE_BUILD_TYPE=RELEASE       -D CMAKE_INSTALL_PREFIX=/usr/local       -D INSTALL_C_EXAMPLES=ON       -D INSTALL_PYTHON_EXAMPLES=ON       -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_OPENGL=ON       -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules       -D BUILD_EXAMPLES=ON ..
-- Detected version of GNU GCC: 49 (409)
-- FP16: Feature disabled
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.11", minimum required is "1.2.3") 
-- Could NOT find Jasper (missing:  JASPER_LIBRARIES JASPER_INCLUDE_DIR) 
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- Found OpenEXR: /usr/lib/x86_64-linux-gnu/libIlmImf.so
-- Checking for module 'gstreamer-base-1.0'
--   No package 'gstreamer-base-1.0' found
-- Checking for module 'gstreamer-video-1.0'
--   No package 'gstreamer-video-1.0' found
-- Checking for module 'gstreamer-app-1.0'
--   No package 'gstreamer-app-1.0' found
-- Checking for module 'gstreamer-riff-1.0'
--   No package 'gstreamer-riff-1.0' found
-- Checking for module 'gstreamer-pbutils-1.0'
--   No package 'gstreamer-pbutils-1.0' found
-- Checking for module 'gstreamer-base-0.10'
--   No package 'gstreamer-base-0.10' found
-- Checking for module 'gstreamer-video-0.10'
--   No package 'gstreamer-video-0.10' found
-- Checking for module 'gstreamer-app-0.10'
--   No package 'gstreamer-app-0.10' found
-- Checking for module 'gstreamer-riff-0.10'
--   No package 'gstreamer-riff-0.10' found
-- Checking for module 'gstreamer-pbutils-0.10'
--   No package 'gstreamer-pbutils-0.10' 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
-- Checking for module 'libavresample'
--   No package 'libavresample' found
-- Checking for module 'libgphoto2'
--   No package 'libgphoto2' found
-- Found TBB: /usr/lib/x86_64-linux-gnu/libtbb.so
-- found IPP (ICV version): 9.0.1 [9.0.1]
-- at: /home/thijser/opencv/build/3rdparty/ippicv/ippicv_lnx
-- CUDA detected: 8.0
-- CUDA NVCC target flags: -gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-D_FORCE_INLINES
-- Found OpenBLAS libraries: /opt/OpenBLAS/lib/libopenblas.so
-- Found OpenBLAS include: /usr/include
-- LAPACK(OpenBLAS): LAPACK_LIBRARIES: /opt/OpenBLAS/lib/libopenblas.so
CMake Warning at cmake/OpenCVFindLAPACK.cmake:29 (message):
  LAPACK(OpenBLAS): CBLAS/LAPACK headers are not found in '/usr/include'
Call Stack (most recent call first):
  cmake/OpenCVFindLAPACK.cmake:89 (ocv_lapack_check)
  CMakeLists.txt:559 (include)


-- Could NOT find Atlas (missing:  Atlas_CLAPACK_INCLUDE_DIR) 
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- LAPACK(OpenBLAS): LAPACK_LIBRARIES: /usr/lib/liblapack.so;/usr/lib/libf77blas.so;/usr/lib/libatlas.so
CMake Warning at cmake/OpenCVFindLAPACK.cmake:29 (message):
  LAPACK(OpenBLAS): CBLAS/LAPACK headers are not found in '/usr/include'
Call Stack (most recent call first):
  cmake/OpenCVFindLAPACK.cmake:151 (ocv_lapack_check)
  CMakeLists.txt:559 (include)


-- Found apache ant 1.9.8: /usr/bin/ant
-- Could NOT find Matlab (missing:  MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN) 
-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.

-- Found VTK ver. 6.3.0 (usefile: /usr/lib/cmake/vtk-6.3/UseVTK.cmake)
-- Caffe:   NO
-- Protobuf:   YES
-- Glog:   YES
-- freetype2:   YES
-- harfbuzz:    YES
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Module opencv_sfm disabled because the following dependencies are not found: Glog/Gflags
-- Assume that non-module dependency is available: freetype (for module opencv_freetype)
-- Assume that non-module dependency is available: harfbuzz (for module opencv_freetype)
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
CMake Error at /home/thijser/opencv_contrib/modules/dnn/CMakeLists.txt:80 (message):
  OPENCV_TEST_DATA_PATH environment variable was not specified


-- Configuring incomplete, errors occurred!
See also "/home/thijser/opencv/build/CMakeFiles/CMakeOutput.log".
See also "/home/thijser/opencv/build/CMakeFiles/CMakeError.log".

So that suggests that the main error is

-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.

Anybody know how to fix that? Alternatively atlas might not be installed however sudo apt-get install libatlas-base-dev shows atlas is already installed.

Switching -D WITH_QT=ON on instead gives me the error

$ cmake -D WITH_QT=ON -D WITH_XINE=ON -D WITH_OPENGL=ON -D WITH_TBB=ON -D WITH_QT=ON -D BUILD_EXAMPLES=ON ..
-- Detected version of GNU GCC: 49 (409)
-- FP16: Feature disabled
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.11", minimum required is "1.2.3") 
-- Could NOT find Jasper (missing:  JASPER_LIBRARIES JASPER_INCLUDE_DIR) 
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- Found OpenEXR: /usr/lib/x86_64-linux-gnu/libIlmImf.so
-- Checking for module 'gstreamer-base-1.0'
--   No package 'gstreamer-base-1.0' found
-- Checking for module 'gstreamer-video-1.0'
--   No package 'gstreamer-video-1.0' found
-- Checking for module 'gstreamer-app-1.0'
--   No package 'gstreamer-app-1.0' found
-- Checking for module 'gstreamer-riff-1.0'
--   No package 'gstreamer-riff-1.0' found
-- Checking for module 'gstreamer-pbutils-1.0'
--   No package 'gstreamer-pbutils-1.0' found
-- Checking for module 'gstreamer-base-0.10'
--   No package 'gstreamer-base-0.10' found
-- Checking for module 'gstreamer-video-0.10'
--   No package 'gstreamer-video-0.10' found
-- Checking for module 'gstreamer-app-0.10'
--   No package 'gstreamer-app-0.10' found
-- Checking for module 'gstreamer-riff-0.10'
--   No package 'gstreamer-riff-0.10' found
-- Checking for module 'gstreamer-pbutils-0.10'
--   No package 'gstreamer-pbutils-0.10' found
-- Checking for module 'libxine'
--   Found libxine, version 1.2.6
-- 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
-- Checking for module 'libavresample'
--   No package 'libavresample' found
-- Checking for module 'libgphoto2'
--   No package 'libgphoto2' found
-- Found TBB: /usr/lib/x86_64-linux-gnu/libtbb.so
-- found IPP (ICV version): 9.0.1 [9.0.1]
-- at: /home/thijser/opencv/build/3rdparty/ippicv/ippicv_lnx
-- CUDA detected: 8.0
-- CUDA NVCC target flags: -gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-D_FORCE_INLINES
-- Found OpenBLAS libraries: /opt/OpenBLAS/lib/libopenblas.so
-- Found OpenBLAS include: /usr/include
-- LAPACK(OpenBLAS): LAPACK_LIBRARIES: /opt/OpenBLAS/lib/libopenblas.so
CMake Warning at cmake/OpenCVFindLAPACK.cmake:29 (message):
  LAPACK(OpenBLAS): CBLAS/LAPACK headers are not found in '/usr/include'
Call Stack (most recent call first):
  cmake/OpenCVFindLAPACK.cmake:89 (ocv_lapack_check)
  CMakeLists.txt:559 (include)


-- Could NOT find Atlas (missing:  Atlas_CLAPACK_INCLUDE_DIR) 
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- LAPACK(OpenBLAS): LAPACK_LIBRARIES: /usr/lib/liblapack.so;/usr/lib/libf77blas.so;/usr/lib/libatlas.so
CMake Warning at cmake/OpenCVFindLAPACK.cmake:29 (message):
  LAPACK(OpenBLAS): CBLAS/LAPACK headers are not found in '/usr/include'
Call Stack (most recent call first):
  cmake/OpenCVFindLAPACK.cmake:151 (ocv_lapack_check)
  CMakeLists.txt:559 (include)


-- Found apache ant 1.9.8: /usr/bin/ant
-- Could NOT find Matlab (missing:  MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN) 
-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.

-- Found VTK ver. 6.3.0 (usefile: /usr/lib/cmake/vtk-6.3/UseVTK.cmake)
-- Caffe:   NO
-- Protobuf:   YES
-- Glog:   YES
-- freetype2:   YES
-- harfbuzz:    YES
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Module opencv_sfm disabled because the following dependencies are not found: Glog/Gflags
-- Assume that non-module dependency is available: freetype (for module opencv_freetype)
-- Assume that non-module dependency is available: harfbuzz (for module opencv_freetype)
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
CMake Error at /home/thijser/opencv_contrib/modules/dnn/CMakeLists.txt:80 (message):
  OPENCV_TEST_DATA_PATH environment variable was not specified


-- Configuring incomplete, errors occurred!
See also "/home/thijser/opencv/build/CMakeFiles/CMakeOutput.log".
See also "/home/thijser/opencv/build/CMakeFiles/CMakeError.log".
  • Or just any tips on how to get more relevant information? – Thijser Jul 12 '17 at 15:56
  • Read the log - "See also "/home/thijser/opencv/build/CMakeFiles/CMakeOutput.log". See also "/home/thijser/opencv/build/CMakeFiles/CMakeError.log". " – Panther Jul 12 '17 at 16:35
  • Is there some reason you are not installing opencv from the repos ? packages.ubuntu.com/source/trusty/opencv – Panther Jul 12 '17 at 16:37
  • @bodhi.zazen I'm not installing from the repos because that's opencv 2.4 while I need 3.0+. Anyway I'm currently trying something that seems to be working. – Thijser Jul 12 '17 at 17:03
  • Alright it turns out this stackoverflow.com/questions/41598755/… solution works. Should this be closed as duplicate? – Thijser Jul 12 '17 at 18:02
0

Alright after a bit of searching I found an answer here. Basically by commenting out the torch test data generator we can solve this, this does mean that you cannot test whatever or not the torch importer will work. You can find the data in gedit /home/thijser/opencv_contrib/modules/dnn/CMakeLists.txt

like so

# ----------------------------------------------------------------------------
# Generating test data for Torch importer
# ----------------------------------------------------------------------------
#OCV_OPTION(${the_module}_BUILD_TORCH_TESTS "Build Torch tests (installed torch7 with nn module is required)" ON IF BUILD_TESTS AND ${the_module}_BUILD_TORCH_IMPORTER AND HAVE_TORCH_EXE)
#if(${the_module}_BUILD_TORCH_TESTS)
#
#    if(NOT DEFINED ENV{OPENCV_TEST_DATA_PATH})
#        message(FATAL_ERROR "OPENCV_TEST_DATA_PATH environment variable was not specified")
#    endif()
#
 #   if(NOT HAVE_TORCH_EXE)
  #      message(FATAL_ERROR "Torch executable \"th\" not found or nn module not found")
   # endif()

#    add_custom_command( TARGET opencv_test_${name} POST_BUILD
#                        COMMAND th ${CMAKE_CURRENT_SOURCE_DIR}/testdata/dnn/torch/#torch_gen_test_data.lua
 #                       WORKING_DIRECTORY  $ENV{OPENCV_TEST_DATA_PATH}/dnn/torch )
  #  add_definitions(-DENABLE_TORCH_TESTS=1)
#endif()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.