The following command install all the required tools and libraries to build and install the Apache Thrift compiler on a CentOS5/RHEL5 Linux based system. These packages are available in the “base” repository.
sudo yum install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel zlib-devel python-devel ruby-devel
For more information on the requirements see: Apache Thrift Requirements
For more information on building and installing Thrift see: Building from source