Skip to content

Commit

Permalink
[ci] Move m1 job to use build with LLVM 15 (taichi-dev#6483)
Browse files Browse the repository at this point in the history
Issue: taichi-dev#6447 

### Brief Summary
Just trying my luck in CI since my local mac is on macOS12.
  • Loading branch information
ailzhang authored Nov 17, 2022
1 parent 5485ac3 commit ede76d2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/scripts/unix-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@ set -ex

# TODO: Move llvm installation from container image to here
if [[ "$LLVM_VERSION" == "15" ]]; then
if [[ $OSTYPE == "linux-"* ]]; then
wget https://github.com/ailzhang/torchhub_example/releases/download/0.2/taichi-llvm-15-linux.zip
unzip taichi-llvm-15-linux.zip && rm taichi-llvm-15-linux.zip
export PATH="$PWD/taichi-llvm-15/bin:$PATH"
export TAICHI_CMAKE_ARGS="$TAICHI_CMAKE_ARGS -DTI_LLVM_15:BOOL=ON"
elif [[ $OSTYPE == "darwin"* ]]; then
# The following commands are done manually to save time.
#wget https://github.com/ailzhang/torchhub_example/releases/download/0.2/taichi-llvm-15-m1.zip
#unzip taichi-llvm-15-m1.zip && rm taichi-llvm-15-m1.zip
export PATH="/Users/github/taichi-llvm-15-m1/bin:$PATH"
fi
export TAICHI_CMAKE_ARGS="$TAICHI_CMAKE_ARGS -DTI_LLVM_15:BOOL=ON"
fi

build_taichi_wheel() {
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ jobs:
. .github/workflows/scripts/common-utils.sh
prepare-build-cache
brew install molten-vk
brew install llvm@15
.github/workflows/scripts/unix-build.sh
env:
PY: ${{ matrix.python }}
Expand All @@ -346,6 +347,7 @@ jobs:
-DTI_WITH_VULKAN:BOOL=ON
-DTI_BUILD_TESTS:BOOL=ON
-DTI_WITH_C_API=ON
LLVM_VERSION: 15

- name: Test
id: test
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ endmacro()

if (APPLE)
set(CLANG_OSX_FLAGS "-isysroot${CMAKE_OSX_SYSROOT}")
set(CLANG_HIGHEST_VERSION "12")
set(CLANG_HIGHEST_VERSION "13")
else()
if (TI_LLVM_15)
set(CLANG_HIGHEST_VERSION "15")
Expand Down
3 changes: 2 additions & 1 deletion taichi/runtime/cpu/jit_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ using namespace llvm::orc;
#endif

std::pair<JITTargetMachineBuilder, llvm::DataLayout> get_host_target_info() {
#if defined(TI_PLATFORM_OSX) and defined(TI_ARCH_ARM)
#if defined(TI_PLATFORM_OSX) and defined(TI_ARCH_ARM) and !defined(TI_LLVM_15)
// JITTargetMachineBuilder::detectHost() doesn't seem to work properly on
// Apple M1 yet. Hence the hardcoded strings here.
// Note this hack is no longer needed in LLVM15
auto jtmb =
JITTargetMachineBuilder(llvm::Triple("aarch64-apple-macosx11.0.0"));
llvm::DataLayout data_layout("e-m:o-i64:64-i128:128-n32:64-S128");
Expand Down

0 comments on commit ede76d2

Please sign in to comment.