diff --git a/.gitmodules b/.gitmodules index e69de29b..14773f6a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lax-bindgen/lapack-sys"] + path = lax-bindgen/lapack-sys + url = git@github.com:blas-lapack-rs/lapack-sys.git diff --git a/Cargo.toml b/Cargo.toml index ba1ae403..4a9ad966 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,4 +2,5 @@ members = [ "ndarray-linalg", "lax", + "lax-bindgen", ] diff --git a/lax-bindgen/Cargo.toml b/lax-bindgen/Cargo.toml new file mode 100644 index 00000000..89b2b4c6 --- /dev/null +++ b/lax-bindgen/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "lax-bindgen" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow = "1.0.62" +proc-macro2 = "1.0.43" +quote = "1.0.21" +syn = { version = "1.0.99", features = ["full", "extra-traits"] } diff --git a/lax-bindgen/lapack-sys b/lax-bindgen/lapack-sys new file mode 160000 index 00000000..6f42e18f --- /dev/null +++ b/lax-bindgen/lapack-sys @@ -0,0 +1 @@ +Subproject commit 6f42e18ff245e0b53527a24211af1f640b4b637d diff --git a/lax-bindgen/src/main.rs b/lax-bindgen/src/main.rs new file mode 100644 index 00000000..af3dc9db --- /dev/null +++ b/lax-bindgen/src/main.rs @@ -0,0 +1,12 @@ +use anyhow::Result; +use std::{fs, path::PathBuf}; + +fn main() -> Result<()> { + let crate_root = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + let lapack_sys = fs::read_to_string(crate_root.join("lapack-sys/src/lapack.rs"))?; + + let file: syn::File = syn::parse_str(&lapack_sys)?; + dbg!(file); + + Ok(()) +}