{"id":22848426,"url":"https://github.com/feedzai/make-lightgbm","last_synced_at":"2025-04-30T04:49:06.879Z","repository":{"id":38443126,"uuid":"278049684","full_name":"feedzai/make-lightgbm","owner":"feedzai","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-05T16:06:09.000Z","size":252,"stargazers_count":2,"open_issues_count":0,"forks_count":4,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-30T04:49:01.616Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/feedzai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-08T09:41:17.000Z","updated_at":"2021-11-22T11:34:34.000Z","dependencies_parsed_at":"2024-12-13T04:12:21.785Z","dependency_job_id":"6731e30d-8b7d-4d93-a22f-1fcc333bdf88","html_url":"https://github.com/feedzai/make-lightgbm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feedzai%2Fmake-lightgbm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feedzai%2Fmake-lightgbm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feedzai%2Fmake-lightgbm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feedzai%2Fmake-lightgbm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feedzai","download_url":"https://codeload.github.com/feedzai/make-lightgbm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251644827,"owners_count":21620630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T04:12:09.319Z","updated_at":"2025-04-30T04:49:06.856Z","avatar_url":"https://github.com/feedzai.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# make-lightgbm\n\nThis repo serves to build all the needed LightGBM artifacts to create a Java library, including a copy of OpenMP's .so, from a *\"replica\"* of LightGBM's CI build environment that does not require Microsoft credentials.\n\n# Requirements\n\n- bash \u0026 sed\n- docker\n- git\n\n# How to use\n\nTo generate the `build/` folder with all necessary artifacts just run:\n\n```bash\nbash make.sh [lightgbm_version] [package_version] # where lightgbm_version is any of (commit_id, tag, branch)\n```\n\nIn case it fails compiling for ARM64 you may need to run:\n```bash\ndocker run --rm --privileged multiarch/qemu-user-static --reset -p yes\n```\n\nIf no `lightgbm_version` is specified, `master` is checked out.\n\nIf no `package_version` is specified:\n - If `lightgbm_version` is a release (`vMAJOR.MINOR.PATCH`), `package_version=MAJOR.MINOR.PATCH`.\n Otherwise, `package_version=0.0.0`.\n \nFinally, in the output `pom.xml`, the package version is the one specified in `package_version`, except if it is `0.0.0`. In that case the build version becomes `package_version-lightgbm_version`.\n\n### Building from another LightGBM repository\n\nBy defining the environment variable `LIGHTGBM_REPO_URL` which by default points to [LightGBM](https://github.com/microsoft/LightGBM), to another `http(s)` git LightGBM repo URL, you can build your own custom version of LightGBM. This can be useful to try building our own patched/custom versions of LightGBM. Ensure you use the _http(s)_ protocol instead of _git_.\n\n### Single build for AMD64\n\nIn case you want to build only for AMD64, which doesn't have to use qemu emulation, you must define the environment variable `ARCH_BUILD=single` prior to running `make.sh`.\n\n## Output artifacts\n\nThis is the output:\n```bash\nbuild\n├── amd64\n│   ├── glibc\n│   │   ├── libgomp.so.1.0.0\n│   │   ├── lib_lightgbm.so\n│   │   └── lib_lightgbm_swig.so\n│   ├── musl\n│   │   ├── libgomp.so.1.0.0\n│   │   ├── lib_lightgbm.so\n│   │   └── lib_lightgbm_swig.so\n├── arm64\n│   ├── libgomp.so.1.0.0\n│   ├── lib_lightgbm.so\n│   └── lib_lightgbm_swig.so\n├── __commit_id__\n├── install_jar_locally.sh\n├── libopenmp.licence\n├── lightgbmlib.jar\n├── __lightgbm_repo_url__\n├── pom.xml\n├── __timestamp__\n└── __version__\n```\n\nFiles with \"__\" are just single-line files containing meta-data for traceability so you don't lose track of build conditions.\n\nYou can now copy this folder into your project and either run `bash install_jar_locally.sh` or use maven's install plugin.\n\n\n# Extra for developers: Building local patches (Debugging for developers)\n\nThis explains how to build local patches from source for LightGBM. This allows quicker iterations during LightGBM C++ \ndevelopment/debugging. \n\nFor instance, to perform debugging, one must build LightGBM using the compiler toolchain available \non the target machine running the debugger, otherwise there will be symbol compatibility issues.\n\nPatching is done in a two-stage process:\n1. Run at least once the base `make.sh` to have the base build.\n2. Patch the base build by calling `make_patch.sh` as explained below.\n\n## Running `make_patch.sh`\n\n### Setup the LightGBM source for compilation\n\nFirst, clone the LightGBM repo/fork to your computer and run CMake with the desired flags:\n```bash\ncd my_lgbm_repo\nmkdir build\ncd build\ncmake .. -DUSE_DEBUG=ON -DUSE_SWIG=ON\n```\n\n### Create the patch\n\n\u003e **Note**  \nThe patch only applies to AMD64 builds. It doesn't change other architectures' builds (e.g., ARM64) \n\nAfter the CMake setup is complete, simply run `make_patch.sh` against that folder:\n```bash\nbash make_patch.sh my_lgbm_repo_build_folder\n```\n\nThis will compile LightGBM from source with your settings and patch the current base LightGBM build in the [provider](https://github.com/feedzai/feedzai-openml-java/tree/master/openml-lightgbm/lightgbm-builder).\n\nRun `make_patch.sh` every time you want to build a new patch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeedzai%2Fmake-lightgbm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeedzai%2Fmake-lightgbm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeedzai%2Fmake-lightgbm/lists"}