I am trying to install OpenCV 4.1 on Fedora 29 with CUDA and Caffe support. Everything compiles fine, but when I go to run the simplest program to display an image I get:
terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(4.1.0-dev) /home/ross/OpenCV/opencv/modules/highgui/src/window.cpp:610: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvNamedWindow'
Aborted (core dumped)
I have seen this error on several posts, but haven't found a solution that works.
I have 2 general questions:
1.) Is OpenCV 4 known to work on Fedora 29/30? and
2.) Is it the case that OpenCV no longer uses pkg-config?
Help greatly appreciated.
Below are my Cmake listing and a list of the gtk packages I have installed. Note Cmake thinks I have GTK+
Here is my Cmake listing:
libjpeg-turbo: VERSION = 2.0.2, BUILD = opencv-4.1.0-dev-libjpeg-turbo found Intel IPP (ICV version): 2019.0.0 [2019.0.0 Gold] at: /home/ross/OpenCV/opencv/build/3rdparty/ippicv/ippicv_lnx/icv found Intel IPP Integration Wrappers sources: 2019.0.0 at: /home/ross/OpenCV/opencv/build/3rdparty/ippicv/ippicv_lnx/iw CUDA detected: 10.1 CUDA NVCC target flags: -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;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-D_FORCE_INLINES LAPACK(OpenBLAS): LAPACK_LIBRARIES: /lib64/libopenblas.so LAPACK(OpenBLAS): Support is enabled. Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) Found VTK 7.1.1 (/usr/lib64/cmake/vtk/UseVTK.cmake) OpenCV Python: during development append to PYTHONPATH: /home/ross/OpenCV/opencv/build/python_loader Checking for module 'libdc1394-2' Package 'libdc1394-2', required by 'virtual:world', not found Caffe: YES Protobuf: NO Glog: YES freetype2: YES (ver 22.1.16) harfbuzz: YES (ver 1.8.7) HDF5: Using hdf5 compiler wrapper to determine C configuration Module opencv_ovis disabled because OGRE3D was not found No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available. Found installed version of gflags: /usr/lib64/cmake/gflags Detected broken gflags install in: /usr/lib64/cmake/gflags, version: 2.1.2 <= 2.1.2 which defines gflags_LIBRARIES = gflags which is not an imported CMake target, see: https://github.com/gflags/gflags/issues/110. Attempting to fix by detecting correct gflags target. Found valid gflags target: gflags-shared, updating gflags_LIBRARIES. Detected gflags version: 2.1.2 Checking SFM deps... TRUE CERES support is disabled. Ceres Solver for reconstruction API is required. HDF5: Using hdf5 compiler wrapper to determine C configuration Caffe: YES Protobuf: NO Glog: YES Checking for module 'tesseract' Package 'tesseract', required by 'virtual:world', not found Tesseract: NO No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available. Found installed version of gflags: /usr/lib64/cmake/gflags Detected broken gflags install in: /usr/lib64/cmake/gflags, version: 2.1.2 <= 2.1.2 which defines gflags_LIBRARIES = gflags which is not an imported CMake target, see: https://github.com/gflags/gflags/issues/110. Attempting to fix by detecting correct gflags target. Found valid gflags target: gflags-shared, updating gflags_LIBRARIES. Detected gflags version: 2.1.2 Checking SFM deps... TRUE CERES support is disabled. Ceres Solver for reconstruction API is required. OpenCL samples are skipped: OpenCL SDK is required
General configuration for OpenCV 4.1.0-dev ===================================== Version control: 4.1.0-220-g166ecaeda
Extra modules: Location (extra): /home/ross/OpenCV/opencv_contrib/modules Version control (extra): 4.1.0-32-g2465def8
Platform: Timestamp: 2019-05-26T07:09:40Z Host: Linux 5.1.11-200.fc29.x86_64 x86_64 CMake: 3.14.5 CMake generator: Unix Makefiles CMake build tool: /usr/bin/gmake Configuration: Release
CPU/HW features: Baseline: SSE SSE2 SSE3 requested: SSE3 Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX SSE4_1 (15 files): + SSSE3 SSE4_1 SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX AVX (5 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX AVX2 (29 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX512_SKX (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX
C/C++:
Built as dynamic libs?: YES
C++ Compiler: /usr/lib64/ccache/c++ (ver 8.3.1)
C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O2 -DNDEBUG -DNDEBUG
C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: /usr/lib64/ccache/cc
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -O2 -DNDEBUG -DNDEBUG
C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release): -Wl,--gc-sections
Linker flags (Debug): -Wl,--gc-sections
ccache: YES
Precompiled headers: NO
Extra dependencies: /home/ross/Data/Code/Caffe/caffe-master/build/lib/libcaffe.so /lib64/libglog.so m pthread cudart_static -lpthread dl rt nppc nppial nppicc nppicom nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cufft -L/usr/local/cuda-10.1/lib64 -L/lib64
3rdparty dependencies:
OpenCV modules: To be built: aruco bgsegm bioinspired calib3d ccalib cnn_3dobj core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dpm face features2d flann freetype fuzzy gapi hdf hfs highgui img_hash imgcodecs imgproc line_descriptor ml objdetect optflow phase_unwrapping photo plot quality reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab viz xfeatures2d ximgproc xobjdetect xphoto Disabled: world Disabled by dependency: - Unavailable: cvv java js matlab ovis python2 python3 Applications: tests perf_tests examples apps Documentation: NO Non-free algorithms: YES
GUI: GTK+: YES (ver 2.24.32) GThread : YES (ver 2.58.3) GtkGlExt: NO VTK support: YES (ver 7.1.1)
Media I/O: ZLib: build (ver 1.2.11) JPEG: build-libjpeg-turbo (ver 2.0.2-62) WEBP: build (ver encoder: 0x020e) PNG: build (ver 1.6.36) TIFF: build (ver 42 - 4.0.10) JPEG 2000: build (ver 1.900.1) OpenEXR: build (ver 1.7.1) HDR: YES SUNRASTER: YES PXM: YES PFM: YES
Video I/O: DC1394: NO FFMPEG: YES avcodec: YES (58.18.100) avformat: YES (58.12.100) avutil: YES (56.14.100) swscale: YES (5.1.100) avresample: YES (4.0.0) GStreamer: YES (1.14.4) v4l/v4l2: YES (linux/videodev2.h) gPhoto2: YES
Parallel framework: pthreads
Trace: YES (with Intel ITT)
Other third-party libraries: Intel IPP: 2019.0.0 Gold [2019.0.0] at: /home/ross/OpenCV/opencv/build/3rdparty/ippicv/ippicv_lnx/icv Intel IPP IW: sources (2019.0.0) at: /home/ross/OpenCV/opencv/build/3rdparty/ippicv/ippicv_lnx/iw Lapack: YES (/lib64/libopenblas.so) Eigen: YES (ver 3.3.7) Custom HAL: NO Protobuf: build (3.5.1)
NVIDIA CUDA: YES (ver 10.1, CUFFT CUBLAS NVCUVID) NVIDIA GPU arch: 30 35 37 50 52 60 61 70 75 NVIDIA PTX archs:
OpenCL: YES (no extra features) Include path: /home/ross/OpenCV/opencv/3rdparty/include/opencl/1.2 Link libraries: Dynamic load
Python (for build): /usr/bin/python2.7
Java:
ant: NO
JNI: NO
Java wrappers: NO
Java tests: NO
Install to: /usr/local
Configuring done Generating done
Here are the gtk packages I have installed:
[ross@nyx rossTest2]$ dnf list installed | grep -i gtk
PackageKit-gtk3-module.x86_64 1.1.12-2.fc29 @updates
adwaita-gtk2-theme.x86_64 3.28-2.fc29 @anaconda
clutter-gtk.x86_64 1.8.4-4.fc29 @anaconda
clutter-gtk-devel.x86_64 1.8.4-4.fc29 @fedora
colord-gtk.x86_64 0.1.26-9.fc29 @anaconda
gstreamer1-plugins-good-gtk.x86_64 1.14.4-2.fc29 @updates
gtk+.x86_64 1:1.2.10-89.fc29 @fedora
gtk+-devel.x86_64 1:1.2.10-89.fc29 @fedora
gtk-doc.x86_64 1.29-1.fc29 @fedora
gtk-update-icon-cache.x86_64 3.24.1-3.fc29 @updates
gtk-vnc2.x86_64 0.9.0-2.fc29 @anaconda
gtk2.x86_64 2.24.32-4.fc29 @updates
gtk2-devel.x86_64 2.24.32-4.fc29 @updates
gtk3.x86_64 3.24.1-3.fc29 @updates
gtk3-devel.x86_64 3.24.1-3.fc29 @updates
gtk3-devel-docs.x86_64 3.24.1-3.fc29 @updates
gtkmm24.x86_64 2.24.5-6.fc29 @fedora
gtkmm30.x86_64 3.22.2-3.fc29 @anaconda
gtksourceview3.x86_64 3.24.9-4.fc29 @anaconda
gtkspell.x86_64 2.0.16-17.fc29 @fedora
gtkspell3.x86_64 3.0.10-1.fc29 @anaconda
ibus-gtk2.x86_64 1.5.19-16.fc29 @updates
ibus-gtk3.x86_64 1.5.19-16.fc29 @updates
libappindicator-gtk3.x86_64 12.10.0-20.fc29 @fedora
libcanberra-gtk2.x86_64 0.30-17.fc29 @anaconda
libcanberra-gtk3.x86_64 0.30-17.fc29 @anaconda
libchamplain-gtk.x86_64 0.12.16-4.fc29 @anaconda
libdbusmenu-gtk3.x86_64 16.04.0-8.fc29 @fedora
libindicator-gtk3.x86_64 12.10.1-13.fc29 @fedora
libpeas-gtk.x86_64 1.22.0-9.fc29 @anaconda
libreoffice-gtk2.x86_64 1:6.1.5.2-5.fc29 @updates
libreoffice-gtk3.x86_64 1:6.1.5.2-5.fc29 @updates
libreport-gtk.x86_64 2.10.0-2.fc29 @updates
pinentry-gtk.x86_64 1.1.0-4.fc29 @koji-override-0
pygtk2.x86_64 2.24.0-23.fc29 @fedora
qemu-ui-gtk.x86_64 2:3.0.1-3.fc29 @updates
spice-gtk3.x86_64 0.35-3.fc29 @anaconda
webkit2gtk3.x86_64 2.24.2-1.fc29 @updates
webkit2gtk3-devel.x86_64 2.24.2-1.fc29 @updates
webkit2gtk3-jsc.x86_64 2.24.2-1.fc29 @updates
webkit2gtk3-jsc-devel.x86_64 2.24.2-1.fc29 @updates
webkit2gtk3-plugin-process-gtk2.x86_64 2.24.2-1.fc29 @updates
wxGTK3.x86_64 3.0.4-4.fc29 @fedora
wxGTK3-gl.x86_64 3.0.4-4.fc29 @fedora
wxGTK3-i18n.noarch 3.0.4-4.fc29 @fedora
wxGTK3-media.x86_64 3.0.4-4.fc29 @fedora
xdg-desktop-portal-gtk.x86_64 1.2.0-1.fc29 @updates
xdg-user-dirs-gtk.x86_64 0.10-14.fc29 @anaconda