Skip to content

Commit

Permalink
conditionally enable faer
Browse files Browse the repository at this point in the history
  • Loading branch information
geo-ant committed Jan 7, 2025
1 parent c7c27ef commit 47e182a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
9 changes: 4 additions & 5 deletions crates/argmin-math/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ ndarray_0_14 = { package = "ndarray", version = "0.14", optional = true }
ndarray_0_13 = { package = "ndarray", version = "0.13", optional = true }

#faer
#@todo(geo) TODO make optional true
faer_0_20 = { package = "faer", version = "0.20", optional = false }
faer_0_20 = { package = "faer", version = "0.20", optional = true}

# general
num-complex_0_4 = { package = "num-complex", version = "0.4", optional = true, default-features = false, features = ["std"] }
Expand Down Expand Up @@ -74,9 +73,9 @@ ndarray_all = ["primitives"]
ndarray_latest = ["ndarray_v0_15"]

#faer
# faer_all = ["primitives"]
# faer_latest = ["faer_v0_20"]
# faer_v0_20 = ["faer_0_20", "num-complex_0_4", "faer_all"]
faer_all = ["primitives"]
faer_latest = ["faer_v0_20"]
faer_v0_20 = ["faer_0_20", "num-complex_0_4", "faer_all"]

## With `ndarray-linalg`
ndarray_v0_15 = ["ndarray_0_15", "ndarray-linalg_0_16", "num-complex_0_4", "ndarray_all"]
Expand Down
11 changes: 8 additions & 3 deletions crates/argmin-math/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ cfg_if::cfg_if! {
}
}

cfg_if::cfg_if! {
if #[cfg(feature = "faer_v0_20")] {
extern crate faer_0_20 as faer;
}
}

#[cfg(feature = "primitives")]
mod primitives;
#[cfg(feature = "primitives")]
Expand All @@ -243,10 +249,9 @@ mod vec;
#[allow(unused_imports)]
pub use crate::vec::*;

//@todo(geo) make this conditional
extern crate faer_0_20 as faer;
// extern crate faer_core_0_17 as faer_core;
#[cfg(feature = "faer_all")]
mod faer_m;
#[cfg(feature = "faer_all")]
#[allow(unused_imports)]
pub use crate::faer_m::*;

Expand Down

0 comments on commit 47e182a

Please sign in to comment.