syzygy1 / Cfish

C port of Stockfish
GNU General Public License v3.0
137 stars 59 forks source link

Tried to build it by use of clang with error #101

Closed abdulbadii closed 4 years ago

abdulbadii commented 5 years ago

tried to build by use of clang with error:

$ make profile-build ARCH=x86-64-modern COMP=clang lto=yes extra=yes

...

...
clang -o cfish benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o material.o misc.o movegen.o movepick.o pawns.o position.o psqt.o search.o tbprobe.o thread.o timeman.o tt.o uci.o ucioption.o numa.o settings.o polybook.o -fprofile-instr-generate -lm -m64 -lpthread -Wall -std=c11 -fprofile-instr-generate  -pedantic -Wextra -Wshadow -Wno-missing-braces -Wno-missing-field-initializers -Wno-unknown-attributes -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -march=native -DNUMA -flto
benchmark.o: file not recognized: File format not recognized
clang: error: linker command failed with exit code 1 (use -v to see invocation)
...

How to troubleshoot such ? Thanks

syzygy1 commented 5 years ago

Start by doing make clean. Then you need to remove extra=yes which is intended for gcc-7.x (see the instructions).

d3vv commented 5 years ago

@syzygy1 , Sure that is another error.. Guess he try to use clang into windows (mingw) But clang PGO can work with COFF only and it doesn't work into windows at now days yet.

asgawr commented 5 years ago

I tried with different CLang compilers but unsuccessful with my windows system. Also tried vs2014 & Intel psxe 2017 but no luck. Can somebody give a short guide on how to compile CFish in windows?

syzygy1 commented 5 years ago

Install 64-bit MinGW and compile with gcc.

asgawr commented 5 years ago

Thanks for the quick response. I was able to compile CFish with MinGW GG810 & also with Cygwin DLL using GG810 in Windows. In Winodws, Cygwin was able to compile with the original Makefile, but MinGW needed a little bit tweaking of Makefile before it can successfully compile it. Thanks again...