For this lab, we will use Apache Thrift, which is a cross-platfrom, cross-language RPC library. For the homework task, you will use 2 different programming language to implement a client-server application. One of them will be C++ and you can choose the other one. The chosen language must support Binary and Multiplex protocols (see table https://thrift.apache.org/docs/Languages.html)
To use Thrift, we will need:
You may choose to install Thrift by:
Packages for the compiler and the C++ library may be available in your system repository. Packages for Java, Node.js, Python, and possible for other languages, are available in their respective package managers.
sudo apt install thrift-compiler
sudo apt install libthrift-dev
npm install -g thrift
pip install thrift
If building from source, you can choose which languages will be supported. Disable languages that you will not use to speed up the build and avoid build errors. Support for some languages may require installing additional packages on the system.
Download the source code from https://www.apache.org/dyn/closer.cgi?path=/thrift/0.18.1/thrift-0.18.1.tar.gz .
Unzip the source code:
tar -xf thrift-0.18.1.tar.gz cd thrift-0.18.1
Run a bootstrap script:
You may need to install additional packages on your system before building thrift, such as
Configure the build, including selection of supported languages.
See the help for available options.
--with-XXXflags to select supported languages.
--without-XXXflags to disable languages (to avoid errors and speed up the build).
Finally, build and install the library.
make sudo make install
On the computers in rotunda, thrift packages are not installed, so I recommend building from source for the compiler and for C++ support.
--prefix option of
configure to specify your directory where thrift will be installed, then run
make install without
This configuration has been tested (all languages except C++ are disabled).
./configure --disable-tests --without-qt5 --without-c_glib --without-java --without-erlang --without-nodejs --without-nodets \ --without-lua --without-python --without-py3 --without-perl --without-php --without-php_extension --without-dart \ --without-ruby --without-haskell --without-go --without-swift --without-rs --without-cl --without-haxe --without-netstd \ --without-d --prefix=$HOME/thrift
Then, build and install the library:
make make install
For Java, Node.js or Python, use the respective pacakge managers.
It is possible to enable more languages, but for some of them,
make install may fail.