From ca6a26ea4bd5ec311a45262838dfd978049a6117 Mon Sep 17 00:00:00 2001 From: notCuteSocks <177598040+notCuteSocks@users.noreply.github.com> Date: Sun, 29 Dec 2024 08:55:16 +0000 Subject: [PATCH 1/5] fix(deps): update submodule LightGBM to lastest commit 60b0155ac573a8ad5994c74c49e05854281e2469 --- lightgbm3-sys/lightgbm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightgbm3-sys/lightgbm b/lightgbm3-sys/lightgbm index 6025283..60b0155 160000 --- a/lightgbm3-sys/lightgbm +++ b/lightgbm3-sys/lightgbm @@ -1 +1 @@ -Subproject commit 602528315c6d5e4ae1e8f5de106cf56cf5869b16 +Subproject commit 60b0155ac573a8ad5994c74c49e05854281e2469 From b387ca4179bd672af7efa88880dc224ea98c43cc Mon Sep 17 00:00:00 2001 From: notCuteSocks <177598040+notCuteSocks@users.noreply.github.com> Date: Sun, 29 Dec 2024 06:05:58 +0000 Subject: [PATCH 2/5] fix(deps): update rust crates --- Cargo.toml | 12 ++++++------ lightgbm3-sys/Cargo.toml | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d6e974a..4744d15 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 = [] @@ -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" diff --git a/lightgbm3-sys/Cargo.toml b/lightgbm3-sys/Cargo.toml index 28c1486..72b7a9c 100644 --- a/lightgbm3-sys/Cargo.toml +++ b/lightgbm3-sys/Cargo.toml @@ -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 = [] From 2dbbe0b580a2fa7d9f658b5465c91a88cf530374 Mon Sep 17 00:00:00 2001 From: notCuteSocks <177598040+notCuteSocks@users.noreply.github.com> Date: Tue, 14 Jan 2025 02:15:05 +0000 Subject: [PATCH 3/5] fix: remove outdated uses_cxx11() setting in cmake-rs and add -mmacosx-version-min=10.12 to fix build on macOS (issue #10) --- lightgbm3-sys/build.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lightgbm3-sys/build.rs b/lightgbm3-sys/build.rs index bdc7809..e6af3de 100644 --- a/lightgbm3-sys/build.rs +++ b/lightgbm3-sys/build.rs @@ -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"))] @@ -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() From 8b54612f7991b6469e60810e4fc9628acb05d6e2 Mon Sep 17 00:00:00 2001 From: notCuteSocks <177598040+notCuteSocks@users.noreply.github.com> Date: Tue, 14 Jan 2025 06:51:32 +0000 Subject: [PATCH 4/5] fix: Replaced select_series with select_columns to match the new Polars API break change from v0.44 --- src/dataset.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dataset.rs b/src/dataset.rs index 2760a4d..e13d560 100644 --- a/src/dataset.rs +++ b/src/dataset.rs @@ -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", @@ -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::()?; + 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)); @@ -240,7 +240,7 @@ impl Dataset { } let series = series.cast(&Float32)?; - let ca = series.unpack::()?; + let ca = series.f32()?; feature_values.extend(ca.into_no_null_iter()); } Self::from_slice(&feature_values, &label_values, (n - 1) as i32, false) From 61c2c7ab0f33b1f2ad1320f733fa73102ddda68f Mon Sep 17 00:00:00 2001 From: notCuteSocks <177598040+notCuteSocks@users.noreply.github.com> Date: Tue, 14 Jan 2025 06:51:32 +0000 Subject: [PATCH 5/5] chore: bump versions to 1.0.6 for both lightgbm3 and lightgbm3-sys --- Cargo.toml | 2 +- lightgbm3-sys/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4744d15..598623d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lightgbm3" -version = "1.0.5" +version = "1.0.6" edition = "2021" authors = [ "Dmitry Mottl ", diff --git a/lightgbm3-sys/Cargo.toml b/lightgbm3-sys/Cargo.toml index 72b7a9c..6782c0c 100644 --- a/lightgbm3-sys/Cargo.toml +++ b/lightgbm3-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lightgbm3-sys" -version = "1.0.5" +version = "1.0.6" edition = "2021" authors = ["Dmitry Mottl ", "vaaaaanquish <6syun9@gmail.com>"] build = "build.rs"