Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libtool error building thrift 0.9.1 on Ubuntu 13.04

Building thrift 0.9.1 (support C, C++, java, C#, perl, python) on Ubuntu 13.04 I am getting this error.

./configure run without any options, make run without any options...

Making all in test
make[2]: Entering directory `/home/dvb/sw/thrift-0.9.1/test'
Making all in nodejs
make[3]: Entering directory `/home/dvb/sw/thrift-0.9.1/test/nodejs'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/dvb/sw/thrift-0.9.1/test/nodejs'
Making all in cpp
make[3]: Entering directory `/home/dvb/sw/thrift-0.9.1/test/cpp'
Makefile:832: warning: overriding commands for target `gen-cpp/ThriftTest.cpp'
Makefile:829: warning: ignoring old commands for target `gen-cpp/ThriftTest.cpp'
/bin/bash ../../libtool --tag=CXX   --mode=link g++ -Wall -g -O2 -L/usr/lib   -o libtestgencpp.la  ThriftTest_constants.lo ThriftTest_types.lo ../../lib/cpp/libthrift.la -lssl -lcrypto -lrt -lpthread 
libtool: link: ar cru .libs/libtestgencpp.a .libs/ThriftTest_constants.o .libs/ThriftTest_types.o 
ar: .libs/ThriftTest_constants.o: No such file or directory
make[3]: *** [libtestgencpp.la] Error 1
make[3]: Leaving directory `/home/dvb/sw/thrift-0.9.1/test/cpp'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/dvb/sw/thrift-0.9.1/test'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/dvb/sw/thrift-0.9.1'
make: *** [all] Error 2
dvb@dvb-u13:~/sw/thrift-0.9.1$ 
like image 436
David V Avatar asked Sep 05 '13 18:09

David V


3 Answers

While this seems to be a defect in the 0.9.1 release tarball, it is not a problem in the top of tree pulled via git as of this afternoon.

The solution if one encounters this problem is to use a newer version of thrift by getting the source tree directly via git instead of downloading the tarball. The only difference in build is you will need to run bootstrap.sh before configure. This is well documented.

Note two additional helpful bits of data: 1. Configure to build --without-tests (Mike Johnson below - thanks) 2. This issue is fixed in 0.9.2 release (Luke below- thanks!)

like image 155
David V Avatar answered Sep 17 '22 16:09

David V


I ran into this problem tonight and "fixed" it. The problem is that ar(1) can't find the .o files in the directory test/cpp/.libs. I'm sure that there's some missing magic in the Makefile.am in test/cpp, but I've neither the patience or automake-fu to fix that.

Instead, I just symlinked the .o files from test/cpp to test/cpp/.libs/. That fixes the build of the C++ tests.

cd thrift-0.9.1/test/cpp/.libs
for i in ../*.o; do echo $i; ln -s $i .; done
like image 26
Scott Wimer Avatar answered Sep 20 '22 16:09

Scott Wimer


Thrift was since released with this compile problem. You can choose to skip compiling tests, instead:

./configure --without-tests
like image 38
Mike Johnson Avatar answered Sep 19 '22 16:09

Mike Johnson