Skip to content

Commit

Permalink
v1.0.3 - Fixes issue with bindgen, updates LightGBM to 4.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottl committed Aug 10, 2024
1 parent 84173c4 commit 57b1e15
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
if: matrix.os == 'macos-latest'
run: |
brew install cmake libomp
cargo build --features=openmp --features=polars
cargo build --features=polars #--features=openmp
- name: Build for Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
Expand Down
18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lightgbm3"
version = "1.0.2"
version = "1.0.3"
edition = "2021"
authors = ["Dmitry Mottl <dmitry.mottl@gmail.com>", "vaaaaanquish <6syun9@gmail.com>"]
license = "MIT"
Expand All @@ -13,11 +13,11 @@ readme = "README.md"
exclude = [".gitignore", ".github", ".gitmodules", "examples", "benches", "lightgbm3-sys"]

[dependencies]
lightgbm3-sys = { path = "lightgbm3-sys", version = "1.0.2" }
libc = "0.2"
derive_builder = "0.12"
serde_json = "1.0"
polars = {version = "0.30", optional = true}
lightgbm3-sys = { path = "lightgbm3-sys", version = "1.0.3" }
libc = "0.2.155"
derive_builder = "0.20.0"
serde_json = "1.0.122"
polars = { version = "0.41.3", optional = true }

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

[dev-dependencies]
rand = "0.8"
rand_distr = "0.4"
csv = "1.2"
rand = "0.8.5"
rand_distr = "0.4.3"
csv = "1.3.0"
8 changes: 4 additions & 4 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.2"
version = "1.0.3"
edition = "2021"
authors = ["Dmitry Mottl <dmitry.mottl@gmail.com>", "vaaaaanquish <6syun9@gmail.com>"]
build = "build.rs"
Expand All @@ -12,11 +12,11 @@ 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"
libc = "0.2.155"

[build-dependencies]
bindgen = "0.66"
cmake = "0.1"
cmake = "0.1.50"
bindgen = "0.69.4"

[features]
openmp = []
Expand Down
8 changes: 4 additions & 4 deletions lightgbm3-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,22 @@ fn main() {
let cfg = cfg.define("USE_OPENMP", "OFF");
#[cfg(feature = "gpu")]
let cfg = cfg.define("USE_GPU", "1");
#[cfg(feature = "cude")]
#[cfg(feature = "cuda")]
let cfg = cfg.define("USE_CUDA", "1");
let dst = cfg.build();

// bindgen build
let bindings = bindgen::Builder::default()
.header("wrapper.h")
.header("lightgbm/include/LightGBM/c_api.h")
.allowlist_file("lightgbm/include/LightGBM/c_api.h")
.clang_args(&["-x", "c++", "-std=c++11"])
.clang_arg(format!("-I{}", lgbm_root.join("include").display()))
.generate()
.expect("Unable to generate bindings");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings.");

.unwrap_or_else(|err| panic!("Couldn't write bindings: {err}"));
// link to appropriate C++ lib
if target.contains("apple") {
println!("cargo:rustc-link-lib=c++");
Expand Down
2 changes: 1 addition & 1 deletion lightgbm3-sys/lightgbm
Submodule lightgbm updated 345 files
7 changes: 0 additions & 7 deletions lightgbm3-sys/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(clippy::redundant_static_lifetimes)]
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::upper_case_acronyms)]

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
1 change: 0 additions & 1 deletion lightgbm3-sys/wrapper.h

This file was deleted.

0 comments on commit 57b1e15

Please sign in to comment.