Skip to content

Commit 8625843

Browse files
committed
Gate omp install
1 parent ba5774d commit 8625843

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

torchchat/utils/scripts/build_native.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,16 @@ if [[ "$TARGET" == "et" ]]; then
8686
EXECUTORCH_LIBRARIES="${TORCHCHAT_ROOT}/${ET_BUILD_DIR}/install/lib/libexecutorch_no_prim_ops.a;${TORCHCHAT_ROOT}/${ET_BUILD_DIR}/install/lib/libextension_threadpool.a;${TORCHCHAT_ROOT}/${ET_BUILD_DIR}/install/lib/libcpuinfo.a;${TORCHCHAT_ROOT}/${ET_BUILD_DIR}/install/lib/libpthreadpool.a"
8787
install_torchao_executorch_ops
8888
fi
89+
elif [[ "$LINK_TORCHAO_OPS" == "ON" ]]; then
90+
# Install OMP when using AOTI with linked torchao ops
91+
brew install libomp
8992
fi
9093
popd
9194

9295
# CMake commands
9396
if [[ "$TARGET" == "et" ]]; then
9497
cmake -S . -B ./cmake-out -DCMAKE_PREFIX_PATH=`python3 -c 'import torch;print(torch.utils.cmake_prefix_path)'` -DLINK_TORCHAO_OPS="${LINK_TORCHAO_OPS}" -DET_USE_ADAPTIVE_THREADS=ON -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=1" -G Ninja
9598
else
96-
brew install libomp
9799
cmake -S . -B ./cmake-out -DCMAKE_PREFIX_PATH=`python3 -c 'import torch;print(torch.utils.cmake_prefix_path)'` -DLINK_TORCHAO_OPS="${LINK_TORCHAO_OPS}" -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=1" -G Ninja
98100
fi
99101
cmake --build ./cmake-out --target "${TARGET}"_run

0 commit comments

Comments
 (0)