Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement(build): enable ninja and gold linker #767

Merged
merged 5 commits into from
Nov 29, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/linux-x64-gpu.yml
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@ jobs:
cd /work
source /opt/conda/bin/activate
conda activate py38
apt install ninja-build lld
tpoisonooo marked this conversation as resolved.
Show resolved Hide resolved
mkdir build && cd build
bash ../generate.sh
make -j$(nproc) && make install
tpoisonooo marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -103,7 +103,9 @@ if(USE_TRITONSERVER_DATATYPE)
endif()

set(CXX_STD "17" CACHE STRING "C++ standard")

# enable lld linker time optimization for binary and .so
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld -flto=auto")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=lld -flto=auto")
set(CUDA_PATH ${CUDA_TOOLKIT_ROOT_DIR})

set(TF_PATH "" CACHE STRING "TensorFlow path")
1 change: 1 addition & 0 deletions docs/en/build.md
Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@ Then, follow the steps below to set up the compilation environment:
```
- build and install lmdeploy libraries:
```shell
apt install ninja-build lld # install ninja and lld linker
cd lmdeploy # the home folder of lmdeploy
mkdir build && cd build
sh ../generate.sh
1 change: 1 addition & 0 deletions docs/zh_cn/build.md
Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@ wheel 文件存放在目录 `builder/manywheel/cuda11.8_dist` 下。
```
- lmdeploy 编译安装:
```shell
apt install ninja-build lld # 安装更快的 Ninja 和 lld 链接器
cd lmdeploy # lmdeploy 源码的根目录
mkdir build && cd build
sh ../generate.sh
tpoisonooo marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion generate.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

cmake .. \
cmake -G Ninja .. \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
-DCMAKE_INSTALL_PREFIX=./install \