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

Compile error on macOS: 'endian.h' file not found #137

Closed uyhcire closed 6 years ago

uyhcire commented 6 years ago

@Error323 commit d080cf0285ca broke compilation for me:

[  3%] Building CXX object CMakeFiles/objs.dir/src/Bitboard.cpp.o
[  6%] Building CXX object CMakeFiles/objs.dir/src/Movegen.cpp.o
[ 10%] Building CXX object CMakeFiles/objs.dir/src/NNCache.cpp.o
In file included from leela-chess/src/NNCache.cpp:19:
leela-chess/src/config.h:69:10: fatal error: 'endian.h' file not found
#include <endian.h>
         ^~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/objs.dir/src/NNCache.cpp.o] Error 1
make[1]: *** [CMakeFiles/objs.dir/all] Error 2
make: *** [all] Error 2

I tried replacing endian.h with machine/endian.h, as this Stack Overflow answer recommends, but that caused a different error.

[ 36%] Building CXX object CMakeFiles/objs.dir/src/Training.cpp.o
leela-chess/src/Training.cpp:203:24: error: use of undeclared identifier 'htole32'
            uint32 v = htole32(*vp);
                       ^
leela-chess/src/Training.cpp:212:24: error: use of undeclared identifier 'htole64'
            auto val = htole64(plane.to_ullong());
Error323 commented 6 years ago

Hi @uyhcire I'll look into it asap. I didn't test macOS and it shows... sorry.

gsobala commented 6 years ago

I've put in a pull request that should fix this

Error323 commented 6 years ago

Fixed by #142