From fed66d4177173abe332e512815d100e9d9ecad08 Mon Sep 17 00:00:00 2001 From: Hency Raj Date: Sun, 11 Jan 2026 19:14:22 +0530 Subject: [PATCH] docs: improve compile documentation and add CI workflow --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++++ doc/en/user/compile_en.md | 27 +++++++++++++++++++++++---- 2 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..b552e01b1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +name: Build TNN + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Configure + run: | + mkdir build + cd build + cmake .. + + - name: Build + run: | + cd build + cmake --build . --config Release diff --git a/doc/en/user/compile_en.md b/doc/en/user/compile_en.md index 96e28b03c..0420307df 100644 --- a/doc/en/user/compile_en.md +++ b/doc/en/user/compile_en.md @@ -1,3 +1,15 @@ +## Prerequisites + +Before building TNN, make sure the following tools are installed: + +- Git +- CMake (version 3.10 or higher) +- C++ Compiler: + - Linux: GCC 7 or newer + - macOS: Clang (Xcode Command Line Tools) + - Windows: MSVC 2019 or newer + + # Compile [中文版本](../../cn/user/compile.md) @@ -73,6 +85,9 @@ cd /scripts After the compilation is completed, the corresponding `armeabi-v7a` library, the` arm64-v8a` library and the `include` header file are generated in the` release` directory of the current directory. Notice that add `-Wl,--whole-archive tnn -Wl,--no-whole-archive` to the project, if tnn static library is compiled. ## III. Cross-Compile in Linux +### Description +This section is for cross-compiling TNN on x86 Linux hosts for ARM-based devices. + ### 1. Environment requirements #### Dependencies @@ -114,7 +129,11 @@ Please see: RKNPU Compilation Prerequisite in [FAQ](../faq_en.md#rknpu-compilation-prerequisite)RKNPU Compilation Prerequisite. ## IV. Compile(x86 Linux) -### 1. Enviromnment requirements + +### Description +This section is for native compilation on x86 Linux systems. + +### 1. Environment requirements #### Dependencies - cmake (version 3.11 or higher) @@ -162,7 +181,7 @@ cd /scripts ### 1. Environment requirements #### Dependencies - Visual Studio (version 2015 or higher) - - cmake (vsrsion 3.11 or higher; Or use build-in cmake in Visual Studio) + - cmake (version 3.11 or higher; Or use built-in cmake in Visual Studio) - ninja (faster compilation, installed with chocolatey) ### 2. Compilation Steps @@ -186,8 +205,8 @@ Openvino can only be compiled to 64-bit version. More problems refer to [FAQ](op ### 1. Environment requirements #### Dependencies - Visual Studio (version 2015 or higher) - - cmake (vsrsion 3.11 or higher; Or use build-in cmake in Visual Studio) - - CUDA (version 10.2 or higher) and make sure `CUDA_PATH` was set in Environment Virables + - cmake (vsrsion 3.11 or higher; Or use built-in cmake in Visual Studio) + - CUDA (version 10.2 or higher) and make sure `CUDA_PATH` was set in Environment Variables #### TensorRT configuration - Download TensorRT (version>=7.1)