-
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
[MSVC][std:c++latest] LightGBM failed to build with /std:c++latest on MSVC #5150
Comments
Hi @xiaoxiao-Xu, thank you for the report and for the example. I believe you may be missing the submodules, you need to use the |
@jmoralez I'm so sorry that I didn't attach the complete build steps. Actually, I have updated submodules when cloning the project and I have updatd my build steps as above. So, this could not help for the issue. |
LightGBM uses the C++11 standard. Could you explain why it's important for your use case to use |
Ok. Because we are testing the msvc compiler under the behavior of '/std:c++latest'. |
Oh I see. The specific errors you've shared come from But LightGBM uses the C++11 standard and I believe it is not expected that users will try to compile it targeting other standards. @guolinke or @StrikerRUS please correct me if I'm wrong, I'm not totally confident in my understandong of this topic. |
Ok. What you mean is LightGBM doesn't support under '/std:c++latest', is it? |
I think that's correct. I don't believe any of LightGBM's continuous integration jobs test compiling with MSVC using Some evidence that the project follows the C++11 standard:
Lines 302 to 305 in 6105ba9
LightGBM/R-package/src/Makevars.in Line 1 in 6105ba9
|
Fine. I see. Thanks for your attention. |
Looks like these logs are not related to the compilation of LightGBM. Also, you are building cpp tests according to
Is it possible to check without |
Sorry. It doesn't work. |
@shiyu1994 do you have a windows machine to test? |
@guolinke @StrikerRUS The MSVC developer provided a local patch(as below) for this issue, can you help check in? Thanks! The third argument to fmt::format_to_n() cannot be a function parameter (see LightGBM/include/LightGBM/utils/common.h).
To avoid this issue, you can replace the above (and get rid of LightGBM::CommonC::format_to_buf()) with the following:
|
@QuellaZhang Thanks for your comment! Would you like to create a PR with the proposed solution? |
@StrikerRUS fix by #5500. |
Description
Hi all,
Recently, we found some errors when building LightGBM with '/std:c++latest'. Could someone please take a first look? Thanks in advance.
Reproducible example
Environment info
LightGBM version or commit hash: 7e47804
Visual Studio Version: Release 16.11.12
Platform: Windows
Additional Comments
build.log
Actual Behavior:
F:\gitP\microsoft\LightGBM\include\LightGBM/utils/common.h(1209,53): error C7595: 'fmt::v8::basic_format_string<char,const T &>::basic_format_string': call to immediate function is not a constant expression
F:\gitP\microsoft\LightGBM\include\LightGBM/utils/common.h(1209,53): error C7595: 'fmt::v8::basic_format_string<char,const T &>::basic_format_string': call to immediate function is not a constant expression
F:\gitP\microsoft\LightGBM\include\LightGBM/utils/common.h(1209,53): error C7595: 'fmt::v8::basic_format_string<char,const T &>::basic_format_string': call to immediate function is not a constant expression
F:\gitP\microsoft\LightGBM\include\LightGBM/utils/common.h(1209,53): error C7595: 'fmt::v8::basic_format_string<char,const T &>::basic_format_string': call to immediate function is not a constant expression
The text was updated successfully, but these errors were encountered: