Download native-api/build.rs from ElderRyan/lispm-llm: direct link, hf CLI and curl.
- Browser
- Download file 588 Bytes
-
https://huggingface.co/ElderRyan/lispm-llm/resolve/main/native-api/build.rs
- Command line
-
hf download hf://ElderRyan/lispm-llm/native-api/build.rs
-
curl -L -o build.rs https://huggingface.co/ElderRyan/lispm-llm/resolve/main/native-api/build.rs
588 Bytes
| //! Locate the same LibTorch libraries used by the independent native C ABI. | |
| use std::{env, path::PathBuf}; | |
| /// Embed a runtime search path in this library rather than its dependencies. | |
| fn main() { | |
| println!("cargo:rerun-if-env-changed=LIBTORCH"); | |
| if let Some(directory) = env::var_os("LIBTORCH") { | |
| let library = PathBuf::from(directory).join("lib"); | |
| if matches!( | |
| env::var("CARGO_CFG_TARGET_OS").as_deref(), | |
| Ok("macos" | "linux") | |
| ) { | |
| println!("cargo:rustc-link-arg=-Wl,-rpath,{}", library.display()); | |
| } | |
| } | |
| } | |