Install Protobuf 2.5
Install protobufs from source. If you try to use a newer version, you'll run into an error related to kEmptyString
.
sudo apt-get install autoconf automake libtool curl make g++ unzip
wget https://github.com/google/protobuf/archive/v2.5.0.tar.gz
tar -zxvf v2.5.0.tar.gz
cd protobuf-2.5.0/
This is where the hacks start. protobuf depends on Google Mock, which has since been merged into Google Test. This evolution causes a few issues when getting protobuf 2.5 compiled and running make check
.
First, replace the 2.5.0 autogen.sh
with the current:
wget https://raw.githubusercontent.com/google/protobuf/bba446bbf2ac7b0b9923d4eb07d5acd0665a8cf0/autogen.sh
Next is to fix configure.ac
to point to the new Google Mock. Modify Line 147 to read:
AC_CONFIG_SUBDIRS([gmock])
and fix the make check
directive in Makefile.am
my modifying Lines 20-21 to read:
@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
@cd gmock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
@cd gmock/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
Now we're ready:
./autogen.sh
ln -s gmock/gtest gtest
./configure
make
make check
To support uninstall, we use checkinstall
, which will build .deb
and run make install
.
sudo apt-get install checkinstall
sudo checkinstall -y
sudo ldconfig
Install sdhash from source
wget https://github.com/sdhash/sdhash/archive/v4.0.tar.gz
tar -zxvf v4.0.tar.gz
cd sdhash-4.0
make
sudo checkinstall -y
To build and test python bindings:
sudo apt-get install swig libboost-dev
make swig-py
cd swig/python/
python test.py