Skip to content

Commit 49e91c7

Browse files
authored
1.0.6 - Bump crates and fix macOS build
Fixes #10
2 parents 03913ec + 61c2c7a commit 49e91c7

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lightgbm3"
3-
version = "1.0.5"
3+
version = "1.0.6"
44
edition = "2021"
55
authors = [
66
"Dmitry Mottl <[email protected]>",
@@ -18,9 +18,9 @@ readme = "README.md"
1818
exclude = [".gitignore", ".github", ".gitmodules", "examples", "benches", "lightgbm3-sys"]
1919

2020
[dependencies]
21-
lightgbm3-sys = { path = "lightgbm3-sys", version = "1.0.4" }
22-
serde_json = "1.0.125"
23-
polars = { version = "0.42.0", optional = true }
21+
lightgbm3-sys = { path = "lightgbm3-sys", version = "1" }
22+
serde_json = "1"
23+
polars = { version = "0.45", optional = true }
2424

2525
[features]
2626
default = []
@@ -35,6 +35,6 @@ path = "benches/regression.rs"
3535
harness = false
3636

3737
[dev-dependencies]
38-
rand = "0.8.5"
39-
rand_distr = "0.4.3"
40-
csv = "1.3.0"
38+
rand = "0.8"
39+
rand_distr = "0.4"
40+
csv = "1.3"

lightgbm3-sys/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lightgbm3-sys"
3-
version = "1.0.5"
3+
version = "1.0.6"
44
edition = "2021"
55
authors = ["Dmitry Mottl <[email protected]>", "vaaaaanquish <[email protected]>"]
66
build = "build.rs"
@@ -12,12 +12,12 @@ readme = "README.md"
1212
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"]
1313

1414
[dependencies]
15-
libc = "0.2.155"
15+
libc = "0.2"
1616

1717
[build-dependencies]
18-
cmake = "0.1.50"
19-
bindgen = "0.69.4"
20-
doxygen-rs = "0.4.2"
18+
cmake = "0.1"
19+
bindgen = "0.71"
20+
doxygen-rs = "0.4"
2121

2222
[features]
2323
openmp = []

lightgbm3-sys/build.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ fn main() {
4747
let mut cfg = Config::new(&lgbm_root);
4848
let cfg = cfg
4949
.profile("Release")
50-
.uses_cxx11()
5150
.cxxflag("-std=c++11")
5251
.define("BUILD_STATIC_LIB", "ON");
5352
#[cfg(not(feature = "openmp"))]
@@ -59,10 +58,14 @@ fn main() {
5958
let dst = cfg.build();
6059

6160
// bindgen build
61+
let mut clang_args = vec!["-x", "c++", "-std=c++11"];
62+
if target.contains("apple") {
63+
clang_args.push("-mmacosx-version-min=10.12");
64+
}
6265
let bindings = bindgen::Builder::default()
6366
.header("lightgbm/include/LightGBM/c_api.h")
6467
.allowlist_file("lightgbm/include/LightGBM/c_api.h")
65-
.clang_args(&["-x", "c++", "-std=c++11"])
68+
.clang_args(&clang_args)
6669
.clang_arg(format!("-I{}", lgbm_root.join("include").display()))
6770
.parse_callbacks(Box::new(DoxygenCallback))
6871
.generate()

lightgbm3-sys/lightgbm

Submodule lightgbm updated 152 files

src/dataset.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl Dataset {
219219
}
220220

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

230230
let mut label_values = Vec::with_capacity(m);
231-
let label_values_ca = label_series.unpack::<Float32Type>()?;
231+
let label_values_ca = label_series.f32()?;
232232
label_values.extend(label_values_ca.into_no_null_iter());
233233

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

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

0 commit comments

Comments
 (0)