-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
LIghtGBM generates incompatible architecture version in an M1 Mac #6249
Comments
Thanks for using LightGBM. I've reformatted your report slightly to make the difference between code, text produced by code, and your own words clearer. If you're unsure how I did that, please see https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax. I'll look into this in the next few days, and in general I'm hoping to prioritize better macOS support for the next release. My first thought is that maybe you're getting a version of Could you please show me the output of running the following commands? which cmake
cmake --version Could you also share the full logs from running the build script? sh ./build-python.sh bdist_wheel You can put them in a collapsible section in a GitHub comment like this:
|
Hi @jameslamb Here are the outputs you asked for: which make
# /usr/local/bin/cmake cmake --version
# cmake version 3.28.1 And the logs by logs (click me)
|
Thanks so much for that! I hope you don't mind, but I've reformatted your recent post as well to make it a bit easier to see the difference between code and output from code. You can click the These details are very helpful! I'll try to reproduce this soon and get back to you. I apologize for the inconvenience. Until we're able to resolve this.... is it absolutely necessary that you build LightGBM from source? If it'd be acceptable to use a pre-built, non-GPU-accelerated version of the library from a recent release (v4.2.0), you could do the following. pip uninstall --yes lightgbm
conda install -c conda-forge 'lightgbm>=4.2.0'
|
Hi @jameslamb In fact, I was trying to install another package, and I read somewhere a recommendation to install lightgbm from the source; unfortunately, I really don't remember the reference after so many attempts. When I run conda install -c conda-forge 'lightgbm>=4.2.0' after uninstalling lightgbm, I get the following error:
These incompatibilities may explain the problem. BTW do you know if M3 support is better for lightgbm and other libs than M1/M2? |
Yes, those look unrelated to LightGBM.
The level of support for M3 is slightly worse for LightGBM than M1/M2... at least we have coverage of compiling the project on M1 via submissions of the R package to CRAN (https://cran.r-project.org/web/checks/check_results_lightgbm.html) and on M2 via me (and I think @jmoralez) building things on our personal M2 laptops. But all 3 are poorly supported at this point... no precompiled binaries provided with releases, no testing in CI. It's an area I'd like to focus on in the next LightGBM release (after v4.3.0). |
Sorry for the delay in responding @monilouise . I believe this is fixed in recent versions of LightGBM. I just tried this on my M2 Mac. sh ./build-python.sh bdist_wheel
pip install dist/lightgbm-4.3.0.99-py3-none-macosx_14_0_arm64.whl That installation succeeded without issue. And I was able to import import lightgbm Versions I have locally: pip --version
# pip 24.0 from /Users/jlamb/miniforge3/envs/lgb-test/lib/python3.11/site-packages/pip (python 3.11)
cmake --version
# cmake version 3.26.4 Could you please clone the latest version of cmake_minimum_required(VERSION 3.0) Setting a minimum version on In January of this year, LightGBM bumped that version to CMake 3.18 (#6260). I suspect that that might have helped fix this issue you've reported. Thanks again for using LightGBM, and sorry about the difficulties building it on the new Macs. We're working on fixing that. |
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! |
Description
I compiled LIghtGBM from the sources in a MacOS M1 (arm64), Ventura, by using the following commands:
sh ./build-python.sh bdist_wheel cd dist pip install lightgbm-4.2.0.99-py3-none-macosx_13_0_arm64.whl
The
.whl
file is generated with the correct architecture version, according to the filename.Reproducible example
When I enter python and type
The following error occurs:
In fact, when I type
it shows:
Environment info
LightGBM version or commit hash: 4.2.0.99
Command(s) you used to install LightGBM: (shown above)
Additional Comments
The text was updated successfully, but these errors were encountered: