ubuntu14.04 安装配置 opencv 2.4.9 各种坑总结

一、下载编译的坑

1: 

Unsupported gpu architecture 'compute_11'

ubuntu14.04 安装配置 opencv 2.4.9 各种坑总结_第1张图片


solve:   采用下面方法make 


  1. cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CUDA_GENERATION=Kepler -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON   
  2. -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=OFF -D WITH_OPENGL=ON -D BUILD_TIFF=ON ..  

2:NCVPixelOperations.hpp(51): error: a storage class is not allowed in an explicit specialization

solve:  

 下载 NCVPixelOperations.hpp(自行 google 下载), 替换掉opencv2.4.9内的文件  (替换路径在这里)


 opencv 文件夹:

  • modules
    • gpu
      • src
        • nvidia
          • core
            • NCVPixelOperations.hpp (diff)

3:ubuntu装opencv error: ‘NppiGraphcutState‘ has not been declared

solve: 

进入opencv-3.1.0/modules/cudalegacy/src/目录,修改graphcuts.cpp文件,将:

   #include "precomp.hpp"

 #if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)

改为

    #include "precomp.hpp"

  #if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) || (CUDART_VERSION >= 8000)

然后make编译就可以了


4:配置的坑

进入OpenCV目录/samples/c/ 运行./build_all.sh   出先下面错误:

/usr/bin/ld: cannot find -lcufft

/usr/bin/ld: cannot find -lnpps

/usr/bin/ld: cannot find -lnppi

/usr/bin/ld: cannot find -lnppc

/usr/bin/ld: cannot find -lcudart


solve:

libcufft,libnpps,libnppi,libnppc,libcudart是cuda的库,分别对上面几个文件建立软连接 

sudo ln -s /usr/local/cuda-7.0/lib64/libcufft.so.7.0  /usr/local/lib/libcufft.so  


然后测试成功!





你可能感兴趣的:(Linux)