Skip to content

Commit

Permalink
Gate omp install
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Khuu committed Feb 12, 2025
1 parent ba5774d commit 8625843
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion torchchat/utils/scripts/build_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,16 @@ if [[ "$TARGET" == "et" ]]; then
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"
install_torchao_executorch_ops
fi
elif [[ "$LINK_TORCHAO_OPS" == "ON" ]]; then
# Install OMP when using AOTI with linked torchao ops
brew install libomp
fi
popd

# CMake commands
if [[ "$TARGET" == "et" ]]; then
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
else
brew install libomp
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
fi
cmake --build ./cmake-out --target "${TARGET}"_run
Expand Down

0 comments on commit 8625843

Please sign in to comment.