From 58e2b8a7fa7fe4512717293f73351a2c5b53a3e3 Mon Sep 17 00:00:00 2001 From: Zhanlue Yang Date: Mon, 28 Nov 2022 11:49:35 +0800 Subject: [PATCH 1/2] [doc] Update LLVM10 -> LLVM15 in installation guide (#6747) --- docs/lang/articles/contribution/dev_install.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/lang/articles/contribution/dev_install.md b/docs/lang/articles/contribution/dev_install.md index 68d0f4208269e..5bb1ff6e15ebf 100644 --- a/docs/lang/articles/contribution/dev_install.md +++ b/docs/lang/articles/contribution/dev_install.md @@ -61,7 +61,7 @@ Installation instructions vary depending on which operating system (OS) you are | OS | Windows 7/8/10/11 | | Python | 3.7/3.8/3.9/3.10 | | Clang++ | 8≤ Clang++ <12 (We provide pre-built versions in the clang section) | -| LLVM | 10.0.0 (Taichi customized version) | +| LLVM | 15.0.0 (Taichi customized version) | | Visual Studio | Visual Studio 2019/2022 with "Desktop Development with C++" component. If you want to use Clang++ as the compiler, also install "C++ Clang Compiler for Windows" component | @@ -275,7 +275,7 @@ llvm-config --version # You should get 15.0.5 ```shell # For Windows -# LLVM 10.0.0 + MSVC 2019 +# LLVM 15.0.0 + MSVC 2019 cmake .. -G "Visual Studio 16 2019" -A x64 -DLLVM_ENABLE_RTTI:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86;NVPTX" -DLLVM_ENABLE_ASSERTIONS=ON -Thost=x64 -DLLVM_BUILD_TESTS:BOOL=OFF -DCMAKE_INSTALL_PREFIX=installed -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL -DCMAKE_CXX_STANDARD=17 cmake --build . --target=INSTALL --config=Release @@ -459,7 +459,7 @@ The `develop` command serves the developers' needs better because edits to the P -1. Set-up the environment variable `TAICHI_CMAKE_ARGS` with value `-DCLANG_EXECUTABLE=/bin/clang.exe -DLLVM_AS_EXECUTABLE=/bin/llvm-as.exe` +1. Set-up the environment variable `TAICHI_CMAKE_ARGS` with value `-DCLANG_EXECUTABLE=/bin/clang.exe -DLLVM_AS_EXECUTABLE=/bin/llvm-as.exe` 2. Open the "x64 Native Tools Command Prompt" for VS2019 or VS2022. Please make sure you opened the x64 version. (Or load the Visual Studio environment yourself) 3. Clone the Taichi repo *recursively* & install python dependencies From 9a3bbec8d387a43fba92753d0cb70ed7ae105d73 Mon Sep 17 00:00:00 2001 From: Ailing Date: Tue, 29 Nov 2022 13:55:44 +0800 Subject: [PATCH 2/2] [doc] Update dev install about clang version (#6759) Co-authored-by: Olinaaaloompa <106292061+Olinaaaloompa@users.noreply.github.com> --- .github/workflows/testing.yml | 8 ++ .../lang/articles/contribution/dev_install.md | 106 ++---------------- 2 files changed, 15 insertions(+), 99 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 9d4177a9f6bd2..2710b0eb5eb05 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -403,6 +403,7 @@ jobs: submodules: "recursive" - name: Prepare Environment + if: ${{ needs.check_files.outputs.run_job != 'false' }} run: >- . .github/workflows/scripts/common-utils.sh; prepare-build-cache; @@ -418,6 +419,7 @@ jobs: " >> $GITHUB_ENV; - name: Build Host Taichi + if: ${{ needs.check_files.outputs.run_job != 'false' }} run: | . .github/workflows/scripts/common-utils.sh ci-docker-run --name taichi-build-host \ @@ -432,6 +434,7 @@ jobs: -DTI_WITH_C_API=OFF - name: Build For Android + if: ${{ needs.check_files.outputs.run_job != 'false' }} run: | . .github/workflows/scripts/common-utils.sh git clean -fxd @@ -448,6 +451,7 @@ jobs: -DTI_WITH_C_API=ON - name: Test For Android AOT (export core) + if: ${{ needs.check_files.outputs.run_job != 'false' }} run: | . .github/workflows/scripts/common-utils.sh chown -R 1000:1000 . @@ -456,6 +460,7 @@ jobs: /home/dev/taichi/.github/workflows/scripts/aot-demo.sh build-and-smoke-test-android-aot-demo - name: Prepare Unity Build Environment + if: ${{ needs.check_files.outputs.run_job != 'false' }} run: | . .github/workflows/scripts/common-utils.sh chown -R 1000:1000 . @@ -464,6 +469,7 @@ jobs: /home/dev/taichi/.github/workflows/scripts/aot-demo.sh prepare-unity-build-env - name: Build Taichi-UnityExample + if: ${{ needs.check_files.outputs.run_job != 'false' }} run: | . .github/workflows/scripts/common-utils.sh ci-docker-run --name taichi-build-unity-demo \ @@ -471,6 +477,7 @@ jobs: /home/dev/taichi/.github/workflows/scripts/aot-demo.sh build-unity-demo - name: Run Taichi-UnityExample (C-API) + if: ${{ needs.check_files.outputs.run_job != 'false' }} run: | . .github/workflows/scripts/common-utils.sh chown -R 1000:1000 . @@ -479,6 +486,7 @@ jobs: /home/dev/taichi/.github/workflows/scripts/aot-demo.sh smoke-test-unity-demo - name: Build & Run C-API Headless Demos (Android) + if: ${{ needs.check_files.outputs.run_job != 'false' }} run: | . .github/workflows/scripts/common-utils.sh chown -R 1000:1000 . diff --git a/docs/lang/articles/contribution/dev_install.md b/docs/lang/articles/contribution/dev_install.md index 5bb1ff6e15ebf..a19371ca2695c 100644 --- a/docs/lang/articles/contribution/dev_install.md +++ b/docs/lang/articles/contribution/dev_install.md @@ -48,8 +48,8 @@ Installation instructions vary depending on which operating system (OS) you are |:----------------------------:|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | OS | macOS / Ubuntu / Arch Linux / Other Linux distributions | | Python | 3.7/3.8/3.9/3.10 We recommend installing Python from [Miniforge](https://github.com/conda-forge/miniforge/#download) conda if you are on a MacBook with M1 chip. | -| Clang++ | 8≤ Clang++ <12 | -| LLVM | 10.0.0 (Taichi customized version) | +| Clang++ | Clang++ >8 | +| LLVM | 15.0.4 (Taichi customized version) | | Command line tools for Xcode | For macOS users only: `xcode-select --install ` | @@ -60,8 +60,8 @@ Installation instructions vary depending on which operating system (OS) you are |:-------------:|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | OS | Windows 7/8/10/11 | | Python | 3.7/3.8/3.9/3.10 | -| Clang++ | 8≤ Clang++ <12 (We provide pre-built versions in the clang section) | -| LLVM | 15.0.0 (Taichi customized version) | +| Clang++ | Clang++ >8 | +| LLVM | 15.0.4 (Taichi customized version) | | Visual Studio | Visual Studio 2019/2022 with "Desktop Development with C++" component. If you want to use Clang++ as the compiler, also install "C++ Clang Compiler for Windows" component | @@ -72,97 +72,15 @@ Installation instructions vary depending on which operating system (OS) you are
-This Clang compiler is used to compile the Taichi device runtime. It is *not required* to use this compiler for the C++ compiler. +Taichi supports building from source with any clang compiler greater than version 8.0. Install one from your favorite package tool for the operating system. For example, you can use `apt` on Ubuntu, `brew` on macOS, and so on.
-````mdx-code-block - - - - -1. Ensure that the Clang that ships with your MacBook has a version ≥8 and <12: - - ``` - clang --version - ``` - -2. If your Clang version is ≥12, install Clang 11: - - ``` - brew install llvm@11 - export CXX=/opt/homebrew/opt/llvm@11/bin/clang++ - ``` - - - - - -Download and extract [Clang 10.0.0 pre-built binary for windows](https://github.com/taichi-dev/taichi_assets/releases/download/llvm10/clang-10.0.0-win.zip). - - - - - -``` -sudo apt install clang-10 -``` - -:::tip NOTE - -- Some Linux distributions may require additional packages to build Taichi. For example, you may need `libxi-dev` `libxcursor-dev` `libxinerama-dev` `libxrandr-dev` `libx11-dev` `libgl-dev` for Ubuntu 20.04. Keep an eye on the output of CMake when building from source. -- If this installation fails, you may want to `apt-get` the corresponding Clang package for your distribution following [this page](https://apt.llvm.org/). - -::: - - - - - -1. Download [Clang + LLVM 10.0.0 pre-built binary for Ubuntu 18.04](https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz). -2. Update the environment variables `TAICHI_CMAKE_ARGS` and `PATH`: - - ```shell - export TAICHI_CMAKE_ARGS="-DCMAKE_CXX_COMPILER=/bin/clang++ $TAICHI_CMAKE_ARGS" - - export PATH=/bin:$PATH - ``` - - :::tip NOTE - - Some Linux distributions may require additional packages to build Taichi. Keep an eye on the output of CMake when building from source. - - ::: - - - - - -Search [this site](https://pkgs.org/) for a Clang version that Taichi supports. - -:::tip NOTE - -Some Linux distributions may require additional packages to build Taichi. Keep an eye on the output of CMake when building from source. - -::: - - - - -```` ### Install LLVM #### Install pre-built, customized LLVM binaries -We provide pre-built, customized LLVM binaries. For now, Taichi supports LLVM 15 only. +We provide pre-built, customized LLVM 15 binaries. 1. Download and install customized binaries from the following list per your system environment: @@ -459,7 +377,7 @@ The `develop` command serves the developers' needs better because edits to the P -1. Set-up the environment variable `TAICHI_CMAKE_ARGS` with value `-DCLANG_EXECUTABLE=/bin/clang.exe -DLLVM_AS_EXECUTABLE=/bin/llvm-as.exe` +1. Set-up the environment variable `TAICHI_CMAKE_ARGS` with value `-DCLANG_EXECUTABLE=/bin/clang.exe -DLLVM_AS_EXECUTABLE=/bin/llvm-as.exe` 2. Open the "x64 Native Tools Command Prompt" for VS2019 or VS2022. Please make sure you opened the x64 version. (Or load the Visual Studio environment yourself) 3. Clone the Taichi repo *recursively* & install python dependencies @@ -498,16 +416,6 @@ If you want to build Taichi with Clang or maybe utilize `ccache` to cache and sp ## Troubleshooting and debugging -### `llvm-as` cannot be opened on macOS - -**Description** - -Gets an error message `llvm-as can’t be opened because Apple cannot check it for malicious software on macOS`. - -**Workaround** - -One-off: **System Preferences > Security & Privacy > General > Allow anyway**. - ### Permission denied **Description**