Search code examples
staticthriftcentos6

Issue Statically Compiling Thrift 0.9.0 on Centos 6.5


I'm working to compile the Thrift 0.9.0 binary statically in a CentOS VM. I get the issue that the libthrift.a binary is not being created. I am using a vagrant box to run centos: https://github.com/2creatives/vagrant-centos/releases/download/v6.5.1/centos65-x86_64-20131205.box

Once I ssh to the vagrant box I run the following commands:

wget https://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
tar -zxvf thrift-0.9.0.tar.gz
cd thrift-0.9.0
./configure --enable-static
make

This will run but I ran a find command (sudo find / -name "*.a") on the system to see if there was any ".a" files made and the only file that was made was "libparse.a" which doesn't seem right. From my understanding it should be "libthrift.a".

Searching through the config.log file it says that it does want to build the static libraries:

configure:11944: checking whether to build static libraries
configure:11948: result: yes

Looking at more locations in the log file that has the keyword "static" reveals potential places that may be errors.

configure:9028: checking if gcc static flag -static works
configure:9056: result: no

configure:13915: checking if g++ static flag -static works
configure:13943: result: no

lt_cv_prog_compiler_static_works=no
lt_cv_prog_compiler_static_works_CXX=no

The full log file is here: http://www.filehosting.org/file/details/449460/staticThriftErrorLog.rtf

Any help is appreciated


Solution

  • I was able to generate the libthrift.a file. After running the command for the extra dependancies mentioned in my comment I forgot to run the make command. So after doing the make command I found the libthrift.a file in "thrift-0.9.0/lib/cpp/.libs/". Interestingly enough, even after fixing the dependencies, config.log still had the same potential problem areas regarding the gcc/g++ static flag and static compiler.

    Specifically the dependency command is as follows:

    sudo yum install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel zlib-devel python-devel ruby-devel openssl-devel.x86_64
    


    Edit: After getting advice on the Jira ticket, it turns out the specific vagrant box I was using was causing the errors. Using the VM he linked I was able to successfully build Thrift using the provided instructions. (Jira ticket https://issues.apache.org/jira/browse/THRIFT-2559)