[ci] upgrade to GoogleTest v1.14.0 (fixes #5976)#5981
Merged
Conversation
Collaborator
Author
|
Ok good! Just updating the version without changing the C++ standard, I see exactly the same errors in CI as reported in #5976. |
Collaborator
Author
|
@guolinke @shiyu1994 could I please get a review on this one? |
guolinke
approved these changes
Dec 28, 2023
Collaborator
Author
|
thank you! |
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 #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_STANDARDCMAKE_CXX_STANDARD_REQUIREDtoON, 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)GoogleTestWhy 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.txtare 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 ../testlightgbmObserved that the expected
--stdflags were passed to the compiler (e.g.