1. Overview
Thrift is a software framework for the development of extensible, cross-language services. It combines powerful software stacks and code production engines to build in C + +, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C #, Cocoa, JavaScript, node. js, Smalltalk, and OCaml the seamless and efficient service between these programming languages.
2. Install 2.1 Install boost
Note: First download the boost package from the official website and unzip it, then go to the directory.
./bootstrap. sh -prefix=path_to_boost sudo ./b2 threading=multi address-model= Install
2.2 Installing Libevent
Note: First to the official website download Libevent package, and unzip, and then go into the directory (directory path:/usr/local).
./configure-prefix=/usr/Local make sudomakeinstall
2.3 Installing Thrift
Get Thrift-0.9.1.zip from GitHub (some official bugs, please use the Community version of the Open source community) ""
The steps are as follows:
1. Run in the Thrift Directory (directory path:/usr/local) after decompression./bootstrap.sh
2. Implementation of export cxxflags= "-std=c++11"
3./configure--prefix=/usr/local/thrift-0.9.1--with-boost=path_to_boost--with-libevent=/usr/local-- Without-ruby--without-haskell--without-erlang--without-python--without-perl (parameters are set as required)
4. Make cxxflags=-stdlib=libstdc++
5. Sudo make install
3. Environment variables
Configuring environment Variables for thrift
thrift_home=/usr/local/thrift-0.9. 1 PATH= $JAVA _home/bin: $PATH: $THRIFT _home/binexport java_home CLASSPATH PATH thrift_home
4. Verification
Thrift--0.9. 1
Displays the thrift version number, indicating that the thrift environment was built successfully.
Build thrift environment under MAC OS X