glinscott / leela-chess

**MOVED TO https://github.com/LeelaChessZero/leela-chess ** A chess adaption of GCP's Leela Zero
http://lczero.org
GNU General Public License v3.0
760 stars 299 forks source link

Cannot make #2

Closed brianprichardson closed 6 years ago

brianprichardson commented 6 years ago

I can compile and make Leela-zero (go program). When trying chess, I get this:

brian@Tinker2Ubuntu:~/leela-chess/src$ make
Detected OS: Linux
make \
    CXXFLAGS='-I/usr/include/openblas -I. -Wall -Wextra -pipe -O3 -g -ffast-math -flto -march=native -std=c++14 -DNDEBUG'  \
    LDFLAGS=' -flto -g' \
    lczero
make[1]: Entering directory '/home/brian/leela-chess/src'
g++ -I/usr/include/openblas -I. -Wall -Wextra -pipe -O3 -g -ffast-math -flto -march=native -std=c++14 -DNDEBUG -MD -MP -c -o Network.o Network.cpp
In file included from /usr/include/c++/5/bits/hashtable.h:35:0,
                 from /usr/include/c++/5/unordered_map:47,
                 from Network.h:28,
                 from Network.cpp:52:
/usr/include/c++/5/bits/hashtable_policy.h: In instantiation of ‘struct std::__detail::__is_noexcept_hash<Move, std::hash<Move> >’:
/usr/include/c++/5/type_traits:137:12:   required from ‘struct std::__and_<std::__is_fast_hash<std::hash<Move> >, std::__detail::__is_noexcept_hash<Move, std::hash<Move> > >’
/usr/include/c++/5/type_traits:148:38:   required from ‘struct std::__not_<std::__and_<std::__is_fast_hash<std::hash<Move> >, std::__detail::__is_noexcept_hash<Move, std::hash<Move> > > >’
/usr/include/c++/5/bits/unordered_map.h:100:66:   required from ‘class std::unordered_map<Move, int>’
Network.cpp:67:40:   required from here
/usr/include/c++/5/bits/hashtable_policy.h:85:34: error: no match for call to ‘(const std::hash<Move>) (const Move&)’
  noexcept(declval<const _Hash&>()(declval<const _Key&>()))>
                                  ^
glinscott commented 6 years ago

@brianprichardson which version of gcc do you have? It looks like it can't find a hash function for Move, but that's pretty strange as it's just an int.

Ipmanchess commented 6 years ago

Same here under Windows 7 using MinGW 7.1.0

Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\ipman>cd leela-chess\leela-chess-master\src

C:\Users\ipman\Leela-Chess\leela-chess-master\src>make clean rm -f lczero Network.o Training.o UCTSearch.o Utils.o Random.o Parameters.o UCTN ode.o OpenCL.o TTable.o Timing.o main.o Bitboard.o Movegen.o Position.o UCI.o Ne twork.d Training.d UCTSearch.d Utils.d Random.d Parameters.d UCTNode.d OpenCL.d TTable.d Timing.d main.d Bitboard.d Movegen.d Position.d UCI.d

C:\Users\ipman\Leela-Chess\leela-chess-master\src>make Detected OS: MINGW32_NT-6.1 make \ CXXFLAGS='-I. -Wall -Wextra -pipe -O3 -g -ffast-math -flto -marc h=native -std=c++14 -DNDEBUG' \ LDFLAGS=' -flto -g' \ lczero make[1]: Entering directory `/c/Users/ipman/Leela-Chess/leela-chess-master/src' g++ -I. -Wall -Wextra -pipe -O3 -g -ffast-math -flto -march=native -std=c++14 -D NDEBUG -MD -MP -c -o Network.o Network.cpp Network.cpp:32:10: fatal error: boost/utility.hpp: No such file or directory

include <boost/utility.hpp>

      ^~~~~~~~~~~~~~~~~~~

compilation terminated. make[1]: [Network.o] Error 1 make[1]: Leaving directory `/c/Users/ipman/Leela-Chess/leela-chess-master/src' make: [default] Error 2

C:\Users\ipman\Leela-Chess\leela-chess-master\src>

brianprichardson commented 6 years ago

brian@Tinker2Ubuntu:~/leela-chess/src$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5)

brianprichardson commented 6 years ago

BTW I cannot compile/make the @benediamond version either.

benediamond commented 6 years ago

Of course, my version will not fully compile, because Issue 1 has not been completed. As far as I know, that remains the only obstruction to compiling.

benediamond commented 6 years ago

But I've fallen behind the curve here and I think @glinscott has taken care of this.

brianprichardson commented 6 years ago

This link looks quite like the error I'm getting. If so, don't know what to change. Thanks.

https://stackoverflow.com/questions/33597127/creating-an-stdunordered-map-with-an-stdpair-as-key

glinscott commented 6 years ago

@Ipmanchess you need to install the boost libraries.

glinscott commented 6 years ago

@brianprichardson hm.. very strange. I've compiled it on my mac with clang, and with gcc6 on ubuntu, and it compiles fine. Can you try gcc6?

brianprichardson commented 6 years ago

I tried the small test program in the link with gcc-7 and it gives the same error. Does it work for you? I could try gcc-6, but I sort of thought going to 7 might be better as long as I was bothering. I get:

