Forum: Building VoltDB Applications

Post: client_cpp_master makefile error

client_cpp_master makefile error
junxiu
May 14, 2015
voltdb-client-cpp-x86_64-4.0 makefile error: line 14
client_cpp_master makefile error
junxiu
May 14, 2015
SYSTEM_LIBS := -lc -lpthread -lrt -lboost_system -lboost_thread-mt
seems should be:
SYSTEM_LIBS := -lc -lpthread -lrt -lboost_system-mt -lboost_thread-mt
nshi
May 14, 2015
Hi Junxiu,

I'm glad that you figured it out. The problem is platform dependent. The Boost library is compiled differently on each Linux distribution. Some uses the -mt naming for libraries, some don't.
junxiu
May 15, 2015
Hi Ning,

I use ubuntu, do you mean the makefile is for red hat?

I followed your README file step by step. Here is the steps from the README file:

If your platform's package manager does not provide the required version of boost you can build it from source
using these commands:

wget http://sourceforge.net/projects/boost/files/boost/1.56.0/boost_1_56_0.tar.gz/download
tar -C /usr/local -xf boost_x_y_z.tar.gz
cd /usr/local/boost_x_y_z
./bootstrap.sh --prefix=/usr/local
./b2 --layout=tagged install
ln -s /usr/local/boost_x_y_z /usr/local/boost


Building the client

Running `make` produces the CPP client tarball that is available
for download on the voltdb.com website. A static library (libvoltdbcpp.a)
is written at the working tree root. A shared library (libvoltdbcpp.so)
is written at the working tree root.



The relative steps in makefile are:


PLATFORM = $(shell uname)
ifeq ($(PLATFORM),Darwin)
THIRD_PARTY_DIR := third_party_libs/osx
SYSTEM_LIBS := -lc -lpthread -lboost_system-mt -lboost_thread-mt
endif
ifeq ($(PLATFORM),Linux)
THIRD_PARTY_DIR := third_party_libs/linux
SYSTEM_LIBS := -lc -lpthread -lrt -lboost_system -lboost_thread-mt
CFLAGS += -fPIC
endif


For the linux part, -lboost_system and -lboost_thread-mt, one has -mt and another does not. Is this right for red hat?
For the Darwin, both have -mt.

Thanks.
nshi
May 19, 2015
Hi Junxiu,

Since version 1.40.0, Boost changed their build system to use platform dependent naming scheme for the libraries. It defaults to not include the -mt suffix for libraries on Linux. You can see the changes in the build script here.

So depend on the system and the version of Boost you have, you may or may not have -mt in the library name.