Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save averad/b0c020eaf9e0a480660b0476954f600a to your computer and use it in GitHub Desktop.
Save averad/b0c020eaf9e0a480660b0476954f600a to your computer and use it in GitHub Desktop.
IREE - Getting started - Building from Source (Windows)

👻 IREE - Getting started - Building from Source (Windows)

🧾 Requirements

🏗️ Building from Source (Windows)

Create Virtual Python Environment

  • Open a windows command prompt
  • Navigate to your preferred storage location
  • pip install virtualenv
  • python -m venv iree_env
  • .\iree_env\Scripts\activate
  • python -m pip install --upgrade pip
  • curl -O https://raw.githubusercontent.com/iree-org/iree/main/runtime/bindings/python/iree/runtime/build_requirements.txt
  • pip install -r build_requirements.txt

Enable Microsoft Visual Studio for Command Prompt

Run vcvarsall.bat

"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" arch

Replace arch with one of the following options:

x86 | amd64 | x86_amd64 | x86_arm | x86_arm64 | amd64_x86 | amd64_arm | amd64_arm64

Clone Repo

  1. git clone https://github.com/iree-org/iree.git
  2. cd iree
  3. git submodule update --init

Configure CMake (Vulkan GPUs)

cmake -GNinja -B ../iree-build/ -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DIREE_BUILD_PYTHON_BINDINGS=ON -DIREE_BUILD_COMPILER=ON -DIREE_ENABLE_ASSERTIONS=ON -DIREE_HAL_DRIVER_VULKAN=ON -DIREE_TARGET_BACKEND_VULKAN_SPIRV=ON

Build

cmake --build ../iree-build/

🧪 Testing

Build test dependencies:

cmake --build ../iree-build --target iree-test-deps

Run all built tests through CTest:

ctest --test-dir ../iree-build/ --output-on-failure

Example Output:

Windows 11 / AMD x64 / AMD RX580 (Vulkan)

55% tests passed, 493 tests failed out of 1103
Total Test time (real) = 285.95 sec

🏗️ Building Python Bindings and Importers

cd ..
cd iree-build
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DIREE_BUILD_PYTHON_BINDINGS=ON .
cmake --build .
set PYTHONPATH="$pwd\compiler-api\python_package;$pwd\bindings\python;%PYTHONPATH%"
python -c "import iree.compiler"
python -c "import iree.runtime"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment