diff --git a/.github/workflows/persubmit.yml b/.github/workflows/persubmit.yml index b3c95f351..6238d2990 100644 --- a/.github/workflows/persubmit.yml +++ b/.github/workflows/persubmit.yml @@ -1,52 +1,52 @@ -name: Persubmit Checks -on: - pull_request: - types: [opened, synchronize, reopened] - - -# test -jobs: - build_and_test_cpu_required: - # This job will be required to pass before merging to master branch. - name: Required Build and Test (CPU) - if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip ci') }} - strategy: - matrix: - include: - - os: ubuntu-latest - python: 3.6 - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - - name: Download Pre-Built LLVM 10.0.0 - run: | - python misc/ci_download.py - mkdir taichi-llvm - cd taichi-llvm - unzip ../taichi-llvm.zip - env: - CI_PLATFORM: ${{ matrix.os }} - - - name: Build - run: | - export TAICHI_REPO_DIR=`pwd` - export PATH=$TAICHI_REPO_DIR/taichi-llvm/bin/:$PATH - export CXX=clang++ - python misc/ci_setup.py ci - env: - CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CC:BOOL=ON -DTI_BUILD_TESTS:BOOL=ON - - - name: Test - run: | - export TAICHI_REPO_DIR=`pwd` - export PATH=$TAICHI_REPO_DIR/bin:$PATH - export PATH=$TAICHI_REPO_DIR/taichi-llvm/bin/:$PATH - export PYTHONPATH=$TAICHI_REPO_DIR/python - python examples/laplace.py - ti diagnose - ./build/taichi_cpp_tests - ti test -vr2 -t2 +##name: Persubmit Checks +##on: +## pull_request: +## types: [opened, synchronize, reopened] +## +## +### test +##jobs: +## build_and_test_cpu_required: +## # This job will be required to pass before merging to master branch. +## name: Required Build and Test (CPU) +## if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip ci') }} +## strategy: +## matrix: +## include: +## - os: ubuntu-latest +## python: 3.6 +## runs-on: ${{ matrix.os }} +## steps: +## - uses: actions/checkout@v2 +## - uses: actions/setup-python@v2 +## with: +## python-version: ${{ matrix.python }} +## +## - name: Download Pre-Built LLVM 10.0.0 +## run: | +## python misc/ci_download.py +## mkdir taichi-llvm +## cd taichi-llvm +## unzip ../taichi-llvm.zip +## env: +## CI_PLATFORM: ${{ matrix.os }} +## +## - name: Build +## run: | +## export TAICHI_REPO_DIR=`pwd` +## export PATH=$TAICHI_REPO_DIR/taichi-llvm/bin/:$PATH +## export CXX=clang++ +## python misc/ci_setup.py ci +## env: +## CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CC:BOOL=ON -DTI_BUILD_TESTS:BOOL=ON +## +## - name: Test +## run: | +## export TAICHI_REPO_DIR=`pwd` +## export PATH=$TAICHI_REPO_DIR/bin:$PATH +## export PATH=$TAICHI_REPO_DIR/taichi-llvm/bin/:$PATH +## export PYTHONPATH=$TAICHI_REPO_DIR/python +## python examples/laplace.py +## ti diagnose +## ./build/taichi_cpp_tests +## ti test -vr2 -t2 diff --git a/.github/workflows/win_build.yml b/.github/workflows/win_build.yml new file mode 100644 index 000000000..64dfe97b0 --- /dev/null +++ b/.github/workflows/win_build.yml @@ -0,0 +1,53 @@ +name: Windows Build + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build_windows: + name: Build on Windows + runs-on: windows-latest + + steps: + - name: Install 7Zip PowerShell + shell: powershell + run: Install-Module 7Zip4PowerShell -Force -Verbose + + - uses: actions/checkout@v2 + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Build + shell: powershell + run: | + $env:PYTHON = "C:\hostedtoolcache\windows\Python\3.7.9\x64\python.exe" + $env:TAICHI_REPO_DIR = "D:\a\test_actions\test_actions" + cd C:\ + Remove-item alias:curl + curl --retry 10 --retry-delay 5 https://github.com/taichi-dev/taichi_assets/releases/download/llvm10/taichi-llvm-10.0.0-msvc2019.zip -LO + 7z x taichi-llvm-10.0.0-msvc2019.zip -otaichi_llvm + curl --retry 10 --retry-delay 5 https://github.com/taichi-dev/taichi_assets/releases/download/llvm10/clang-10.0.0-win.zip -LO + 7z x clang-10.0.0-win.zip -otaichi_clang + $env:PATH += ";C:\taichi_llvm\bin" + $env:PATH += ";C:\taichi_clang\bin" + $env:PYTHONPATH = "$env:TAICHI_REPO_DIR\python" + $env:PATH += ";$env:TAICHI_REPO_DIR\bin" + echo $env:TAICHI_REPO_DIR + echo $env:PYTHONPATH + echo $env:PATH + clang --version + cd D:\a\test_actions\test_actions + python -m pip install numpy + python -m pip install pybind11 + python misc/ci_setup.py ci + mkdir build + cd build + cmake .. -G"Visual Studio 16 2019" -A x64 -DPYTHON_EXECUTABLE="$env:PYTHON" -DLLVM_DIR="C:\taichi_llvm\lib\cmake\llvm" + msbuild /p:Configuration=RelWithDebInfo /p:Platform=x64 /m taichi.sln + cd .. + python -c "import taichi" + python examples/laplace.py + python bin/taichi diagnose + python bin/taichi test -Cvr2 -t2 diff --git a/taichi/runtime/llvm/runtime.cpp b/taichi/runtime/llvm/runtime.cpp index 62b7fd0b2..639ae7880 100644 --- a/taichi/runtime/llvm/runtime.cpp +++ b/taichi/runtime/llvm/runtime.cpp @@ -2,6 +2,10 @@ // The generated bitcode will likely get inlined for performance. #if !defined(TI_INCLUDED) || !defined(_WIN32) +// The latest MSVC uses llvm-11 as requirements. However, we use llvm-10 +// for now and building will fail due to clang version mismatch. Therefore, +// we workaround this problem by define such flag to skip the version check. +#define _ALLOW_COMPILER_AND_STL_VERSION_MISMATCH #include #include @@ -15,6 +19,7 @@ #include "taichi/inc/constants.h" #include "taichi/math/arithmetic.h" + struct Context; using assert_failed_type = void (*)(const char *); using host_printf_type = void (*)(const char *, ...); diff --git a/tests/python/test_indices_assert.py b/tests/python/test_indices_assert.py index eaa7115c4..bd4e13df7 100644 --- a/tests/python/test_indices_assert.py +++ b/tests/python/test_indices_assert.py @@ -5,7 +5,7 @@ @ti.test(debug=True, gdb_trigger=False, arch=[ti.cpu]) def test_indices_assert(): - overflow = ti.field(int, (334, 334, 334, 2 * 10)) + overflow = ti.field(ti.i32, (334, 334, 334, 2 * 10)) @ti.kernel def access_overflow():