Conversation
guolinke
approved these changes
Jan 9, 2024
Collaborator
Author
|
Thanks for the review @guolinke ! I think this will really help with the next batch of packaging fixes I'd like to make (especially around M1/M2/M3 macOS). |
This was referenced Apr 19, 2024
Contributor
|
This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5642.
Might help with the following:
-DUSE_CUDA=1#5785Proposes the following:
CMakeversion up tov3.18CMakeversion ranges from docsBenefits of this change
This should reduce the risk of build failures with newer compilers, operating systems, architectures.
I'm especially hoping it'll help with M1/M2/M3 macOS support and supporting newer versions of CUDA.
Per the
CMakedocs (link):(my emphasis)
So even on systems with newer versions of
CMakeinstalled, havingcmake_minimum_required(VERSION 3.0)binds them to howCMakebehaved as of that release. The lastCMake3.x release was 5+ years ago (v3.0.2).This change resolves this warning currently seen in many of LightGBM's supported platforms:
(example macOS sdist build this was observed on)
Why
3.18?From https://cliutils.gitlab.io/modern-cmake/chapters/intro/installing.html
And from https://cliutils.gitlab.io/modern-cmake/chapters/intro/dodonot.html
I'm mainly recommending v3.18 to support the CUDA builds here.
Other evidence it could be ok:
CMake >= 3.18.0for about 9 months: [CI] Require C++17 + CMake 3.18; Use CUDA 11.8 in CI dmlc/xgboost#8853CMake >= 3.14.0for the 3 years prior to that: [CI] Upgrade to CMake 3.14 dmlc/xgboost#7060conda,pip, official binaries from KitWare, and many other options from https://cliutils.gitlab.io/modern-cmake/chapters/intro/installing.htmlCMakewheels for a wide range of platforms (link), and when building the Python package,scikit-build-corewill automatically get one of those if the localCMakeversion isn't sufficiently newCMakeis v3.22.1 on Ubuntu 22.04 (link), so any downstream project building on GitHub Actionsubuntu-latest(GHA docs) will be unaffected