brianr@Tinker-Ubuntu:~/leela-chess$ sudo update-alternatives --config gcc [sudo] password for brianr: There are 2 choices for the alternative gcc (providing /usr/bin/gcc).

Selection Path Priority Status

0 /usr/bin/gcc-5 60 auto mode

Press to keep the current choice[*], or type selection number: 2 update-alternatives: using /usr/bin/gcc-7 to provide /usr/bin/gcc (gcc) in manual mode brianr@Tinker-Ubuntu:~/leela-chess$ cd src brianr@Tinker-Ubuntu:~/leela-chess/src$ make Detected OS: Linux make \ CXXFLAGS='-I/usr/include/openblas -I. -Wall -Wextra -pipe -O3 -g -ffast-math -flto -march=native -std=c++14 -DNDEBUG' \ LDFLAGS=' -flto -g' \ lczero make[1]: Entering directory '/home/brianr/leela-chess/src' g++ -I/usr/include/openblas -I. -Wall -Wextra -pipe -O3 -g -ffast-math -flto -march=native -std=c++14 -DNDEBUG -MD -MP -c -o test.o test.cpp In file included from /usr/include/c++/5/bits/hashtable.h:35:0, from /usr/include/c++/5/unordered_map:47, from test.cpp:1: /usr/include/c++/5/bits/hashtable_policy.h: In instantiation of ‘struct std::detail::is_noexcept_hash<std::pair<int, int>, PairHash<int, int> >’: /usr/include/c++/5/type_traits:137:12: required from ‘struct std::and_<std::is_fast_hash<PairHash<int, int> >, std::detail::__is_noexcept_hash<std::pair<int, int>, PairHash<int, int> > >’ /usr/include/c++/5/type_traits:148:38: required from ‘struct std::not_<std::_and<std::is_fast_hash<PairHash<int, int> >, std::detail::__is_noexcept_hash<std::pair<int, int>, PairHash<int, int> > > >’ /usr/include/c++/5/bits/unordered_map.h:100:66: required from ‘class std::unordered_map<std::pair<int, int>, std::unique_ptr, PairHash<int, int>, PairEqual<int, int> >’ test.cpp:29:46: required from here /usr/include/c++/5/bits/hashtable_policy.h:85:34: error: no match for call to ‘(const PairHash<int, int>) (const std::pair<int, int>&)’ noexcept(declval<const _Hash&>()(declval<const _Key&>()))>

PS I don't know why the formatting gets so messed up in chrome (in both Win7 and Ubuntu). Any suggestions welcome.

vondele commented 6 years ago

compilation works for me on ubuntu, with g++-7. I did install a bunch of packages (opencl, ocl-icd-libopencl1, opencl-headers, ocl-icd-opencl-dev, libboost-all-dev).

brianprichardson commented 6 years ago

@vondele thanks for confirming that gcc-7 works. I do have those libs. It is just odd that LeelaZero works and LeelaChess does not.

lp-- commented 6 years ago

i can compile on debian with gcc 6.3

lp-- commented 6 years ago

After ./lczero -w random_weights.txt --start train --noponder -p1600 -l ../games/log it ran for some time playing several training games but aborted with message

terminate called after throwing an instance of 'std::runtime_error'
  what():  Error in gzip output
Aborted
kiudee commented 6 years ago

I had the same error. There needs to be a folder named data in the path from which you are executing.

lp-- notifications@github.com schrieb am Fr., 12. Jan. 2018, 09:21:

After ./lczero -w random_weights.txt --start train --noponder -p1600 -l ../games/log it ran for some time playing several training games but aborted with message

terminate called after throwing an instance of 'std::runtime_error' what(): Error in gzip output Aborted

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/glinscott/leela-chess/issues/2#issuecomment-357172717, or mute the thread https://github.com/notifications/unsubscribe-auth/AAic-QLzrqri9wednxiHkKVPBcg6U4tmks5tJxYjgaJpZM4RYUBx .

brianprichardson commented 6 years ago

Just wondering if my being on ubuntu 16.04 LTS might be an issue. Thanks.

vondele commented 6 years ago

@brianprichardson no, same ubuntu here. Try

make clean
CXX=g++-7 make
brianprichardson commented 6 years ago

@vondele Thanks, that did it!

So close. So the application produced by make is named lczero, but autogtp wants leelaz, so I copied and renamed it in the autogtp directory. But, when I start autogtp I get this: brian@Tinker2Ubuntu:~/leela-chess/autogtp$ ./autogtp AutoGTP v11 Using 1 thread(s) for GPU(s). Starting thread 1 on GPU 0 { "cmd": "selfplay", "hash": "46ff4b944966ca9c2a33ce28f4da4a2f08f3e18ca84e3d58148b228673840a45", "leelaz_version": "0.9", "options": { "noise": "true", "playouts": "1600", "randomcnt": "30", "resignation_percent": "1" }, "options_hash": "16b7b7", "random_seed": "88338959155576209", "required_client_version": "10" }

Got new job: selfplay net: 46ff4b944966ca9c2a33ce28f4da4a2f08f3e18ca84e3d58148b228673840a45. GTP: LCZero Copyright (C) 2017 Gary Linscott

ERROR: Error in GTP response.

brianprichardson commented 6 years ago

Nevermind, not open for distributed yet...

glinscott commented 6 years ago

Closing after merging #4.

autogtp indeed has not yet been ported to chess :). I'll open some issues tracking things to do.