|
5 | 5 | # This source code is licensed under the BSD-style license found in the |
6 | 6 | # LICENSE file in the root directory of this source tree. |
7 | 7 |
|
8 | | -SCRIPT_DIR_PATH="$( |
9 | | - cd -- "$(dirname "$0")" >/dev/null 2>&1 |
10 | | - pwd -P |
11 | | -)" |
12 | | - |
13 | | -# TODO(jathu): remove the need to fetch coremltools to build deps for coreml_executor_runner. |
14 | | -# Keep this version in sync with: pyproject.toml |
15 | | -COREMLTOOLS_VERSION="8.1" |
16 | | - |
17 | | -red=`tput setaf 1` |
18 | | -green=`tput setaf 2` |
19 | | - |
20 | | -EXECUTORCH_ROOT_PATH=$(realpath "$SCRIPT_DIR_PATH/../../../../") |
21 | | -COREML_DIR_PATH="$EXECUTORCH_ROOT_PATH/backends/apple/coreml" |
22 | | -COREMLTOOLS_DIR_PATH="$COREML_DIR_PATH/third-party/coremltools" |
23 | | -PROTOBUF_FILES_DIR_PATH="$COREMLTOOLS_DIR_PATH/build/mlmodel/format/" |
24 | | - |
25 | | -cd "$EXECUTORCH_ROOT_PATH" |
26 | | - |
27 | | -rm -rf "$COREML_DIR_PATH/third-party" |
28 | | -mkdir "$COREML_DIR_PATH/third-party" |
29 | | - |
30 | | -echo "${green}ExecuTorch: Cloning coremltools." |
31 | | -git clone --depth 1 --branch "${COREMLTOOLS_VERSION}" "https://github.com/apple/coremltools.git" $COREMLTOOLS_DIR_PATH |
32 | | -cd $COREMLTOOLS_DIR_PATH |
33 | | - |
34 | | -STATUS=$? |
35 | | -if [ $STATUS -ne 0 ]; then |
36 | | - echo "${red}ExecuTorch: Failed to clone coremltools." |
37 | | - exit 1 |
38 | | -fi |
39 | | - |
40 | | -echo "${green}ExecuTorch: Installing coremltools dependencies." |
41 | | -pip install -r "$COREMLTOOLS_DIR_PATH/reqs/build.pip" |
42 | | -STATUS=$? |
43 | | -if [ $STATUS -ne 0 ]; then |
44 | | - echo "${red}ExecuTorch: Failed to install coremltools dependencies." |
45 | | - exit 1 |
46 | | -fi |
47 | | - |
48 | | -mkdir "$COREMLTOOLS_DIR_PATH/build" |
49 | | -cmake -S "$COREMLTOOLS_DIR_PATH" -B "$COREMLTOOLS_DIR_PATH/build" |
50 | | -cmake --build "$COREMLTOOLS_DIR_PATH/build" --parallel --target mlmodel |
51 | | - |
52 | | -echo "${green}ExecuTorch: Cloning nlohmann." |
53 | | -git clone https://github.com/nlohmann/json.git "$COREML_DIR_PATH/third-party/nlohmann_json" |
54 | | -STATUS=$? |
55 | | -if [ $STATUS -ne 0 ]; then |
56 | | - echo "${red}ExecuTorch: Failed to clone nlohmann." |
57 | | - exit 1 |
58 | | -fi |
59 | | - |
60 | | -echo "${green}ExecuTorch: Copying protobuf files." |
61 | | -mkdir -p "$COREML_DIR_PATH/runtime/sdk/format/" |
62 | | -cp -rf "$PROTOBUF_FILES_DIR_PATH" "$COREML_DIR_PATH/runtime/sdk/format/" |
| 8 | +# SCRIPT_DIR_PATH="$( |
| 9 | +# cd -- "$(dirname "$0")" >/dev/null 2>&1 |
| 10 | +# pwd -P |
| 11 | +# )" |
| 12 | + |
| 13 | +# # TODO(jathu): remove the need to fetch coremltools to build deps for coreml_executor_runner. |
| 14 | +# # Keep this version in sync with: pyproject.toml |
| 15 | +# COREMLTOOLS_VERSION="8.1" |
| 16 | + |
| 17 | +# red=`tput setaf 1` |
| 18 | +# green=`tput setaf 2` |
| 19 | + |
| 20 | +# EXECUTORCH_ROOT_PATH=$(realpath "$SCRIPT_DIR_PATH/../../../../") |
| 21 | +# COREML_DIR_PATH="$EXECUTORCH_ROOT_PATH/backends/apple/coreml" |
| 22 | +# COREMLTOOLS_DIR_PATH="$COREML_DIR_PATH/third-party/coremltools" |
| 23 | +# PROTOBUF_FILES_DIR_PATH="$COREMLTOOLS_DIR_PATH/build/mlmodel/format/" |
| 24 | + |
| 25 | +# cd "$EXECUTORCH_ROOT_PATH" |
| 26 | + |
| 27 | +# rm -rf "$COREML_DIR_PATH/third-party" |
| 28 | +# mkdir "$COREML_DIR_PATH/third-party" |
| 29 | + |
| 30 | +# echo "${green}ExecuTorch: Cloning coremltools." |
| 31 | +# git clone --depth 1 --branch "${COREMLTOOLS_VERSION}" "https://github.com/apple/coremltools.git" $COREMLTOOLS_DIR_PATH |
| 32 | +# cd $COREMLTOOLS_DIR_PATH |
| 33 | + |
| 34 | +# STATUS=$? |
| 35 | +# if [ $STATUS -ne 0 ]; then |
| 36 | +# echo "${red}ExecuTorch: Failed to clone coremltools." |
| 37 | +# exit 1 |
| 38 | +# fi |
| 39 | + |
| 40 | +# echo "${green}ExecuTorch: Installing coremltools dependencies." |
| 41 | +# pip install -r "$COREMLTOOLS_DIR_PATH/reqs/build.pip" |
| 42 | +# STATUS=$? |
| 43 | +# if [ $STATUS -ne 0 ]; then |
| 44 | +# echo "${red}ExecuTorch: Failed to install coremltools dependencies." |
| 45 | +# exit 1 |
| 46 | +# fi |
| 47 | + |
| 48 | +# mkdir "$COREMLTOOLS_DIR_PATH/build" |
| 49 | +# cmake -S "$COREMLTOOLS_DIR_PATH" -B "$COREMLTOOLS_DIR_PATH/build" |
| 50 | +# cmake --build "$COREMLTOOLS_DIR_PATH/build" --parallel --target mlmodel |
| 51 | + |
| 52 | +# echo "${green}ExecuTorch: Cloning nlohmann." |
| 53 | +# git clone https://github.com/nlohmann/json.git "$COREML_DIR_PATH/third-party/nlohmann_json" |
| 54 | +# STATUS=$? |
| 55 | +# if [ $STATUS -ne 0 ]; then |
| 56 | +# echo "${red}ExecuTorch: Failed to clone nlohmann." |
| 57 | +# exit 1 |
| 58 | +# fi |
| 59 | + |
| 60 | +# echo "${green}ExecuTorch: Copying protobuf files." |
| 61 | +# mkdir -p "$COREML_DIR_PATH/runtime/sdk/format/" |
| 62 | +# cp -rf "$PROTOBUF_FILES_DIR_PATH" "$COREML_DIR_PATH/runtime/sdk/format/" |
0 commit comments