3FS在ubuntu22.04下的編譯(記錄下編譯過程,方便后續使用)
環境信息
- OS ubuntu 22.04
- 內核版本 6.8.0-52-generic
- libfuse 3.16.1
- rust 1.75.0
- FoundationDB 7.1.66
- meson 1.0.0
- ninja 1.10.1
libfuse編譯
以下建議均在root下執行
pip3 install pytest looseversion
wget https://github.com/libfuse/libfuse/releases/download/fuse-3.16.1/fuse-3.16.1.tar.gz
tar -xf fuse-3.16.1.tar.gz
cd fuse-3.16.1
mkdir build && cd build
meson setup ..
meson configure -D disable-mtab=true
ninja
python3 -m pytest test
ninja install
FoundationDB安裝
wget https://github.com/apple/foundationdb/releases/download/7.1.66/foundationdb-clients_7.1.66-1_amd64.deb
wget https://github.com/apple/foundationdb/releases/download/7.1.66/foundationdb-server_7.1.66-1_amd64.deb
dpkg -i foundationdb-clients_7.1.66-1_amd64.deb
dpkg -i foundationdb-server_7.1.66-1_amd64.deb~/3fs main fdbcli ? 19:18:18
Using cluster file `/etc/foundationdb/fdb.cluster'.The database is available.Welcome to the fdbcli. For help, type `help'.
fdb>
3fs編譯
- 依賴安裝
apt install cmake libuv1-dev liblz4-dev liblzma-dev libdouble-conversion-dev libdwarf-dev libunwind-dev \libaio-dev libgflags-dev libgoogle-glog-dev libgtest-dev libgmock-dev clang-format-14 clang-14 clang-tidy-14 lld-14 \libgoogle-perftools-dev google-perftools libssl-dev gcc-12 g++-12 libboost-all-dev libsnappy-dev libsodium-dev
- 編譯第三方依賴
git clone https://github.com/deepseek-ai/3fs
cd 3fs
git submodule update --init --recursive
./patches/apply.sh
# liburing編譯
cd third_party/liburing
./configure --cc=gcc --cxx=g++;
make -j4
make install# ztsd編譯
cd third_party/zstd/
make
make install# 開始編譯3fs
cmake -S . -B build -DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_C_COMPILER=clang-14 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build build -j 8
如下所示即為編譯成功