mhonert / velvet-chess

:chess_pawn: Velvet Chess Engine - written in Rust
GNU General Public License v3.0
35 stars 2 forks source link

Android compatibility #6

Closed archimedeschess closed 1 year ago

archimedeschess commented 1 year ago

When cross compiling to Android with the following command cargo build --release --bin velvet --target=aarch64-linux-android I get the following error messages (version 5.0.0 still worked):

warning: In file included from fathom/src/tbprobe.c:50: warning: /usr/include/pthread.h:681:6: error: 'regparm' is not valid on this platform warning: cleanup_fct_attribute; warning: ^~~~~~~ warning: /usr/include/bits/pthreadtypes.h:255:50: note: expanded from macro 'cleanup_fct_attribute' warning: # define cleanup_fct_attribute attribute ((regparm (1))) warning: ^ ~ warning: In file included from fathom/src/tbprobe.c:50: warning: /usr/include/pthread.h:693:3: error: 'regparm' is not valid on this platform warning: cleanup_fct_attribute; warning: ^~~~~~~ warning: /usr/include/bits/pthreadtypes.h:255:50: note: expanded from macro 'cleanup_fct_attribute' warning: # define cleanup_fct_attribute attribute ((regparm (1))) warning: ^ ~ warning: In file included from fathom/src/tbprobe.c:50: warning: /usr/include/pthread.h:734:6: error: 'regparm' is not valid on this platform warning: cleanup_fct_attribute attribute ((noreturn)) warning: ^~~~~~~ warning: /usr/include/bits/pthreadtypes.h:255:50: note: expanded from macro 'cleanup_fct_attribute' warning: # define cleanup_fct_attribute attribute ((regparm (1))) warning: ^ ~ warning: fathom/src/tbprobe.c:247:10: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths] warning: return bswap64(input); warning: ^ warning: fathom/src/stdendian.h:86:33: note: expanded from macro 'bswap64' warning: #define bswap64(x) bswap_64(x) warning: ^ warning: /usr/include/byteswap.h:37:21: note: expanded from macro 'bswap_64' warning: #define bswap_64(x) __bswap_64 (x) warning: ^ warning: /usr/include/bits/byteswap.h:132:20: note: expanded from macro 'bswap_64' warning: r.l[0] = bswap_32 (w.l[1]); \ warning: ^ warning: /usr/include/bits/byteswap.h:76:16: note: expanded from macro '__bswap_32' warning: : "=r" (v) \ warning: ^ warning: fathom/src/tbprobe.c:247:10: note: use constraint modifier "w" warning: fathom/src/stdendian.h:86:33: note: expanded from macro 'bswap64' warning: #define bswap64(x) bswap_64(x) warning: ^ warning: /usr/include/byteswap.h:37:21: note: expanded from macro 'bswap_64' warning: #define bswap_64(x) bswap_64 (x) warning: ^ warning: /usr/include/bits/byteswap.h:132:20: note: expanded from macro '__bswap_64' warning: r.l[0] = bswap_32 (w.l[1]); \ warning: ^ warning: /usr/include/bits/byteswap.h:74:19: note: expanded from macro 'bswap_32' warning: "rorl $16, %0;" \ warning: ^ warning: fathom/src/tbprobe.c:247:10: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths] warning: return bswap64(input); warning: ^ warning: fathom/src/stdendian.h:86:33: note: expanded from macro 'bswap64' warning: #define bswap64(x) bswap_64(x) warning: ^ warning: /usr/include/byteswap.h:37:21: note: expanded from macro 'bswap_64' warning: #define bswap_64(x) bswap_64 (x) warning: ^ warning: /usr/include/bits/byteswap.h:133:20: note: expanded from macro 'bswap_64' warning: r.l[1] = __bswap_32 (w.l[0]); \ warning: ^ warning: /usr/include/bits/byteswap.h:76:16: note: expanded from macro 'bswap_32' warning: : "=r" (v) \ warning: ^ warning: fathom/src/tbprobe.c:247:10: note: use constraint modifier "w" warning: fathom/src/stdendian.h:86:33: note: expanded from macro 'bswap64' warning: #define bswap64(x) bswap_64(x) warning: ^ warning: /usr/include/byteswap.h:37:21: note: expanded from macro 'bswap_64' warning: #define bswap_64(x) __bswap_64 (x) warning: ^ warning: /usr/include/bits/byteswap.h:133:20: note: expanded from macro 'bswap_64' warning: r.l[1] = bswap_32 (w.l[0]); \ warning: ^ warning: /usr/include/bits/byteswap.h:74:19: note: expanded from macro 'bswap_32' warning: "rorl $16, %0;" \ warning: ^ warning: fathom/src/tbprobe.c:251:10: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths] warning: return bswap32(input); warning: ^ warning: fathom/src/stdendian.h:85:33: note: expanded from macro 'bswap32' warning: #define bswap32(x) bswap_32(x) warning: ^ warning: /usr/include/byteswap.h:34:21: note: expanded from macro 'bswap_32' warning: #define bswap_32(x) bswap_32 (x) warning: ^ warning: /usr/include/bits/byteswap.h:76:16: note: expanded from macro 'bswap_32' warning: : "=r" (v) \ warning: ^ warning: fathom/src/tbprobe.c:251:10: note: use constraint modifier "w" warning: fathom/src/stdendian.h:85:33: note: expanded from macro 'bswap32' warning: #define bswap32(x) bswap_32(x) warning: ^ warning: /usr/include/byteswap.h:34:21: note: expanded from macro 'bswap_32' warning: #define bswap_32(x) __bswap_32 (x) warning: ^ warning: /usr/include/bits/byteswap.h:74:19: note: expanded from macro 'bswap_32' warning: "rorl $16, %0;" \ warning: ^ warning: fathom/src/tbprobe.c:1605:12: warning: cast to 'uint8_t ' (aka 'unsigned char ') from smaller integer type 'unsigned int' [-Wint-to-pointer-cast] warning: data = (uint8_t )(((uintptr_t)data + 0x3f) & ~0x3f); warning: ^ warning: fathom/src/tbprobe.c:1609:14: warning: cast to 'uint8_t ' (aka 'unsigned char ') from smaller integer type 'unsigned int' [-Wint-to-pointer-cast] warning: data = (uint8_t )(((uintptr_t)data + 0x3f) & ~0x3f); warning: ^ warning: fathom/src/tbprobe.c:2459:41: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] warning: if (popcount(pos->white | pos->black) <= cardinalityDTM) { warning: ~~~~~~~ ^ ~~~~ warning: 6 warnings and 3 errors generated.

