BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.07k stars 18.7k forks source link

fatal error: google/protobuf/port_def.inc: No such file or directory compilation terminated. #6774

Open Hkathuria opened 5 years ago

Hkathuria commented 5 years ago

Important -

Issue summary

Gettingv error while building caffe running command make all

Error :

CXX .build_release/src/caffe/proto/caffe.pb.cc In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:0: .build_release/src/caffe/proto/caffe.pb.h:10:40: fatal error: google/protobuf/port_def.inc: No such file or directory compilation terminated. Makefile:589: recipe for target '.build_release/src/caffe/proto/caffe.pb.o' failed make: *** [.build_release/src/caffe/proto/caffe.pb.o] Error 1

Steps to reproduce

Following installation steps of below link https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-Installation-Guide

Tried solutions

Installed protobuff as in the below link:

https://askubuntu.com/questions/1072683/how-can-i-install-protoc-on-ubuntu-16-04

System configuration

400lbhacker commented 5 years ago

that protobuff install page has two installation methods, one was a manual compilation other was installed by:

sudo apt install protobuf-compiler

when I installed caffe on ubuntu and debian it was all done through sudo apt-get installs of dependencies never manual installation so it might make a huge difference

try sudo apt-get remove protobuf-compiler than reinstall via apt-get install

msapaydin commented 5 years ago

I have the same problem. @400lbhacker suggested solution did not work.

andreyhristov commented 5 years ago

See https://github.com/tensorflow/tensorflow/issues/27697

ayadav10491 commented 5 years ago

Same error.. Has someone found a solution yet?

andreyhristov commented 5 years ago

@ayadav10491 see #27697

RichardoTiono commented 5 years ago

@andreyhristov Hi, could help pinpoint which of the answer in #27697 has the solution? As a new Linux user the answer are too overwhelming to understand. So far all I understand is that they change the makefile on tensorflow but since our problem on caffe is it also applicable ? Thank you

suxb201 commented 5 years ago

@RichardoTiono @ayadav10491 @msapaydin Have you ever failed to use make before? You can try make clean.

make clean
make all -j 16

It worked when I met this problem.

RichardoTiono commented 5 years ago

@suxb201 I think the problem will still persist. Because when I check the target folder it really doesn't contain those file. The workaround that I used

  1. Find where those file is (in my case on anaconda3)
  2. Insert those path to makefile.config and now it compiles but gave other error such as segmentation fault which I haven't found solution yet
SKBai1996 commented 5 years ago

May be you try latest-version of protobuf(https://github.com/protocolbuffers/protobuf/releases),such as protobuf-2.9.1(it contains the port_def.inc). I met the same problem,and re-installed the latest protobuf(2.9.1 version) and removed the old one,re-complier,it worked.

Walstruzz commented 4 years ago

see protobuf issue 5868

It works for me. :)

SungYK commented 4 years ago

@Walstruzz Walstruzz Could you please tell me the Makefile.config file setting details? I have installed the protobuf in my system. And the protoc --version command is worked. But I can't find it in my /usr/lib directory. Thx in advance.

Walstruzz commented 4 years ago

@Walstruzz Walstruzz Could you please tell me the Makefile.config file setting details? I have installed the protobuf in my system. And the protoc --version command is worked. But I can't find it in my /usr/lib directory. Thx in advance.

@SungYK Sorry, I compile protobuf from source code. But I think which protoc and ldd $(which protoc) may help you.

SungYK commented 4 years ago

@Walstruzz Thank you, I try to compile it from source code, and set the path in Makefile.config. It works.

PaulZhangIsing commented 4 years ago

The problem is this: When I use protoc --version, it shows my system has version 3.7.1. However, my piped protobuf tells me it hasa version 2.6.1 What should I do in this case???

pengzhen80 commented 3 years ago

my solution: ~: find / -name grpc++.pc 2>/dev/null copy the result(without '/grpc++.pc') to the path bellow : export PKG_CONFIG_PATH="copy" :make if you cannot find openssl, then : sudo apt-get install libssl-dev

masa8 commented 2 years ago

F.Y.I. solution for me: sudo apt-get remove protobuf-compiler sudo apt-get install protobuf-compiler make clean make all -j8

doviettung96 commented 1 year ago

Hi guys, Yeah. I just tried and found out that you can solve that by installing it using apt-get sudo apt-get install libprotobuf-dev protobuf-compiler