Skip to content

Commit

Permalink
Set XLA_EXTENSION_DIR on build for xla-rs to read
Browse files Browse the repository at this point in the history
  • Loading branch information
BradenEverson committed Jun 19, 2024
1 parent 7820c67 commit 74b7259
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ slotmap = "1"
backtrace = "0.3"
smallvec = "1.13"
strum_macros = "0.26"
xla = { git = "https://github.com/unda-ai/xla-rs", version = "0.1.6" , branch = "main" }
xla = { git = "https://github.com/unda-ml/xla-rs", version = "0.1.6" , branch = "main" }
thiserror = "1"
half = "2.4.0"
byteorder = "1.5"
13 changes: 13 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use std::env;
use std::path::PathBuf;

fn main() {
let manifest_dir = env::var("CARGO_MANIFEST_DIR").expect("Missing manifest");
let xla_extension_dir = PathBuf::from(manifest_dir).join("xla_extension");

if !xla_extension_dir.exists() {
panic!("The xla_extension library was not found in the expected path: {}", xla_extension_dir.display());
}
println!("cargo:rustc-env=XLA_EXTENSION_DIR={}", xla_extension_dir.display());
println!("cargo:rerun-if-changed=build.rs");
}

0 comments on commit 74b7259

Please sign in to comment.