|
| 1 | +# Copyright 2019 The IREE Authors |
| 2 | +# |
| 3 | +# Licensed under the Apache License v2.0 with LLVM Exceptions. |
| 4 | +# See https://llvm.org/LICENSE.txt for license information. |
| 5 | +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | + |
| 7 | +# Workspace file for the IREE project. |
| 8 | +# buildozer: disable=positional-args |
| 9 | + |
| 10 | +workspace(name = "iree_core") |
| 11 | + |
| 12 | +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 13 | +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") |
| 14 | + |
| 15 | +############################################################################### |
| 16 | +# Skylib |
| 17 | +http_archive( |
| 18 | + name = "bazel_skylib", |
| 19 | + sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506", |
| 20 | + urls = [ |
| 21 | + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz", |
| 22 | + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz", |
| 23 | + ], |
| 24 | +) |
| 25 | + |
| 26 | +load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") |
| 27 | + |
| 28 | +bazel_skylib_workspace() |
| 29 | +############################################################################### |
| 30 | + |
| 31 | +############################################################################### |
| 32 | +# llvm-project |
| 33 | + |
| 34 | +new_local_repository( |
| 35 | + name = "llvm-raw", |
| 36 | + build_file_content = "# empty", |
| 37 | + path = "third_party/llvm-project", |
| 38 | +) |
| 39 | + |
| 40 | +load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure") |
| 41 | + |
| 42 | +llvm_configure( |
| 43 | + name = "llvm-project", |
| 44 | + # Keep this in sync with the targets in iree_llvm.cmake. |
| 45 | + targets = [ |
| 46 | + "AArch64", |
| 47 | + "ARM", |
| 48 | + "RISCV", |
| 49 | + "X86", |
| 50 | + "NVPTX", |
| 51 | + "AMDGPU", |
| 52 | + "WebAssembly", |
| 53 | + ], |
| 54 | +) |
| 55 | + |
| 56 | +############################################################################### |
| 57 | + |
| 58 | +############################################################################### |
| 59 | +# All other IREE submodule dependencies |
| 60 | + |
| 61 | +load("//build_tools/bazel:workspace.bzl", "configure_iree_cuda_deps", "configure_iree_submodule_deps") |
| 62 | + |
| 63 | +configure_iree_submodule_deps() |
| 64 | + |
| 65 | +configure_iree_cuda_deps(script = "//:third-party/nvidia_sdk_download/fetch_cuda_toolkit.py") |
| 66 | + |
| 67 | +############################################################################### |
| 68 | +maybe( |
| 69 | + http_archive, |
| 70 | + name = "llvm_zlib", |
| 71 | + build_file = "@llvm-raw//utils/bazel/third_party_build:zlib-ng.BUILD", |
| 72 | + sha256 = "e36bb346c00472a1f9ff2a0a4643e590a254be6379da7cddd9daeb9a7f296731", |
| 73 | + strip_prefix = "zlib-ng-2.0.7", |
| 74 | + urls = [ |
| 75 | + "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.7.zip", |
| 76 | + ], |
| 77 | +) |
| 78 | + |
| 79 | +############################################################################### |
| 80 | +maybe( |
| 81 | + http_archive, |
| 82 | + name = "llvm_zstd", |
| 83 | + build_file = "@llvm-raw//utils/bazel/third_party_build:zstd.BUILD", |
| 84 | + sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0", |
| 85 | + strip_prefix = "zstd-1.5.2", |
| 86 | + urls = [ |
| 87 | + "https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz", |
| 88 | + ], |
| 89 | +) |
| 90 | + |
| 91 | +maybe( |
| 92 | + http_archive, |
| 93 | + name = "robin_map", |
| 94 | + strip_prefix = "robin-map-1.3.0", |
| 95 | + sha256 = "a8424ad3b0affd4c57ed26f0f3d8a29604f0e1f2ef2089f497f614b1c94c7236", |
| 96 | + build_file = "@llvm-raw//utils/bazel/third_party_build:robin_map.BUILD", |
| 97 | + url = "https://github.com/Tessil/robin-map/archive/refs/tags/v1.3.0.tar.gz", |
| 98 | +) |
| 99 | + |
| 100 | +maybe( |
| 101 | + http_archive, |
| 102 | + name = "nanobind", |
| 103 | + build_file = "@llvm-raw//utils/bazel/third_party_build:nanobind.BUILD", |
| 104 | + sha256 = "bb35deaed7efac5029ed1e33880a415638352f757d49207a8e6013fefb6c49a7", |
| 105 | + strip_prefix = "nanobind-2.4.0", |
| 106 | + url = "https://github.com/wjakob/nanobind/archive/refs/tags/v2.4.0.tar.gz", |
| 107 | +) |
| 108 | + |
| 109 | +maybe( |
| 110 | + http_archive, |
| 111 | + name = "rules_python", |
| 112 | + sha256 = "4f7e2aa1eb9aa722d96498f5ef514f426c1f55161c3c9ae628c857a7128ceb07", |
| 113 | + strip_prefix = "rules_python-1.0.0", |
| 114 | + url = "https://github.com/bazelbuild/rules_python/releases/download/1.0.0/rules_python-1.0.0.tar.gz", |
| 115 | +) |
| 116 | + |
| 117 | +load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") |
| 118 | + |
| 119 | +py_repositories() |
| 120 | + |
| 121 | +python_register_toolchains( |
| 122 | + name = "python_3_11", |
| 123 | + python_version = "3.11", |
| 124 | +) |
| 125 | + |
| 126 | +load("@rules_python//python:pip.bzl", "pip_parse") |
| 127 | + |
| 128 | +pip_parse( |
| 129 | + name = "pypi", |
| 130 | + requirements_lock = "//runtime:requirements.txt" |
| 131 | +) |
| 132 | + |
| 133 | +load("@pypi//:requirements.bzl", "install_deps") |
| 134 | + |
| 135 | +install_deps() |
| 136 | + |
| 137 | +# new_local_repository( |
| 138 | +# name = "numpy_headers", |
| 139 | +# # This path points to where rules_python unpacks NumPy. Adjust for your environment: |
| 140 | +# path = "external/py_deps/pypi__numpy/numpy/core/include", |
| 141 | +# build_file_content = """ |
| 142 | +# filegroup( |
| 143 | +# name = "includes", |
| 144 | +# srcs = glob(["**/*.h"]), |
| 145 | +# visibility = ["//visibility:public"], |
| 146 | +# ) |
| 147 | +# """, |
| 148 | +# ) |
| 149 | + |
0 commit comments