-
Notifications
You must be signed in to change notification settings - Fork 508
/
Copy pathunittest-macos.sh
executable file
·41 lines (34 loc) · 1.32 KB
/
unittest-macos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
set -eux
# shellcheck source=/dev/null
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
read -r BUILD_TOOL BUILD_MODE EDITABLE < <(parse_args "$@")
bash .ci/scripts/setup-conda.sh
eval "$(conda shell.bash hook)"
# Create temp directory for sccache shims
export TMP_DIR=$(mktemp -d)
export PATH="${TMP_DIR}:$PATH"
trap 'rm -rfv ${TMP_DIR}' EXIT
# Setup MacOS dependencies as there is no Docker support on MacOS atm
PYTHON_EXECUTABLE=python \
CMAKE_ARGS="-DEXECUTORCH_BUILD_PYBIND=ON -DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" \
${CONDA_RUN} --no-capture-output \
.ci/scripts/setup-macos.sh "$@"
if [[ "$BUILD_TOOL" == "cmake" ]]; then
# Install llama3_2_vision dependencies.
PYTHON_EXECUTABLE=python \
${CONDA_RUN} --no-capture-output \
./examples/models/llama3_2_vision/install_requirements.sh
.ci/scripts/unittest-macos-cmake.sh
elif [[ "$BUILD_TOOL" == "buck2" ]]; then
.ci/scripts/unittest-buck2.sh
# .ci/scripts/unittest-macos-buck2.sh
else
echo "Unknown build tool $BUILD_TOOL"
exit 1
fi