CuriosAI / sai

SAI: a fork of Leela Zero with variable komi.
GNU General Public License v3.0
104 stars 11 forks source link

`cmake --build .` fails with gcc 5.4.0 #73

Open Naphthalin opened 4 years ago

Naphthalin commented 4 years ago

Building with gcc 5.4.0 fails with

gtest/googlemock/gtest/libgtest.a(gtest-all.cc.o): In function `testing::TestCase::TestCase(char const*, char const*, void (*)(), void (*)())':
gtest-all.cc:(.text+0x8d7d): undefined reference to `std::vector<int, std::allocator<int> >::~vector()'
gtest/googlemock/gtest/libgtest.a(gtest-all.cc.o): In function `testing::TestCase::~TestCase()':
gtest-all.cc:(.text+0x8e30): undefined reference to `std::vector<int, std::allocator<int> >::~vector()'
gtest-all.cc:(.text+0x8ea3): undefined reference to `std::vector<int, std::allocator<int> >::~vector()'
gtest/googlemock/gtest/libgtest.a(gtest-all.cc.o): In function `testing::internal::UnitTestImpl::UnitTestImpl(testing::UnitTest*)':
gtest-all.cc:(.text+0x12827): undefined reference to `std::vector<int, std::allocator<int> >::~vector()'
gtest/googlemock/gtest/libgtest.a(gtest-all.cc.o): In function `testing::internal::UnitTestImpl::~UnitTestImpl()':
gtest-all.cc:(.text+0x129d6): undefined reference to `std::vector<int, std::allocator<int> >::~vector()'
gtest/googlemock/gtest/libgtest.a(gtest-all.cc.o):gtest-all.cc:(.text+0x12b09): more undefined references to `std::vector<int, std::allocator<int> >::~vector()' follow
collect2: error: ld returned 1 exit status
CMakeFiles/tests.dir/build.make:179: recipe for target 'tests' failed
make[2]: *** [tests] Error 1
CMakeFiles/Makefile2:138: recipe for target 'CMakeFiles/tests.dir/all' failed
make[1]: *** [CMakeFiles/tests.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

while Leela Zero compiles without problems. Possibly some C++17 code in there, as newer versions of gcc seem to have no problems?

Vandertic commented 4 years ago

Sorry about that. Tests are still broken in SAI. Did you try compiling with make from the directory sai/src?

Naphthalin commented 4 years ago

Just to add to this: I managed to get gcc 8.3.1, and I was able to compile it while compiling it with 5.4.0 fails. Probably someone should identify the oldest gcc version which is able to compile it.

At least the "how to" page should be changed, as obviously C++14 compatibility isn't enough.