-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile error about google:protobuf #19
Comments
caffe needs both the google logging and google protocol buffer libraries. Please follow the link to compile and libprotobuf and then compile caffe. |
Dear Shelhamer, |
This seems to be a linking error so make sure you don't have multiple (especially old) protobuf .so libraries in your library paths. Both protobuf 2.4 and 2.5 should work, I believe. |
IIRC this linking error occurs with protobuf 2.5. I recommend using 2.4 if Ross On Wed, Dec 25, 2013 at 9:43 PM, Yangqing Jia notifications@github.comwrote:
|
Compiling successfully! Thanks a lot, guys! |
Sorry to open this again, I have tried the above solution with no success. build/lib/libcaffe.a(net.o): In function Thank you. |
If you want to remove the old version of the Protobuf, then you can input that sudo apt-get autoremove libprotobuf-dev, then compile the caffe aggain! Of Course, you need install the the Protobuf matually, for me, I installed it by source code(https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz). Reference: This seems to be a linking error so make sure you don't have multiple (especially old) protobuf .so libraries in your library paths. Both protobuf 2.4 and 2.5 should work, I believe. |
Hi, I'm having issue with google:protobuf and I'm unable to build caffe. I tried with protobuf 3.0, 2.5 and 2.4. For all the cases I'm getting the same error. Looks like its not able to access the google folder in protobuf-*/include. I have also included both the bin and include from protobuf in LD_LIBRARY_PATH and PATH. Please find the attached error. Any pointers would be highly helpful. Thanks, P:S; Looks like its just spitting out build/src/caffe/proto/caffe_pretty_print.pb.o.warnings.txt file. In file included from .build_release/src/caffe/proto/caffe_pretty_print.pb.cc:4: |
I worked on Ubuntu, I had faced this problem when I start using Caffe, my suggestion: sudo apt-get install libprotobuf-dev If this code still not help you remove the error, I think you need delete the libs related with protobuf in your computer, and input the above command again. Ubuntu12.04 has version problem, that's say maybe you need install manually the higher version of protobuf, but in Ubuntu14.04, no this problem. If you can't fixed the error by following the above steps, please provide more info(what type of OS are you used,.. and so on) then we can help you! Here is the installation help page: http://caffe.berkeleyvision.org/installation.html |
Thanks for prompt response. Unfortunately I do not have root permissions and I'm using scientific linux (Red Hat 4.4.7-3). I have installed all the prerequisites etc following the installation. |
Oh, I had tried compiling Caffe on CentOS6.5, but I found it very not convenient to install the dependency libraries, so at last I translate to Ubuntu, then everything became fine(Of course, I also meet much trouble, but better than in CentOS). So I think you need clear the installed protobuf first in your computer, and then installed the newer version, maybe this will help... |
I did try cleaning up the existing version of protobuf and re-installing newer/older version and nothing seems to be working. |
According to your feedback, I think the libraries should not be remove, at that time, I also faced the phenomenon, after I cd into the /usr/local/lib and /usr/lib to delete the libs, then re-install, the problem solved, this require you had the root or root passwd. The second possible reson is that, becasue you lack the root privilege, so the libs not be inserted into the /usr/local/lib or /usr/lib, so make caffe can't found protobuf, so it gave you the error. |
Hmm.. As I dont have root permissions I added protoc in the PATH variable and other lib and include files to LD_LIBRARY_PATH. So, I guess that shouldnt be an issue |
my experience: the server version of protobuf is 2.3, which makes "make runtest" give some error, since i don't have root access, so i can only install protobuf2.6 under my $HOME, but when i do "make all", it gives some error like " ... is produced by an older version of protobuf ...", which is due to the messed up of two versions (the default 2.3 and my customized 2.6 under my $HOME), finally i found the solution is in my .bash_profile, i have to add the $HOME/bin and $HOME/lib into $PATH, $LD_LIBRARY_PATH, very important thing to make sure that caffe is using 2.6 instead of 2.3, $HOME/bin and $HOME/lib should be put in front of $PATH, $LD_LIBRARY_PATH like this: export PATH=$HOME/bin:$PATH to check i typed : protoc --version , it returns 2.6, "pkg-config --cflags --libs protobuf" also gives correct info, then i could pass all the compilation steps. |
I had the same problem. It seems that you have different version of google protobuf. I had remove the default installation: sudo apt-get remove --purge libprotobuf-dev |
Hi guys, Make sure you don't have already install protobuf and other similar name files After these steps you are sure that there is no already protobuf in your machine. you can do some of steps e.g. autoremove to make sure. make sure you've tried installing: sudo apt-get install libprotobuf-dev protobuf-compiler |
I had the same problem and the instructions by @ghost would surely work for anyone on Debian/Ubuntu. I had CentOS but installing 2.6.1 version of protobuf worked for me. The easiest way to debug and fix the problem that I found is looking at the source of the header file named in the first line of the error. It had the exact version of protobuf mentioned in it which was required to be present for successful compilation. Hope this helps someone! :) |
I was having the problems above on OSX10.10 because I installed protbuf, boost, etc in /opt
export PATH="/opt/protobuf/bin:$PATH"
The fix, easy in retrospect, is at the end of cafee-master/Makefile.config look for the following If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependenciesINCLUDE_DIRS += $(shell brew --prefix)/includeadd things like this INCLUDE_DIRS += /opt/protobuf/include
LIBRARY_DIRS += /opt/gflags/lib Shell experts can no doubt do these steps in a more clever way.. |
update from upstream
I execute the command "make all" under $CAFFE_HOME, but I met following errors. protoc --version root@jenifferwu-System-Product-Name:~/code/caffe# make all |
I got a very similar error. This is my error: |
This answer needs some update, since the latest release is protobuf-3.0.0, after making sure you removed all protobuf related old files, $ tar zxvf protobuf-3.0.0.tar.gz Also, change your makefile.config according to the official guide
find . -type f -exec sed -i -e 's^"hdf5.h"^"hdf5/serial/hdf5.h"^g' -e 's^"hdf5_hl.h"^"hdf5/serial/hdf5_hl.h"^g' '{}' ; cd /usr/lib/x86_64-linux-gnu sudo ln -s libhdf5_serial.so.8.0.2 libhdf5.so sudo ln -s libhdf5_serial_hl.so.8.0.2 libhdf5_hl.so The above commands are no longer needed on Ubuntu 16.04 after a certain system update. |
apt-get installs a version for libprotobuf-dev [For example 2.6.1] and pip installs the latest [For example 3.3.0] which creates the conflict. Solved this by installing 2.6.1 via pip as well |
Hi, guys, I have meet the similar issue, My protobuf version is 2.6.1 AS follows: .build_release/src/caffe/proto/caffe.pb.h:22391:1: warning: control reaches end of non-void function [-Wreturn-type] Please Help! thank u guys! |
i have compiled caffe on Ubuntu 16.04 LTS both with python 2 and python, it is really a hectic process for beginners, for caffe with python 2.7 make sure that your /.local/lib/python2.7/site-packages only contains a version same as you protoc version. protoc version can be checked by entering
or another protobuf such as 3.5 version of protobuf. hope everything works OK for you. |
Dear fellow, I have got the following error while compiling all, I have installed the google logging library, can anyone help me with this ? Many thanks !
libcaffe.a(caffe.pb.o): In function
caffe::LayerParameter::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': caffe.pb.cc:(.text+0xbe2d): undefined reference to
google::protobuf::io::CodedInputStream::BytesUntilLimit() const'caffe.pb.cc:(.text+0xbef5): undefined reference to
google::protobuf::io::CodedInputStream::BytesUntilLimit() const' libcaffe.a(caffe.pb.o):caffe.pb.cc:(.text+0xdefd): more undefined references to
google::protobuf::io::CodedInputStream::BytesUntilLimit() const' followlibcaffe.a(io.o): In function
caffe::ReadProtoFromBinaryFile(char const*, google::protobuf::Message*)': io.cpp:(.text+0xb6d): undefined reference to
google::protobuf::io::CodedInputStream::default_recursion_limit_'io.cpp:(.text+0xbb4): undefined reference to `google::protobuf::io::CodedInputStream::~CodedInputStream()'
collect2: ld returned 1 exit status
make: *** [examples/finetune_net.bin] Error 1
The text was updated successfully, but these errors were encountered: