official-pikafish / Pikafish

UCI xiangqi engine
http://pikafish.org
GNU General Public License v3.0
867 stars 162 forks source link

为什么我下载源码编译后不能得到可执行文件 #7

Closed Warm-rain closed 1 year ago

Warm-rain commented 1 year ago

他总是编译成为一个Linux执行文件,不管我怎么修改archs的值,十分感谢有人能够帮助我解决这个问题,以下为我编译情况,看是否还需要提供什么信息

root@liu-virtual-machine:/home/liu/Downloads/Pikafish-master/src# make build ARCH=x86-64-modern

Config: debug: 'no' sanitize: 'none' optimize: 'yes' arch: 'x86_64' bits: '64' kernel: 'Linux' os: 'GNU/Linux' prefetch: 'yes' popcnt: 'yes' pext: 'no' sse: 'yes' mmx: 'no' sse2: 'yes' ssse3: 'yes' sse41: 'yes' avx2: 'no' avxvnni: 'no' avx512: 'no' vnni256: 'no' vnni512: 'no' neon: 'no' arm_version: '0'

Flags: CXX: g++ CXXFLAGS: -Wall -Wcast-qual -fno-exceptions -std=c++17 -finput-charset=UTF-8 -fexec-charset=GBK -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto LDFLAGS: -m64 -Wl,--no-as-needed -lpthread -Wall -Wcast-qual -fno-exceptions -std=c++17 -finput-charset=UTF-8 -fexec-charset=GBK -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto -flto=jobserver

Testing config sanity. If this fails, try 'make help' ...

make ARCH=x86-64-modern COMP=gcc all make[1]: Entering directory '/home/liu/Downloads/Pikafish-master/src' g++ -o pikafish benchmark.o bitboard.o evaluate.o main.o misc.o movegen.o movepick.o position.o search.o thread.o timeman.o tt.o uci.o ucioption.o tune.o evaluate_nnue.o half_ka_v2_xq.o -m64 -Wl,--no-as-needed -lpthread -Wall -Wcast-qual -fno-exceptions -std=c++17 -finput-charset=UTF-8 -fexec-charset=GBK -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto -flto=jobserver lto-wrapper: warning: jobserver is not available: ‘--jobserver-auth=’ is not present in ‘MAKEFLAGS’ make[1]: Leaving directory '/home/liu/Downloads/Pikafish-master/src' root@liu-virtual-machine:/home/liu/Downloads/Pikafish-master/src# file pikafish pikafish: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=ecf17b62625af755184a9f7f472f5e5d41af98a9, for GNU/Linux 3.2.0, not stripped root@liu-virtual-machine:/home/liu/Downloads/Pikafish-master/src#

shuangqiao999 commented 1 year ago

可以参考Pikafish.yml 编译Windows的命令

shuangqiao999 commented 1 year ago

make -j build COMP=mingw ARCH=x86-64-modern EXE=pikafish-modern.exe && strip pikafish-modern.exe        试试这个编译命令

pickaxe919 commented 1 year ago

@Warm-rain You need mingw-w64 to cross-compile pikafish for Windows.

Warm-rain commented 1 year ago

@Warm-rain You need mingw-w64 to cross-compile pikafish for Windows.

感谢,我已经使用MSYS2编译成功,使用这个工具将会使得编译变得十分轻松。