Skip to content

[DRAFT] Restructuring code to include LightGBM as a dependency#57

Draft
reluzita wants to merge 16 commits into
main-fairgbmfrom
new-structure
Draft

[DRAFT] Restructuring code to include LightGBM as a dependency#57
reluzita wants to merge 16 commits into
main-fairgbmfrom
new-structure

Conversation

@reluzita
Copy link
Copy Markdown
Collaborator

@reluzita reluzita commented May 18, 2026

To run tests: pytest tests/test_cmake_build.py tests/test_constrained_objectives.py tests/test_num_constraints.py tests/test_proxy_loss_effect.py

To compile C code:

cd native
mkdir -p build && cd build
cmake ..
make -j4

@reluzita reluzita requested review from TaiPee, ar-neto and sgpjesus May 18, 2026 10:12
@reluzita reluzita changed the title Restructuring code to include LightGBM as a dependency [DRAFT] Restructuring code to include LightGBM as a dependency May 18, 2026
Copy link
Copy Markdown
Collaborator

@TaiPee TaiPee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the build and ran the tests. A couple of notes on what was needed to get everything working:

Installing dependencies

The dev extras need to be installed explicitly since hypothesis (used by most of the test files) is
under [project.optional-dependencies]:

pip install -e ".[dev]"

Placing lib_fairgbm.so where Python can find it

Running cmake .. && make -j4 in native/build/ compiles successfully, but the .so ends up in
native/build/ rather than the fairgbm/ package directory where _lib.py looks for it. Using pip install
-e ".[dev]" handles both the build and placement in one step. Alternatively, a manual copy works too:

cp native/build/lib_fairgbm.so fairgbm/

With those two things in place, all 19 tests pass.

reluzita added 5 commits June 1, 2026 09:43
- Add Microsoft LightGBM v3.2.1 as git submodule at vendor/LightGBM
- Add root CMakeLists.txt that patches LightGBM with FairGBM extensions and builds
- Add swig/ directory for Java JNI bindings
- Compatible with feedzai-openml-java build pipeline (no changes needed there)
…n Java build

When building inside full LightGBM (Java build), FairGBM::Config becomes
a typedef for LightGBM::Config. Also re-added strs constructor overloads
for model loading compatibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants