-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[ci] upgrade to GoogleTest v1.14.0 (fixes #5976) #5981
Conversation
Ok good! Just updating the version without changing the C++ standard, I see exactly the same errors in CI as reported in #5976.
|
@guolinke @shiyu1994 could I please get a review on this one? |
thank you! |
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. |
Fixes #5976
Updates to the latest version of GoogleTest,
v1.14.0
(https://github.com/google/googletest/releases), to get recent miscellaneous bugfixes and improvements and to keep up with versions that LightGBM contributors and uses are more likely to have.Other changes:
CMakeLists.txt
, in favor of setting CMake variableCMAKE_CXX_STANDARD
CMAKE_CXX_STANDARD_REQUIRED
toON
, to ensure a loud error is raised if using a compiler that doesn't support the requested standard (instead of silently falling back to an earlier version, which could lead to cryptic errors or undefined behavior)GoogleTest
Why only go to C++14?
C++14 is the minimum version supported by newer versions of GoogleTest.
I tried to go all the way to C++20 in this PR, but encountered some compilation errors like the following:
Which might be related to fmtlib/fmt#2775 or fmtlib/fmt#2898.
I'm proposing separating the work of adding C++20 out to #6033.
Adding C++14 specifically also improves the project's CI coverage of C++ standards:
C++11
= most tests (Python-package, CMake-based R-package, SWIG, CUDA): C++11C++14
= the cpp testsC++17
= CRAN-style R-package testsReferences
The changes in
CMakeLists.txt
are supported by the following:How I tested this
git clean -d -f -X rm -rf ./build mkdir build cd ./build cmake -DBUILD_CPP_TEST=ON -DUSE_OPENMP=OFF .. VERBOSE=1 \ make -j2 testlightgbm ../testlightgbm
Observed that the expected
--std
flags were passed to the compiler (e.g.