LeelaChessZero / lc0

The rewritten engine, originally for tensorflow. Now all other backends have been ported here.
GNU General Public License v3.0
2.45k stars 529 forks source link

Compile fails on Raspberry Pi with latest code as of 22nd Nov 2018: #532

Closed ScallyBag closed 5 years ago

ScallyBag commented 5 years ago

Hi,

I compile Lc0 daily with your latest code on my Raspberry Pi and never had a problem until today. I pulled your lastest code and ran my normal compile, output is as follows:

Thanks,

Alan Cooper

—————————

Al@PicoChess:~/lc0 $ CC=gcc-8.1.0 CXX=g++-8.1.0 ./build.sh -Ddefault_library=static The Meson build system Version: 0.47.1 Source dir: /home/Al/lc0 Build dir: /home/Al/lc0/build/release Build type: native build Project name: lc0 Project version: undefined Native C++ compiler: g++-8.1.0 (gcc 8.1.0 "g++-8.1.0 (GCC) 8.1.0") Build machine cpu family: arm Build machine cpu: armv7l Library libprotobuf found: YES Program protoc found: YES (/usr/bin/protoc) Library pthread found: YES Library dl found: YES Library libtensorflow_cc found: NO Found pkg-config: /usr/bin/pkg-config (0.29) Dependency Accelerate found: NO Library mkl_rt found: NO Library openblas.dll found: NO Library openblas found: YES Has header "openblas_config.h": YES Program ispc found: NO Library OpenCL found: YES Native dependency OpenCL found: YES 2.1 Library cublas found: NO Library cudnn found: NO Library cudart found: NO Program /usr/local/cuda/bin/nvcc found: NO Program nvcc found: NO Native dependency zlib found: YES 1.2.8 Dependency GTest found: NO Looking for a fallback subproject for the dependency gtest Using gtest from cache. Using gtest-1.8.0-5-wrap.zip from cache.

Executing subproject gtest
Project name: gtest
Project version: 1.8.0
Native C++ compiler: g++-8.1.0 (gcc 8.1.0 "g++-8.1.0 (GCC) 8.1.0")
Dependency threads found: YES
Dependency threads found: YES (cached)
Dependency threads found: YES (cached)
Dependency threads found: YES (cached)
Build targets in project: 1
Subproject gtest finished.

