Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google protobuf in Linux

I'm working with protobuf and Linux. Where is its compiler protoc? I've downloaded the package from the main site, compiled and installed it successfully but I can't find protoc to build my own format file. Where is it?

UPDATE Here is folder where I built protobuf:

aclocal.m4        depcomp                       Makefile.in
autogen.sh        editors                       missing
CHANGES.txt       examples                      protobuf-lite.pc
config.guess      generate_descriptor_proto.sh  protobuf-lite.pc.in
config.h          gtest                         protobuf.pc
config.h.in       install-sh                    protobuf.pc.in
config.log        INSTALL.txt                   python
config.status     java                          README.txt
config.sub        libtool                       src
configure         ltmain.sh                     stamp-h1
configure.ac      m4                            vsprojects
CONTRIBUTORS.txt  Makefile
COPYING.txt       Makefile.am

There isn't a binary file I need.

like image 374
Max Frai Avatar asked Mar 16 '10 17:03

Max Frai


3 Answers

It's probably installed into /usr/local/bin

On Ubuntu at least, you can apt-get install protobuf-compiler instead.

From the INSTALL.txt:

Installation Names

By default, 'make install' will install the package's files in '/usr/local/bin', '/usr/local/man', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PATH'.

like image 143
daveb Avatar answered Oct 19 '22 04:10

daveb


Also, if you are in fact on Ubuntu, then you can also fetch the source package from Debian unstable and rebuild them locally if you want packages that are more current than the last cutoff (which for Ubuntu 9.10 was some time late last summer). That way you end up with .deb packages and you preserve a normal upgrade path (rather than littering /usr/local with one-off installs).

like image 35
Dirk Eddelbuettel Avatar answered Oct 19 '22 04:10

Dirk Eddelbuettel


First, you need to compile you source code from protobuff (in the root folder):

./configure  
make   
make check   
make install

Second:

echo "/usr/local/lib">>/etc/ld.so.conf  
echo "/usr/lib">>/etc/ld.so.conf    
ldconfig

Third:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH

Read README.txt in root folder for more info.

like image 25
MYLOGOS Avatar answered Oct 19 '22 03:10

MYLOGOS