2012-10-18 142 views
0

我試圖安裝opencv與cuda = on在Ubuntu 12.04上。我用cmake Opencv做了所有我想要的設置,沒有任何問題,我的Cuda工具箱運行平穩。但是,當我來到Opencv機器的步驟已經給出了錯誤。儘管make我有錯誤Opencv構建錯誤

Linking CXX executable ../../bin/opencv_perf_core

我guake終端視圖低於

[email protected]:~/Source/OpenCV-2.4.2/release$ make 
[ 4%] Built target opencv_core 
[ 5%] Built target opencv_ts 
[ 11%] Built target opencv_imgproc 
[ 14%] Built target opencv_highgui 
Linking CXX executable ../../bin/opencv_perf_core 
../../lib/libopencv_core.so.2.4.2: error: undefined reference to 'cuDeviceGetAttribute' 
collect2: ld returned 1 exit status 
make[2]: *** [bin/opencv_perf_core] Error 1 
make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2 
make: *** [all] Error 2 
[email protected]:~/Source/OpenCV-2.4.2/release$ 

我卡在這裏,我不能把它關閉你有什麼建議嗎?

+0

有你檢查了[這個問題](http://stackoverflow.com/questions/10402245/problems-linking-to-libcuda-so)? – remi

+0

我查過了。爲什麼你認爲你鏈接的問題與我的相關。 –

+0

,因爲您的錯誤是對cuda庫的未定義引用。 make VERBOSE = 1的輸出是什麼?使用pastebin或ideone.com並放置鏈接 – remi

回答

0

我也遇到過這個問題。這是我的嘗試。

  1. 將libcuda鏈接到/ usr/lib取決於您使用的驅動程序。這個版本使用了nvidia-電流更新

    蘇-c「LN -s /usr/lib/nvidia-current-updates/libcuda.so /usr/lib/libcuda.so & & LN -s/usr/lib目錄/nvidia-current-updates/libcuda.so.1 /usr/lib/libcuda.so.1'

  2. 運行 'cmake的' 再次

  3. 然後繼續 '使'