bjacob | df119bd | 2023-06-16 10:27:00 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Copyright 2023 The IREE Authors |
| 4 | # |
| 5 | # Licensed under the Apache License v2.0 with LLVM Exceptions. |
| 6 | # See https://llvm.org/LICENSE.txt for license information. |
| 7 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 8 | |
| 9 | # Build and test, using CMake/CTest, with the bring-your-own-LLVM path. |
| 10 | |
| 11 | set -xeuo pipefail |
| 12 | |
| 13 | source build_tools/cmake/setup_ccache.sh |
| 14 | |
| 15 | # Environment variables read by byo_llvm.sh. |
| 16 | export IREE_BYOLLVM_BUILD_DIR="${1:-build-byo-llvm}" |
| 17 | export IREE_BYOLLVM_INSTALL_DIR="${IREE_BYOLLVM_BUILD_DIR}/install" |
| 18 | |
Stella Laurenzo | 4f40080 | 2024-04-04 09:55:24 -0700 | [diff] [blame] | 19 | python3 --version |
| 20 | |
| 21 | # We've been instructed to set up a venv. |
| 22 | VENV_DIR="$IREE_BYOLLVM_BUILD_DIR/.venv" |
| 23 | echo "Setting up venv at $VENV_DIR" |
| 24 | python3 -m venv "$VENV_DIR" |
| 25 | source "$VENV_DIR/bin/activate" |
| 26 | python -m pip install -r runtime/bindings/python/iree/runtime/build_requirements.txt |
Marius Brehler | 3eeea7f | 2024-10-29 17:26:26 +0100 | [diff] [blame^] | 27 | python -m pip install -r third_party/llvm-project/mlir/python/requirements.txt |
| 28 | # Note: IREE's Python bindings for Python 3.13 are build with support for |
| 29 | # free-threading for which support was added to pybind with version 2.13.0. |
| 30 | # Therefore, we upgrade to a more recent version and avoid mixing of different |
| 31 | # pybind versions. |
| 32 | python -m pip install pybind11==2.13.6 |
Stella Laurenzo | 4f40080 | 2024-04-04 09:55:24 -0700 | [diff] [blame] | 33 | |
bjacob | df119bd | 2023-06-16 10:27:00 -0400 | [diff] [blame] | 34 | # Note: by using the `build_llvm` action here, we are exercising byo_llvm.sh's |
| 35 | # ability to build LLVM... from our own third_party/llvm-project. That's not |
| 36 | # the most intuitive interpretation of "bring your own LLVM", since as far as |
| 37 | # the source repository is concerned, that's just the standard IREE-bundled one, |
| 38 | # but that exists for good reasons as some users need control more over the |
| 39 | # building and packaging than over the source repository, and that's good to |
| 40 | # have test coverage for, and of course that's more convenient for us to test. |
Stella Laurenzo | ae70815 | 2023-06-22 21:51:59 -0700 | [diff] [blame] | 41 | build_tools/llvm/byo_llvm.sh build_llvm |
bjacob | df119bd | 2023-06-16 10:27:00 -0400 | [diff] [blame] | 42 | |
Stella Laurenzo | ae70815 | 2023-06-22 21:51:59 -0700 | [diff] [blame] | 43 | build_tools/llvm/byo_llvm.sh build_mlir |
| 44 | build_tools/llvm/byo_llvm.sh build_iree |
bjacob | df119bd | 2023-06-16 10:27:00 -0400 | [diff] [blame] | 45 | |
| 46 | echo "*********************** TESTING IREE **********************************" |
| 47 | iree_build_dir="${IREE_BYOLLVM_BUILD_DIR}/iree" |
| 48 | echo "Build Directory: ${iree_build_dir}" |
| 49 | cmake --build "${iree_build_dir}" --target iree-test-deps |
| 50 | build_tools/cmake/ctest_all.sh "${iree_build_dir}" |