无法在Fedora 19上使用CUDA 5.5编译OpenCV 2.4.6

时间:2013-08-01 07:12:53

标签: opencv build

OpenCV 2.4.6增加了对CUDA 5.5的支持,但尝试构建它失败了。从Fedora 18的存储库安装CUDA.OpenCV本身没有CUDA的支持也很顺利。

[  1%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/gpumat.cpp.o
/home/lucky/programming/sphinx/build/3rdparty/opencv/opencv-2.4.6.1/modules/core/src/gpumat.cpp:288:52: error: 'bool cv::gpu::deviceSupports(cv::gpu::FeatureSet)' should have been declared inside 'cv::gpu'
 bool cv::gpu::deviceSupports(FeatureSet feature_set)
                                                    ^
/home/lucky/programming/sphinx/build/3rdparty/opencv/opencv-2.4.6.1/modules/core/src/gpumat.cpp: In function 'bool cv::gpu::deviceSupports(cv::gpu::FeatureSet)':
/home/lucky/programming/sphinx/build/3rdparty/opencv/opencv-2.4.6.1/modules/core/src/gpumat.cpp:288:6: warning: no previous declaration for 'bool cv::gpu::deviceSupports(cv::gpu::FeatureSet)' [-Wmissing-declarations]
 bool cv::gpu::deviceSupports(FeatureSet feature_set)
      ^
/home/lucky/programming/sphinx/build/3rdparty/opencv/opencv-2.4.6.1/modules/core/src/gpumat.cpp: At global scope:
/home/lucky/programming/sphinx/build/3rdparty/opencv/opencv-2.4.6.1/modules/core/src/gpumat.cpp:359:49: error: no 'size_t cv::gpu::DeviceInfo::sharedMemPerBlock() const' member function declared in class 'cv::gpu::DeviceInfo'
 size_t cv::gpu::DeviceInfo::sharedMemPerBlock() const
                                                 ^
/home/lucky/programming/sphinx/build/3rdparty/opencv/opencv-2.4.6.1/modules/core/src/gpumat.cpp: In function 'void cv::gpu::createContinuous(int, int, int, cv::gpu::GpuMat&)':
/home/lucky/programming/sphinx/build/3rdparty/opencv/opencv-2.4.6.1/modules/core/src/gpumat.cpp:794:6: error: redefinition of 'void cv::gpu::createContinuous(int, int, int, cv::gpu::GpuMat&)'
 void cv::gpu::createContinuous(int rows, int cols, int type, GpuMat& m)
      ^
In file included from /home/lucky/programming/sphinx/build/3rdparty/opencv/opencv-2.4.6.1/modules/core/src/gpumat.cpp:44:0:
/home/lucky/programming/sphinx/build/output/include/opencv2/core/gpumat.hpp:551:17: error: 'void cv::gpu::createContinuous(int, int, int, cv::gpu::GpuMat&)' previously defined here
     inline void createContinuous(int rows, int cols, int type, GpuMat& m)
                 ^
/home/lucky/programming/sphinx/build/3rdparty/opencv/opencv-2.4.6.1/modules/core/src/gpumat.cpp: In function 'void cv::gpu::ensureSizeIsEnough(int, int, int, cv::gpu::GpuMat&)':
/home/lucky/programming/sphinx/build/3rdparty/opencv/opencv-2.4.6.1/modules/core/src/gpumat.cpp:806:6: error: redefinition of 'void cv::gpu::ensureSizeIsEnough(int, int, int, cv::gpu::GpuMat&)'
 void cv::gpu::ensureSizeIsEnough(int rows, int cols, int type, GpuMat& m)
      ^
In file included from /home/lucky/programming/sphinx/build/3rdparty/opencv/opencv-2.4.6.1/modules/core/src/gpumat.cpp:44:0:
/home/lucky/programming/sphinx/build/output/include/opencv2/core/gpumat.hpp:559:17: error: 'void cv::gpu::ensureSizeIsEnough(int, int, int, cv::gpu::GpuMat&)' previously defined here
     inline void ensureSizeIsEnough(int rows, int cols, int type, GpuMat& m)
                 ^
/home/lucky/programming/sphinx/build/3rdparty/opencv/opencv-2.4.6.1/modules/core/src/gpumat.cpp: In function 'cv::gpu::GpuMat cv::gpu::allocMatFromBuf(int, int, int, cv::gpu::GpuMat&)':
/home/lucky/programming/sphinx/build/3rdparty/opencv/opencv-2.4.6.1/modules/core/src/gpumat.cpp:831:8: error: redefinition of 'cv::gpu::GpuMat cv::gpu::allocMatFromBuf(int, int, int, cv::gpu::GpuMat&)'
 GpuMat cv::gpu::allocMatFromBuf(int rows, int cols, int type, GpuMat &mat)
        ^
In file included from /home/lucky/programming/sphinx/build/3rdparty/opencv/opencv-2.4.6.1/modules/core/src/gpumat.cpp:44:0:
/home/lucky/programming/sphinx/build/output/include/opencv2/core/gpumat.hpp:567:19: error: 'cv::gpu::GpuMat cv::gpu::allocMatFromBuf(int, int, int, cv::gpu::GpuMat&)' previously defined here
     inline GpuMat allocMatFromBuf(int rows, int cols, int type, GpuMat &mat)
                   ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-unnamed-type-template-args" [enabled by default]
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/gpumat.cpp.o] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make: *** [all] Error 2

有没有办法解决这个问题?或者这是GCC新版本的问题?

1 个答案:

答案 0 :(得分:1)

似乎@ jet47选择不在评论中回复我的请求,所以我发布这个答案,以便我们可以回答这个问题(这显然已经在评论中了。)

如果您遇到类似问题,请确保您只安装了一个OpenCV版本。如果找到除预期版本之外的其他已安装版本,请将其删除。