mhonert commented 1 year ago

Thanks for the issue report and your interest in Velvet. v5.1.0 integrates the Fathom library for Syzygy tablebase support. It seems, that it is not compatible with the aarch64-linux-android target, but I will investigate it a bit more.

As a workaround I made the tablebase feature optional. You can now set the flag --no-default-features in the cargo build command (see also the updated README).

Note: this currently only works on the master branch (currently v5.2.0-dev1). If you specifically need a build for v5.1.x, then I could backport the workaround. But currently the changes between v5.2.0-dev1 and v5.1.0 are minimal and for the most part are related to the tablebase logic.

archimedeschess commented 1 year ago

Thank you very much. It works.

Frosty54 commented 1 year ago

Hi, Mr Archimedes. Thank you for great work on sourceforge. Can you update this chess engines please. Thanks. https://github.com/vshcherbyna/igel/releases https://github.com/dsekercioglu/blackmarlin/releases P.S. Archimedes, is it possible to compile Charisma (Stockfish clone)

Frosty54 commented 1 year ago

https://chessengines.blogspot.com/2022/12/chess-engine-charisma-stockfish-clone.html?m=1 Here is sources.

Frosty54 commented 1 year ago

https://chessengines.blogspot.com/2023/01/chess-engine-charisma-saphir-stockfish.html?m=1 Correct link.

Frosty54 commented 1 year ago

@mhonert sorry me for posting this here