Repository navigation
Closed
Labels
Description
Description
Failure message:
In file included from /usr/ports/misc/lightgbm/work/LightGBM-4.0.0/tests/cpp_tests/test_main.cpp:5:
In file included from /usr/local/include/gtest/gtest.h:64:
In file included from /usr/local/include/gtest/gtest-assertion-result.h:46:
In file included from /usr/local/include/gtest/gtest-message.h:57:
/usr/local/include/gtest/internal/gtest-port.h:270:2: error: C++ versions less than C++14 are not supported.
#error C++ versions less than C++14 are not supported.
^
In file included from /usr/ports/misc/lightgbm/work/LightGBM-4.0.0/tests/cpp_tests/test_main.cpp:5:
In file included from /usr/local/include/gtest/gtest.h:65:
In file included from /usr/local/include/gtest/gtest-death-test.h:43:
In file included from /usr/local/include/gtest/internal/gtest-death-test-internal.h:47:
In file included from /usr/local/include/gtest/gtest-matchers.h:48:
In file included from /usr/local/include/gtest/gtest-printers.h:115:
/usr/local/include/gtest/internal/gtest-internal.h:636:54: error: too few template arguments for class template 'less'
typedef ::std::map<std::string, CodeLocation, std::less<>> RegisteredTestsMap;
^
/usr/include/c++/v1/__functional/operations.h:366:29: note: template is declared here
struct _LIBCPP_TEMPLATE_VIS less
^
In file included from /usr/ports/misc/lightgbm/work/LightGBM-4.0.0/tests/cpp_tests/test_main.cpp:5:
In file included from /usr/local/include/gtest/gtest.h:65:
In file included from /usr/local/include/gtest/gtest-death-test.h:43:
In file included from /usr/local/include/gtest/internal/gtest-death-test-internal.h:47:
In file included from /usr/local/include/gtest/gtest-matchers.h:48:
In file included from /usr/local/include/gtest/gtest-printers.h:115:
/usr/local/include/gtest/internal/gtest-internal.h:613:22: error: member reference base type 'testing::internal::TypedTestSuitePState::RegisteredTestsMap' (aka 'int') is not a structure or union
registered_tests_.insert(
~~~~~~~~~~~~~~~~~^~~~~~~
/usr/local/include/gtest/internal/gtest-internal.h:619:29: error: member reference base type 'const testing::internal::TypedTestSuitePState::RegisteredTestsMap' (aka 'const int') is not a structure or union
return registered_tests_.count(test_name) > 0;
~~~~~~~~~~~~~~~~~^~~~~~
/usr/local/include/gtest/internal/gtest-internal.h:623:5: error: 'testing::internal::TypedTestSuitePState::RegisteredTestsMap' (aka 'int') is not a class, namespace, or enumeration
RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);
^
/usr/local/include/gtest/internal/gtest-internal.h:623:62: error: member reference base type 'const testing::internal::TypedTestSuitePState::RegisteredTestsMap' (aka 'const int') is not a structure or union
RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);
~~~~~~~~~~~~~~~~~^~~~~
/usr/local/include/gtest/internal/gtest-internal.h:624:41: error: member reference base type 'const testing::internal::TypedTestSuitePState::RegisteredTestsMap' (aka 'const int') is not a structure or union
GTEST_CHECK_(it != registered_tests_.end());
~~~~~~~~~~~~~~~~~^~~~
/usr/local/include/gtest/internal/gtest-port.h:1027:35: note: expanded from macro 'GTEST_CHECK_'
if (::testing::internal::IsTrue(condition)) \
^~~~~~~~~
7 errors generated.
Environment info
LightGBM version or commit hash: 4.0.0
clang-15
pytest-7.3.1
FreeBSD 13.2
Activity
jameslamb commentedon Jul 14, 2023
Thanks for using LightGBM.
Please provide the exact commands you ran which produced this error message. With just an error message, it's difficult for us to help you.
yurivict commentedon Jul 14, 2023
Complete log is here.
jameslamb commentedon Jul 14, 2023
Can you explain the context of what this build is? It looks quite complicated.
For example, what are these patches?
We'd very much appreciate if you could reduce this report to a minimal one that reproduces the problem you're facing.
yurivict commentedon Jul 14, 2023
This is a FreeBSD port build.
The patch applied is:
It shouldn't matter for this issue.
The core problem is that googletest no longer supports c++11, and the project uses c++11. You should change that to c++20, for example.
jameslamb commentedon Jul 14, 2023
Interesting! I guess we haven't experienced that in this project's CI because we don't preinstall googletest, and instead rely on CMake to pull in a specific, fairly-old version.
https://github.com/microsoft/LightGBM/blob/d73c6b530b39a18a3cacaafc4e42550be853c036/CMakeLists.txt#L607-L617
That version of googletest still supported C++11. That support was dropped in v1.12.1 (June 30, 2022.
I absolutely don't support dropping C++11, C++14, and C++17 support yet in LightGBM. That would impact a lot of the project's users, and so far we haven't found that maintaining such compatibility has been a major issue. There is some discussion in #5691 if you're curious.
However... I'd definitely support upgrading to the latest release of googletest and using the C++20 standard when running those tests. That'd give us some minimal test coverage on C++20 (we currently have none) and make it easier for repackagers like you.
I'll put up a PR for that shortly, thanks for the report and sorry for the inconvenience.
[-]Tests fail to compile: /usr/local/include/gtest/internal/gtest-port.h:270:2: error: C++ versions less than C++14 are not supported, etc[/-][+][c++] googletest tests fail on newer versions of googletest which dropped C++11 support[/+][ci] upgrade to GoogleTest v1.14.0 (fixes #5976) (#5981)
github-actions commentedon Jan 1, 2025
This issue 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.