Skip to content

Commit

Permalink
[ci] Llvm15 clang10 ci (taichi-dev#5368)
Browse files Browse the repository at this point in the history
* Add ci for llvm 15.

TODO: add llvm 15 as an option for build_and_test_cpu_windows in testing.yml.

* Change to vs2019 prebuild.

* Update prebuild llvm 15 to set -DLLVM_ENABLE_DIA_SDK=OFF.

* Add space when append TAICHI_CMAKE_ARGS.

* Add llvmVer to control llvm version.
  • Loading branch information
python3kgae authored Jul 12, 2022
1 parent 39ffe95 commit 26c9b73
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 10 deletions.
40 changes: 32 additions & 8 deletions .github/workflows/scripts/win_build_test_cpu.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
param (
[switch]$clone = $false,
[switch]$install = $false,
[string]$libsDir = "C:\"
[string]$libsDir = "C:\",
[string]$llvmVer = "10"
)

$ErrorActionPreference = "Stop"
Expand All @@ -21,12 +22,24 @@ if (-not (Test-Path $libsDir)) {
}
Set-Location $libsDir

if (-not (Test-Path "taichi_llvm")) {
WriteInfo("Download and extract LLVM")
curl.exe --retry 10 --retry-delay 5 https://github.com/taichi-dev/taichi_assets/releases/download/llvm10/taichi-llvm-10.0.0-msvc2019.zip -LO
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE; }
7z x taichi-llvm-10.0.0-msvc2019.zip -otaichi_llvm
if (!$llvmVer.CompareTo("10")) {
if (-not (Test-Path "taichi_llvm")) {
WriteInfo("Download and extract LLVM")


curl.exe --retry 10 --retry-delay 5 https://github.com/taichi-dev/taichi_assets/releases/download/llvm10/taichi-llvm-10.0.0-msvc2019.zip -LO
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE; }
7z x taichi-llvm-10.0.0-msvc2019.zip -otaichi_llvm
}
} else {
if (-not (Test-Path "taichi_llvm_15")) {
WriteInfo("Download and extract LLVM")
curl.exe --retry 10 --retry-delay 5 https://github.com/python3kgae/taichi_assets/releases/download/llvm15_vs2019_clang/taichi-x64-Release.zip -LO
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE; }
7z x taichi-x64-Release.zip -otaichi_llvm_15
}
}

if (-not (Test-Path "taichi_clang")) {
WriteInfo("Download and extract Clang")
curl.exe --retry 10 --retry-delay 5 https://github.com/taichi-dev/taichi_assets/releases/download/llvm10/clang-10.0.0-win.zip -LO
Expand All @@ -35,15 +48,26 @@ if (-not (Test-Path "taichi_clang")) {
}

WriteInfo("Setting the env vars")
$env:LLVM_DIR = "C://taichi_llvm"
if (!$llvmVer.CompareTo("10")) {
$env:LLVM_DIR = "C://taichi_llvm"
} else {
$env:LLVM_DIR = "C:\\taichi_llvm_15"
}

#TODO enable build test
$env:TAICHI_CMAKE_ARGS = "-DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CC:BOOL=OFF -DTI_WITH_VULKAN:BOOL=OFF -DTI_WITH_CUDA:BOOL=OFF -DTI_BUILD_TESTS:BOOL=OFF"

#TODO: For now we need to hard code the compiler path from build tools 2019
$env:TAICHI_CMAKE_ARGS +=' -DCMAKE_CXX_COMPILER=C:/Program\ Files\ (x86)/Microsoft\ Visual\ Studio/2019/BuildTools/vc/Tools/Llvm/x64/bin/clang++.exe -DCMAKE_C_COMPILER=C:/Program\ Files\ (x86)/Microsoft\ Visual\ Studio/2019/BuildTools/vc/Tools/Llvm/x64/bin/clang.exe'
$env:TAICHI_CMAKE_ARGS += " -DCLANG_EXECUTABLE=C:\\taichi_clang\\bin\\clang++.exe"
$env:TAICHI_CMAKE_ARGS += " -DLLVM_AS_EXECUTABLE=C:\\taichi_llvm\\bin\\llvm-as.exe -DTI_WITH_VULKAN:BOOL=OFF"

if (!$llvmVer.CompareTo("10")) {
$env:TAICHI_CMAKE_ARGS += " -DLLVM_AS_EXECUTABLE=C:\\taichi_llvm\\bin\\llvm-as.exe -DTI_WITH_VULKAN:BOOL=OFF"
} else {
$env:TAICHI_CMAKE_ARGS += " -DLLVM_AS_EXECUTABLE=C:\\taichi_llvm_15\\bin\\llvm-as.exe -DTI_WITH_VULKAN:BOOL=OFF"
$env:TAICHI_CMAKE_ARGS += " -DTI_LLVM_15:BOOL=ON"
}


WriteInfo("Checking clang compiler")
clang --version
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,13 @@ jobs:
build_and_test_cpu_windows:
name: Build and Test Windows (CPU)
needs: check_files
strategy:
matrix:
include:
- os: windows-2019
llvmVer : '15'
- os: windows-2019
llvmVer : '10'
timeout-minutes: 90
runs-on: windows-2019
permissions:
Expand Down Expand Up @@ -298,7 +305,7 @@ jobs:
fi
docker create --name taichi_build_test \
ghcr.io/taichi-dev/taichidev-cpu-windows:v0.0.1 \
C:/taichi/.github/workflows/scripts/win_build_test_cpu.ps1
C:/taichi/.github/workflows/scripts/win_build_test_cpu.ps1 -llvmVer ${{ matrix.llvmVer }}
tar -cf - ../${{ github.event.repository.name }} --mode u=+rwx,g=+rwx,o=+rwx | docker cp - taichi_build_test:C:/
docker start -a taichi_build_test
rm -rf ccache_cache
Expand All @@ -318,7 +325,6 @@ jobs:
# path: dist/*
# retention-days: 7


build_and_test_gpu_linux:
name: Build and Test (GPU)
needs: check_files
Expand Down

0 comments on commit 26c9b73

Please sign in to comment.