Building hadoop by installing protoc 2.5.x [Google Protocol Buffers Compiler] on a Mac

Hadoop trunk 3.0 Snapshot build fails if compiled with a protoc newer than 2.5. For instance, if the protoc version is 2.6.1, you will see a build error as

[ERROR] Failed to execute goal 
(compile-protoc) on project hadoop-common: 
protoc version is 'libprotoc 2.6.1', 
expected version is '2.5.0' -> [Help 1]

To fix this, install protoc 2.5.x on your mac.


Building from source
  1. Download latest version of protocol buffer [].
    • wget
  2. Untar the tar.bz2 file
    • tar xfvj protobuf-2.5.0.tar.bz2
  3. Configure the protobuf.
    •  cd protobuf-2.5.0
    • ./configure CC=clang CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -O3 -g' LDFLAGS='-stdlib=libc++' LIBS="-lc++ -lc++abi"
    • You can use the --prefix parameter to install to a location other than the default "/usr/local/bin"
  4. Make the source
    • make -j 4
    • sudo make install
  5. If you already have protoc 2.6.1 installed, unlink it and link in the newly installed protoc 2.5.x

About vrushaliscorner

an engineer trying to find her way in silicon valley
This entry was posted in build errors, computer science, hadoop, maven, protobuf, protoc, Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s