歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 16.10 下安裝Caffe遇到: “未定義引用” 問題

Ubuntu 16.10 下安裝Caffe遇到: “未定義引用” 問題

日期:2017/2/28 13:45:22   编辑:Linux教程

Ubuntu 16.10 下安裝Caffe遇到: “未定義引用” 問題

解決辦法:
Hi all,

Thanks for the thread. I just install 15.10 and this saved me from a lot of troubles.
With the latest version 15.10.1, only hacking CUDA is not enough. The error is because google-glog got built with -D_GLIBCXX_USE_CXX11_ABI=0 while everything else use the default option!
This is also the cause of the error that Locke Lee haveshown.

I have made a full guide, (feel free to correct my English :D)

///////////////////////////////////////////////////////
1. HACK CUDA
+As all other packages in ubuntu 15.10 is built with GCC 5(.2) but CUDA (7.5) not allow >4.9 gcc version!
+We would like to "hack" CUDA to compile cuda files with gcc-5 as follows:

a) sudo gedit /usr/local/cuda/include/host_config.h

b) change line 113 to #if __GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 2)

///////////////////////////////////////////////////////
2. FIX google-glog
+Some bad guys build google-glog with wrong gcc abi config! And the wrong build is in
the official repository. Fack!
+i.e when all other package is built with -D_GLIBCXX_USE_CXX11_ABI=1 (default). They built it with
-D_GLIBCXX_USE_CXX11_ABI=0! We need to built it ourself!

a)
sudo apt-get remove libgoogle-glog-dev libgoogle-glog0v5
cd ~ //other folder is ok
apt-get source libgoogle-glog-dev
cd google-glog-0.3.4
./configure

b) The generated makefile have some mistakes (?)
- change line 613 to ACLOCAL=aclocal-1.15
- change line 619 to AUTOMAKE=automake-1.15

c)
make // this will have some errors, dont worry
automake --add-missing
make -j 16 //or 100,whatever
sudo make install

//////////////////////////////////////////////////////////
Now we can build caffe! Profit!

2 **!!!!如果 遇到:::error: version mismatch. This is Automake 1.15.1,

解決辦法看這裡
http://askubuntu.com/questions/550824/intltool-automake-version-mismatch

Caffe 深度學習入門教程 http://www.linuxidc.com/Linux/2016-11/136774.htm

Ubuntu 16.04 安裝配置Caffe 圖文詳解 http://www.linuxidc.com/Linux/2016-12/138870.htm

Ubuntu 16.04下Matlab2014a+Anaconda2+OpenCV3.1+Caffe安裝 http://www.linuxidc.com/Linux/2016-07/132860.htm

Ubuntu 16.04系統下CUDA7.5配置Caffe教程 http://www.linuxidc.com/Linux/2016-07/132859.htm

Caffe在Ubuntu 14.04 64bit 下的安裝 http://www.linuxidc.com/Linux/2015-07/120449.htm

深度學習框架Caffe在Ubuntu下編譯安裝 http://www.linuxidc.com/Linux/2016-07/133225.htm

Caffe + Ubuntu 14.04 64bit + CUDA 6.5 配置說明 http://www.linuxidc.com/Linux/2015-04/116444.htm

Ubuntu 16.04上安裝Caffe http://www.linuxidc.com/Linux/2016-08/134585.htm

Caffe配置簡明教程 ( Ubuntu 14.04 / CUDA 7.5 / cuDNN 5.1 / OpenCV 3.1 ) http://www.linuxidc.com/Linux/2016-09/135016.htm

Ubuntu 16.04上安裝Caffe(CPU only) http://www.linuxidc.com/Linux/2016-09/135034.htm

Copyright © Linux教程網 All Rights Reserved