Skip to content
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

Failed to build Linux mint " error: ‘dummy’ may be used uninitialized" #2663

Open
Ignotumignotius opened this issue Mar 15, 2023 · 3 comments

Comments

@Ignotumignotius
Copy link

[ 54%] Building CXX object gtest/googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o In file included from /home/**********/Desktop/leela-zero-0.17/leela-zero/gtest/googletest/src/gtest-all.cc:43: /home/********/Desktop/leela-zero-0.17/leela-zero/gtest/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’: /home/********/Desktop/leela-zero-0.17/leela-zero/gtest/googletest/src/gtest-death-test.cc:1012:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized] 1012 | StackLowerThanAddress(&dummy, &result); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /home/******/Desktop/leela-zero-0.17/leela-zero/gtest/googletest/src/gtest-death-test.cc:1002:13: note: by argument 1 of type ‘const void*’ to ‘void testing::internal::StackLowerThanAddress(const void*, bool*)’ declared here 1002 | static void StackLowerThanAddress(const void* ptr, bool* result) { | ^~~~~~~~~~~~~~~~~~~~~ /home/******/Desktop/leela-zero-0.17/leela-zero/gtest/googletest/src/gtest-death-test.cc:1010:7: note: ‘dummy’ declared here 1010 | int dummy; | ^~~~~ cc1plus: all warnings being treated as errors gmake[2]: *** [gtest/googlemock/gtest/CMakeFiles/gtest.dir/build.make:76: gtest/googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:309: gtest/googlemock/gtest/CMakeFiles/gtest.dir/all] Error 2 gmake: *** [Makefile:156: all] Error 2

@OmnipotentEntity
Copy link
Contributor

You can workaround this issue by removing the flag -Werror which turns all warnings into errors.

@chemarito
Copy link

Sorry, but I'm not a Linux nor C++ advanced user, how could I remove this flag?

Thanks in advance.

@OmnipotentEntity
Copy link
Contributor

OmnipotentEntity commented Dec 27, 2023

The flag seems to be coming from gtest. You can skip running the tests entirely by commenting out these lines:

leela-zero/CMakeLists.txt

Lines 133 to 135 in 3ee6d20

file(GLOB tests_SRC "${SrcPath}/tests/*.cpp")
add_executable(tests ${tests_SRC} $<TARGET_OBJECTS:objs>)

Note, to comment out a line in CMake you can prepend it with a #

Additionally note, that Leela Zero has been an abandoned project for several years now. There are more up to date Go AI projects, if you just want a Go AI and not specifically want to test Leela Zero. The major one is KataGo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants