Skip to content

Build fbthrift on Ubuntu

vkill edited this page Dec 4, 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
# Recommend 4 CPU Cores + 8 GB RAM, takes about 33 minutes
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
mkdir _build && cd _build
cmake ..
make -j $(nproc)
sudo make install
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
Clone this wiki locally