16

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$ 
2
  • 6
    when configured without c++ support (./configure -with-cpp=no) make runs to completion successfully. This seems to be a path problem with respect to libtool; ThriftTest_constants.o is present.
    – David V
    Sep 5, 2013 at 19:14
  • 1
    Same problem on Ubuntu 13.10. Solved by removing c++ support as stated above. Oct 31, 2013 at 18:43

6 Answers 6

13

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!)

3
  • where is this well documented? because at the moment i cant find anything about what to do with thrift after downloading the tar.gz, i got to configure and make then i have the same problem as you, but i run bootstrap first and it changes nothing
    – AngryDuck
    Oct 4, 2013 at 15:11
  • git clone git-wip-us.apache.org/repos/asf/thrift.git thrift; cd thrift. Then run bootstrap and configure as you did on the tarball
    – David V
    Oct 4, 2013 at 20:44
  • thx for the tip. If you're using the tar file directly, get the sources from git, then run ./bootstrap.sh. Finally, just compress the thrift folder, it's working Oct 28, 2013 at 10:43
9

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
6

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

./configure --without-tests
3

You can also try this:

./configure 
(cd test/cpp; ln -s . .libs)
make install

This will simply link .libs back to test/cpp. "ar" will find the files there.

1

David V is right that 0.9.1 is broken but 0.9.2 works. The build instructions seem to be a broken link as well. So here are the commands that worked for me, from a fresh Ubuntu install:

# Install java if you don't have it
sudo apt-get install default-jre
# install build dependencies
sudo apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libboost-system-dev libboost-filesystem-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev 
cd /tmp 
curl http://archive.apache.org/dist/thrift/0.9.2/thrift-0.9.2.tar.gz | tar zx 
cd thrift-0.9.2/ 
./configure 
make 
sudo make install 
#test that it can run
thrift --help 

(credit goes to these helpful instructions; I just replaced 0.9.1 with 0.9.2)

-1

I happened to face this problem. You can try cp all test/cpp/*.o to .libs folder.

Or you can skip compiling tests.

cp test/cpp/*.o test/cpp/.libs/
1
  • I think it would be more helpful for the OP and further visitors, when you add some explaination to your intension.
    – Reporter
    Sep 3, 2014 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.