Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make lightgbm into a static or dynamic library used on Android and IOS apps. #6200

Closed
guxiaobo opened this issue Nov 18, 2023 · 3 comments

Comments

@guxiaobo
Copy link

Summary

We want to use Lightgbm on mobile apps to train local models using local private data which can't be moved outside the phones.

Description

We store the data in a local SQLite database, and want to train a prediction model using LightGBM to give suggestions to phone users.

References

@jameslamb jameslamb changed the title How to make lightgbm into a static or dynamic library used on Andriod and ISO apps. How to make lightgbm into a static or dynamic library used on Andriod and IOS apps. Nov 22, 2023
@guxiaobo
Copy link
Author

For Android we can use the NDK toolchains to build LightGBM, but the question is whether LightGBM is designed to be run on mobile platforms, do the external libraries LightGBM depends on can be built for mobile platforms too?

@jameslamb jameslamb changed the title How to make lightgbm into a static or dynamic library used on Andriod and IOS apps. How to make lightgbm into a static or dynamic library used on Android and IOS apps. Dec 6, 2023
@jameslamb
Copy link
Collaborator

whether LightGBM is designed to be run on mobile platforms

Not explicitly, and we don't have any tests running on mobile platforms.

the external libraries LightGBM depends on can be built for mobile platforms too

I'm unsure.

To start, I recommend trying to compile LightGBM as a static library and without linking to OpenMP, like this:

cmake \
    -B ./build \
    -S . \
    -DUSE_OPENMP=OFF \
    -DBUILD_STATIC_LIB=ON \
    -DBUILD_CLI=OFF \
    -G 'Unix Makefiles'

make -j4 -C ./build _lightgbm

That assumes that "train local models" means that you want to run your own application code that loads lib_lightgbm.so and calls functions from its C API.

I'm not very knowledgeable about mobile development (not sure if others are here), but I'm happy to answer questions here as you have them.

Copy link

This issue has been automatically closed because it has been awaiting a response for too long. When you have time to to work with the maintainers to resolve this issue, please post a new comment and it will be re-opened. If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one. Thank you for taking the time to improve LightGBM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants