Skip to content

Build fbthrift on Ubuntu

vkill edited this page Dec 3, 2023 · 11 revisions

Build fbthrift on Ubuntu 22.04

Test on v2023.11.27.00

#!/usr/bin/env bash

<<'COMMENT'
sudo apt update
sudo apt upgrade -y
sudo apt --purge autoremove -y

sudo apt install -y git

# 1 GB RAM + 4 GB Swap space required
COMMENT

set -ex

### init

sudo apt install -y cmake
sudo apt install -y build-essential


### fmt

cd ~
git clone https://github.com/fmtlib/fmt.git && cd fmt
mkdir _build && cd _build
cmake ..
make -j$(nproc)
sudo make install
cd


### folly

sudo apt install -y libboost-all-dev
sudo apt install -y libssl-dev
sudo apt install -y libdouble-conversion-dev
sudo apt install -y libgoogle-glog-dev


cd ~
git clone https://github.com/facebook/folly.git && cd folly
mkdir _build && cd _build
cmake ..
make -j $(nproc)
sudo make install
cd


### fizz

sudo apt install -y libsodium-dev
sudo apt install -y libgmock-dev
sudo apt install -y libzstd-dev

cd ~
git clone https://github.com/facebookincubator/fizz && cd fizz/fizz
mkdir _build && cd _build
cmake ..
make -j $(nproc)
sudo make install
cd


### wangle

cd ~
git clone https://github.com/facebook/wangle.git && cd wangle/wangle
mkdir _build && cd _build
cmake ..
make -j $(nproc)
sudo make install
cd


### mvfst

cd ~
git clone https://github.com/facebook/mvfst.git && cd mvfst
sed -i 's/^setup_folly/# setup_folly/' build_helper.sh
sed -i 's/^setup_folly/# setup_fizz/' build_helper.sh
sudo ./build_helper.sh -i /usr/local
cd


### fbthrift

sudo apt install -y libbison-dev
sudo apt install -y libfl-dev

cd ~
git clone https://github.com/facebook/fbthrift && cd fbthrift
git checkout v2023.11.27.00
mkdir _build && cd _build
cmake ..
make -j $(nproc)
sudo make install
cd

which thrift1





### fbthrift

cd ~
git clone https://github.com/facebook/fbthrift && cd fbthrift
git checkout v2023.11.27.00

./build/fbcode_builder/getdeps.py install-system-deps --recursive fbthrift

sudo apt install -y build-essential
sudo apt install -y libssl-dev

./build/fbcode_builder/getdeps.py --allow-system-packages build fbthrift
Clone this wiki locally