deepseek 3FS编译

发布于:2025-03-10 ⋅ 阅读:(18) ⋅ 点赞:(0)

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编译

  1. 依赖安装
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
  1. 编译第三方依赖
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

如下所示即为编译成功
在这里插入图片描述