Dependency gtest from subproject subprojects/gtest found: YES Build targets in project: 8 Found ninja-1.7.2 at /usr/bin/ninja ~/lc0/build/release ~/lc0 [4/105] Compiling C++ object 'lc0@exe/src_chess_position.cc.o'. In file included from /usr/local/gcc-8.1.0/include/c++/8.1.0/vector:69, from ../../src/chess/bitboard.h:33, from ../../src/chess/board.h:31, from ../../src/chess/position.h:31, from ../../src/chess/position.cc:28: /usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {const lczero::ChessBoard&, int&, int&}; _Tp = lczero::Position; _Alloc = std::allocator]’: /usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc:413:7: note: parameter passing for argument of type ‘std::vector::iterator’ {aka ‘gnu_cxx::__normal_iterator<lczero::Position*, std::vector >’} changed in GCC 7.1 vector<_Tp, _Alloc>:: ^~~~~~~ /usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc: In member function ‘void lczero::PositionHistory::Reset(const lczero::ChessBoard&, int, int)’: /usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc:109:4: note: parameter passing for argument of type ‘gnu_cxx::normal_iterator<lczero::Position*, std::vector >’ changed in GCC 7.1 _M_realloc_insert(end(), std::forward<_Args>(__args)...); ^~~~~ /usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {lczero::Position}; _Tp = lczero::Position; _Alloc = std::allocator]’: /usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc:413:7: note: parameter passing for argument of type ‘std::vector::iterator’ {aka ‘gnu_cxx::normal_iterator<lczero::Position*, std::vector >’} changed in GCC 7.1 vector<_Tp, _Alloc>:: ^~~~~~~ /usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc: In member function ‘void lczero::PositionHistory::Append(lczero::Move)’: /usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc:109:4: note: parameter passing for argument of type ‘__gnu_cxx::normal_iterator<lczero::Position, std::vector >’ changed in GCC 7.1 _M_realloc_insert(end(), std::forward<_Args>(args)...); ^~~~~ [7/105] Compiling C++ object 'lc0@exe/src_chess_board.cc.o'. In file included from /usr/local/gcc-8.1.0/include/c++/8.1.0/vector:69, from ../../src/chess/bitboard.h:33, from ../../src/chess/board.h:31, from ../../src/chess/board.cc:28: /usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {}; _Tp = lczero::MoveExecution; _Alloc = std::allocator]’: /usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc:413:7: note: parameter passing for argument of type ‘std::vector::iterator’ {aka ‘__gnu_cxx::normal_iterator<lczero::MoveExecution, std::vector >’} changed in GCC 7.1 vector<_Tp, _Alloc>:: ^~~~~~~ /usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc: In member function ‘std::vector lczero::ChessBoard::GenerateLegalMovesAndPositions() const’: /usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc:109:4: note: parameter passing for argument of type ‘gnu_cxx::__normal_iterator<lczero::MoveExecution*, std::vector >’ changed in GCC 7.1 _M_realloc_insert(end(), std::forward<_Args>(args)...); ^~~~~ [8/105] Compiling C++ object 'lc0@exe/meson-generated_proto_net.pb.cc.o'. lc0@exe/proto/net.pb.cc: In member function ‘virtual google::protobuf::uint8 pblczero::EngineVersion::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8) const’: lc0@exe/proto/net.pb.cc:529:10: warning: unused parameter ‘deterministic’ [-Wunused-parameter] bool deterministic, ::google::protobuf::uint8* target) const {


lc0@exe/proto/net.pb.cc: In member function ‘virtual google::protobuf::uint8* pblczero::Weights_Layer::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8*) const’:
lc0@exe/proto/net.pb.cc:952:10: warning: unused parameter ‘deterministic’ [-Wunused-parameter]
     bool deterministic, ::google::protobuf::uint8* target) const {
     ~~~~~^~~~~~~~~~~~~
lc0@exe/proto/net.pb.cc: In member function ‘virtual google::protobuf::uint8* pblczero::Weights_ConvBlock::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8*) const’:
lc0@exe/proto/net.pb.cc:1311:10: warning: unused parameter ‘deterministic’ [-Wunused-parameter]
     bool deterministic, ::google::protobuf::uint8* target) const {
     ~~~~~^~~~~~~~~~~~~
lc0@exe/proto/net.pb.cc: In member function ‘virtual google::protobuf::uint8* pblczero::Weights_Residual::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8*) const’:
lc0@exe/proto/net.pb.cc:1643:10: warning: unused parameter ‘deterministic’ [-Wunused-parameter]
     bool deterministic, ::google::protobuf::uint8* target) const {
     ~~~~~^~~~~~~~~~~~~
lc0@exe/proto/net.pb.cc: In member function ‘virtual google::protobuf::uint8* pblczero::Weights::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8*) const’:
lc0@exe/proto/net.pb.cc:2148:10: warning: unused parameter ‘deterministic’ [-Wunused-parameter]
     bool deterministic, ::google::protobuf::uint8* target) const {
     ~~~~~^~~~~~~~~~~~~
lc0@exe/proto/net.pb.cc: In member function ‘virtual google::protobuf::uint8* pblczero::TrainingParams::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8*) const’:
lc0@exe/proto/net.pb.cc:3513:10: warning: unused parameter ‘deterministic’ [-Wunused-parameter]
     bool deterministic, ::google::protobuf::uint8* target) const {
     ~~~~~^~~~~~~~~~~~~
lc0@exe/proto/net.pb.cc: In member function ‘virtual google::protobuf::uint8* pblczero::Format::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8*) const’:
lc0@exe/proto/net.pb.cc:4044:10: warning: unused parameter ‘deterministic’ [-Wunused-parameter]
     bool deterministic, ::google::protobuf::uint8* target) const {
     ~~~~~^~~~~~~~~~~~~
lc0@exe/proto/net.pb.cc: In member function ‘virtual google::protobuf::uint8* pblczero::Net::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8*) const’:
lc0@exe/proto/net.pb.cc:4456:10: warning: unused parameter ‘deterministic’ [-Wunused-parameter]
     bool deterministic, ::google::protobuf::uint8* target) const {
     ~~~~~^~~~~~~~~~~~~
[10/105] Compiling C++ object 'lc0@exe/src_neural_cache.cc.o'.
In file included from /usr/local/gcc-8.1.0/include/c++/8.1.0/vector:69,
                 from ../../src/neural/network.h:31,
                 from ../../src/neural/cache.h:29,
                 from ../../src/neural/cache.cc:27:
/usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {}; _Tp = lczero::CachingComputation::WorkItem; _Alloc = std::allocator<lczero::CachingComputation::WorkItem>]’:
/usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc:413:7: note: parameter passing for argument of type ‘std::vector<lczero::CachingComputation::WorkItem>::iterator’ {aka ‘__gnu_cxx::__normal_iterator<lczero::CachingComputation::WorkItem*, std::vector<lczero::CachingComputation::WorkItem> >’} changed in GCC 7.1
       vector<_Tp, _Alloc>::
       ^~~~~~~~~~~~~~~~~~~
/usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc:413:7: note: parameter passing for argument of type ‘std::vector<lczero::CachingComputation::WorkItem>::iterator’ {aka ‘__gnu_cxx::__normal_iterator<lczero::CachingComputation::WorkItem*, std::vector<lczero::CachingComputation::WorkItem> >’} changed in GCC 7.1
/usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc: In member function ‘bool lczero::CachingComputation::AddInputByHash(uint64_t)’:
/usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc:109:4: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<lczero::CachingComputation::WorkItem*, std::vector<lczero::CachingComputation::WorkItem> >’ changed in GCC 7.1
    _M_realloc_insert(end(), std::forward<_Args>(__args)...);
    ^~~~~~~~~~~~~~~~~
/usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc: In member function ‘void lczero::CachingComputation::AddInput(uint64_t, lczero::InputPlanes&&, std::vector<short unsigned int>&&)’:
/usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc:109:4: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<lczero::CachingComputation::WorkItem*, std::vector<lczero::CachingComputation::WorkItem> >’ changed in GCC 7.1
    _M_realloc_insert(end(), std::forward<_Args>(__args)...);
    ^~~~~~~~~~~~~~~~~
[16/105] Compiling C++ object 'lc0@exe/src_neural_loader.cc.o'.
FAILED: lc0@exe/src_neural_loader.cc.o 
g++-8.1.0 -Ilc0@exe -I. -I../.. -I/usr/local/include/ -I../../src -fdiagnostics-color=always -DNDEBUG -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O3 -Wextra -pedantic -march=native -DUSE_OPENBLAS  -MD -MQ 'lc0@exe/src_neural_loader.cc.o' -MF 'lc0@exe/src_neural_loader.cc.o.d' -o 'lc0@exe/src_neural_loader.cc.o' -c ../../src/neural/loader.cc
../../src/neural/loader.cc: In function ‘lczero::WeightsFile lczero::{anonymous}::ParseWeightsProto(const string&)’:
../../src/neural/loader.cc:109:21: error: ‘const class pblczero::Format’ has no member named ‘has_network_format’   if (!net.format().has_network_format()) {
                     ^~~~~~~~~~~~~~~~~~
../../src/neural/loader.cc:110:45: error: ‘class pblczero::Format’ has no member named ‘mutable_network_format’; did you mean ‘mutable_unknown_fields’?
     auto net_format = net.mutable_format()->mutable_network_format();
                                             ^~~~~~~~~~~~~~~~~~~~~~
                                             mutable_unknown_fields
../../src/neural/loader.cc:111:26: error: ‘NetworkFormat’ in namespace ‘pblczero’ does not name a type
     using nf = pblczero::NetworkFormat;
                          ^~~~~~~~~~~~~
../../src/neural/loader.cc:112:27: error: ‘nf’ has not been declared
     net_format->set_input(nf::INPUT_CLASSICAL_112_PLANE);
                           ^~
../../src/neural/loader.cc:113:28: error: ‘nf’ has not been declared
     net_format->set_output(nf::OUTPUT_CLASSICAL);
                            ^~
../../src/neural/loader.cc:114:29: error: ‘nf’ has not been declared
     net_format->set_network(nf::NETWORK_CLASSICAL);
                             ^~
[19/105] Compiling C++ object 'lc0@exe/src_mcts_search.cc.o'.
In file included from /usr/local/gcc-8.1.0/include/c++/8.1.0/vector:69,
                 from ../../src/chess/callbacks.h:32,
                 from ../../src/mcts/search.h:33,
                 from ../../src/mcts/search.cc:28:
/usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {lczero::ThinkingInfo&}; _Tp = lczero::ThinkingInfo; _Alloc = std::allocator<lczero::ThinkingInfo>]’:
/usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc:413:7: note: parameter passing for argument of type ‘std::vector<lczero::ThinkingInfo>::iterator’ {aka ‘__gnu_cxx::__normal_iterator<lczero::ThinkingInfo*, std::vector<lczero::ThinkingInfo> >’} changed in GCC 7.1
       vector<_Tp, _Alloc>::
       ^~~~~~~~~~~~~~~~~~~
/usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc: In member function ‘void lczero::Search::SendUciInfo()’:
/usr/local/gcc-8.1.0/include/c++/8.1.0/bits/vector.tcc:109:4: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<lczero::ThinkingInfo*, std::vector<lczero::ThinkingInfo> >’ changed in GCC 7.1
    _M_realloc_insert(end(), std::forward<_Args>(__args)...);
    ^~~~~~~~~~~~~~~~~
[21/105] Compiling C++ object 'lc0@exe/src_neural_network_mux.cc.o'.
ninja: build stopped: subcommand failed.
gsobala commented 5 years ago

Compiles fine on a Raspberry Pi 3B+ from a clean git clone using the instructions in the README.

Specifically, I use clang v6, do not have OpenCL installed (only BLAS), and do not have protobuf installed but let the build process deal with it. Also, your meson is out of date, now on 48.0.

ScallyBag commented 5 years ago

Hi thanks for the tip.

Strangely after deleting meson and re-installing, it installs v48.2 but meson —version says it’s still v47.1, however after removing protobuf it now compiles via clang 6.0.0 and gcc 8.1.0.

Thanks,

Al.

gsobala commented 5 years ago

Sounds like you have two mesons floating around, perhaps one installed directly and one via pip

ScallyBag commented 5 years ago

Yeah I thought similar, but the command:

sudo find / -name meson

only shows the one version.

Thanks,

Al.

borg323 commented 5 years ago

The original problem looks like it was caused by an older version of the lczero-common submodule.

mooskagh commented 5 years ago

I'm closing this as it seems that the problem was resolved?.. Anyway, feel free to reopen the issue.