Skip to content

Commit

Permalink
1.0.6 - Bump crates and fix macOS build
Browse files Browse the repository at this point in the history
Fixes #10
  • Loading branch information
Mottl authored Jan 14, 2025
2 parents 03913ec + 61c2c7a commit 49e91c7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lightgbm3"
version = "1.0.5"
version = "1.0.6"
edition = "2021"
authors = [
"Dmitry Mottl <[email protected]>",
Expand All @@ -18,9 +18,9 @@ readme = "README.md"
exclude = [".gitignore", ".github", ".gitmodules", "examples", "benches", "lightgbm3-sys"]

[dependencies]
lightgbm3-sys = { path = "lightgbm3-sys", version = "1.0.4" }
serde_json = "1.0.125"
polars = { version = "0.42.0", optional = true }
lightgbm3-sys = { path = "lightgbm3-sys", version = "1" }
serde_json = "1"
polars = { version = "0.45", optional = true }

[features]
default = []
Expand All @@ -35,6 +35,6 @@ path = "benches/regression.rs"
harness = false

[dev-dependencies]
rand = "0.8.5"
rand_distr = "0.4.3"
csv = "1.3.0"
rand = "0.8"
rand_distr = "0.4"
csv = "1.3"
10 changes: 5 additions & 5 deletions lightgbm3-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lightgbm3-sys"
version = "1.0.5"
version = "1.0.6"
edition = "2021"
authors = ["Dmitry Mottl <[email protected]>", "vaaaaanquish <[email protected]>"]
build = "build.rs"
Expand All @@ -12,12 +12,12 @@ readme = "README.md"
exclude = ["README.md", ".gitlab-ci.yml", ".hgeol", ".gitignore", ".appveyor.yml", ".coveralls.yml", ".travis.yml", ".github", ".gitmodules", ".nuget", "**/*.md", "lightgbm/compute/doc", "lightgbm/compute/example", "lightgbm/compute/index.html", "lightgbm/compute/perf", "lightgbm/compute/test", "lightgbm/eigen/debug", "lightgbm/eigen/demos", "lightgbm/eigen/doc", "lightgbm/eigen/failtest", "lightgbm/eigen/test", "lightgbm/examples", "lightgbm/external_libs/fast_double_parser/benchmarks", "lightgbm/external_libs/fmt/doc", "lightgbm/external_libs/fmt/test"]

[dependencies]
libc = "0.2.155"
libc = "0.2"

[build-dependencies]
cmake = "0.1.50"
bindgen = "0.69.4"
doxygen-rs = "0.4.2"
cmake = "0.1"
bindgen = "0.71"
doxygen-rs = "0.4"

[features]
openmp = []
Expand Down
7 changes: 5 additions & 2 deletions lightgbm3-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ fn main() {
let mut cfg = Config::new(&lgbm_root);
let cfg = cfg
.profile("Release")
.uses_cxx11()
.cxxflag("-std=c++11")
.define("BUILD_STATIC_LIB", "ON");
#[cfg(not(feature = "openmp"))]
Expand All @@ -59,10 +58,14 @@ fn main() {
let dst = cfg.build();

// bindgen build
let mut clang_args = vec!["-x", "c++", "-std=c++11"];
if target.contains("apple") {
clang_args.push("-mmacosx-version-min=10.12");
}
let bindings = bindgen::Builder::default()
.header("lightgbm/include/LightGBM/c_api.h")
.allowlist_file("lightgbm/include/LightGBM/c_api.h")
.clang_args(&["-x", "c++", "-std=c++11"])
.clang_args(&clang_args)
.clang_arg(format!("-I{}", lgbm_root.join("include").display()))
.parse_callbacks(Box::new(DoxygenCallback))
.generate()
Expand Down
2 changes: 1 addition & 1 deletion lightgbm3-sys/lightgbm
Submodule lightgbm updated 152 files
6 changes: 3 additions & 3 deletions src/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl Dataset {
}

// Take label from the dataframe:
let label_series = dataframe.select_series([label_column])?[0].cast(&Float32)?;
let label_series = dataframe.select_columns([label_column])?[0].cast(&Float32)?;
if label_series.null_count() != 0 {
return Err(Error::new(
"Can't create a dataset with null values in label array",
Expand All @@ -228,7 +228,7 @@ impl Dataset {
let _ = dataframe.drop_in_place(label_column)?;

let mut label_values = Vec::with_capacity(m);
let label_values_ca = label_series.unpack::<Float32Type>()?;
let label_values_ca = label_series.f32()?;
label_values.extend(label_values_ca.into_no_null_iter());

let mut feature_values = Vec::with_capacity(m * (n - 1));
Expand All @@ -240,7 +240,7 @@ impl Dataset {
}

let series = series.cast(&Float32)?;
let ca = series.unpack::<Float32Type>()?;
let ca = series.f32()?;
feature_values.extend(ca.into_no_null_iter());
}
Self::from_slice(&feature_values, &label_values, (n - 1) as i32, false)
Expand Down

0 comments on commit 49e91c7

Please sign in to comment.