Download thrift Dependencies
Yum-y install automake libtool flex bison pkgconfig gcc-C ++ boost-devel libevent-devel zlib-devel Python-devel ruby-devel crypto-utils
OpenSSL-devel
Download the latest thrift, URL: http://thrift.apache.org
Tar-zxvf thrift-0.8.0.tar.gz
Move to the default installation directory
CP-r thrift-0.2.0/usr/local/(default installation directory? Otherwise, the generated thrift binfile may be generated but cannot be found. If it is installed here, the generated thrift will be in/usr/local/bin, at this time, the terminal enters thrift, otherwise the command not found. of course/usr/local/bin should have been set in $ PATH)
CD/usr/local/thrift-0.2.0
. /Bootstrap. sh (You have to add the contents '. /aclocal/libtool. m4 'to 'aclocal. m4 '. glibtoolize: You should add the contents '. /aclocal/ltoptions. m4 'to 'aclocal. m4 '. glibtoolize... about libtoolize, no matter, continue with the following command)
./Configure -- With-boost =/usr/include/Because boost is installed in/usr/include?
Very important: there may be an error about libtool version mismatch error. this is libtool 2.2.4, but the libtool: definition of this lt_init comes from libtool 2.2.6. libtool: You shoshould recreate aclocal. m4 with macros from libtool 2.2.4 libtool: And run Autoconf again.
This is caused by inconsistent libtool versions. If you enter libtool -- version on the terminal, we can see that our version is libtool 2.2.4 (in/usr/bin ). However, the libtool in/usr/local/thrift-0.2.0 is 2.2.6, so the libtool of/usr/bin is copied to/usr/local/thrift-0.2.0 to overwrite the original version. Run the./configure -- With-boost =/usr/include/command above. OK ~~
Make
Make install
Input Thrift on the terminal, which has the following stuff: OK, install thrift success.
The thrift binfile is in/usr/local/bin.
Usage: thrift [Options] File
Options:
-Version print the compiler version
-O dir set the output directory for gen-* packages
(Default: Current Directory)
-I dir Add a directory to the list of directories
Searched for include directives
-Nowarn suppress all compiler warnings (BAD !)