Skip to content

Vertexwahn/rules_embree

Repository files navigation

Support Ukraine BazelBuild

rules_embree -- Bazel build rules for Intel Embree

Intel Embree is a ray tracing kernel.

Bzlmod support

If you are using Bzlmod you can fetch Embree 4.3.0 using the Bazel Central Registry.

Add to your MODULE.bazel file:

bazel_dep(name = "embree", version = "4.3.0")

The underlying source code that makes this work is not part of this repository, but part of the bazelbuild/bazel-central-registry.

Using a WORKSPACE file

These Bazel rules enable you to use Intel Embree within your Bazel project using a WORKSPACE file.

To use these rules, add the following to your WORKSPACE.bazel file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

_RULES_EMBREE_COMMIT = "4ec4392626fe18d8f1272a795d0df4fefbd17006"

http_archive(
    name = "de_vertexwahn_rules_embree",
    #sha256 = <REPLACE_WITH_SHA256>,
    strip_prefix = "rules_embree-%s" % _RULES_EMBREE_COMMIT,
    urls = [
        "https://github.com/Vertexwahn/rules_embree/archive/%s.tar.gz" % _RULES_EMBREE_COMMIT,
    ],
)

load("@de_vertexwahn_rules_embree//:embree/embree.bzl", "embree_deps")
embree_deps()

How to test?

git clone https://github.com/Vertexwahn/rules_embree.git
cd rules_embree
cd test
bazel build --config=gcc11 //... # See test/.bazelrc for other supported configs

Bazelization of Embree

If you are interested in how to bazelize the Embree repository itself you can find all my attempts in the third_party folder. I have bazelized the Embree repository at different states:

  • Embree 3.12.1
  • Embree 3.13.0
  • Embree 3.13.4
  • Embree 3.13.5
  • Embree 4.3.0

Further references

I have written two blog posts about bazelizing Embree:

License

This work is published under the Apache 2.0 License.