Page 1 of 2

Problem in compiling Cfish with MSYS2

Posted: Wed Aug 16, 2023 2:03 pm
by massimilianogoi
I just don't know anymore how to compile Cfish... :sm51: When I launch the command make -j profile-build ARCH=x86-64-bmi2 COMP=mingw I get the following error:

https://pastebin.com/x7SW5cba

Code: Select all

In file included from In file included from C:/msys64/mingw64/include/minwinde
f.h:163gcc -Wall -std=c11 -fprofile-generate -pedantic -Wextra -Wshadow -Wno-pedantic-ms-format -m64 -DNDEBUG -O3 -DIS_64BIT -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -msse4 -mbmi2 -DUSE_AVX2 -mavx2 -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -msse -DUSE_SSE -DNNUE -DNNUE_EMBEDDED -flto   -c -o thread.o thread.c
                                         C:/msys64/mingw64/include/minwindef.h:163,
                 from ,gcc -Wall -std=c11 -fprofile-generate -pedantic -Wextra -Wshadow -Wno-pedantic-ms-format -m64 -DNDEBUG -O3 -DIS_64BIT -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -msse4 -mbmi2 -DUSE_AVX2 -mavx2 -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -msse -DUSE_SSE -DNNUE -DNNUE_EMBEDDED -flto   -c -o timeman.o timeman.c

                 from ,
                 from gcc -Wall -std=c11 -fprofile-generate -pedantic -Wextra -Wshadow -Wno-pedantic-ms-format -m64 -DNDEBUG -O3 -DIS_64BIT -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -msse4 -mbmi2 -DUSE_AVX2 -mavx2 -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -msse -DUSE_SSE -DNNUE -DNNUE_EMBEDDED -flto   -c -o tt.o tt.c
C:/msys64/mingw64/include/windef.h:9C:/msys64/mingw64/inclC:/msys64/mingw64/include/windef.h:9C:/msy
s64/mingw64/include/windef.h:9,
                 from gcc -Wall -std=c11 -fprofile-generate -pedantic -Wextra -Wshadow -Wno-pedantic-ms-format -m64 -DNDEBUG -O3 -DIS_64BIT -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -msse4 -mbmi2 -DUSE_AVX2 -mavx2 -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -msse -DUSE_SSE -DNNUE -DNNUE_EMBEDDED -flto   -c -o uci.o uci.c
                      ,
                 from In file included from ,
                 from                                       C:/msys64/mingw64/include/windows.h:69C:
/msys64/mingw64/include/minwindef.h:163C:/msys64/mingw64/include/windows.h:69gcc -Wall -std=c11 -fprofile-generate -pedantic -Wextra -Wshadow -Wno-pedantic-ms-format -m64 -DNDEBUG -O3 -DIS_64BIT -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -msse4 -mbmi2 -DUSE_AVX2 -mavx2 -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -msse -DUSE_SSE -DNNUE -DNNUE_EMBEDDED -flto   -c -o ucioption.o ucioption.c
,
                 from ,gcc -Wall -std=c11 -fprofile-generate -pedantic -Wextra -Wshadow -Wno-pedantic-ms-format -m64 -DNDEBUG -O3 -DIS_64BIT -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -msse4 -mbmi2 -DUSE_AVX2 -mavx2 -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -msse -DUSE_SSE -DNNUE -DNNUE_EMBEDDED -flto   -c -o numa.o numa.c

                 from                       ,
                 from ,
                 from                                           C:/msys64/mingw64/include/minwindef.
h:163gcc -Wall -std=c11 -fprofile-generate -pedantic -Wextra -Wshadow -Wno-pedantic-ms-format -m64 -DNDEBUG -O3 -DIS_64BIT -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -msse4 -mbmi2 -DUSE_AVX2 -mavx2 -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -msse -DUSE_SSE -DNNUE -DNNUE_EMBEDDED -flto   -c -o settings.o settings.c
     ,
                 from           C:/msys64/mingw64/include/windef.h:9,
                 from gcc -Wall -std=c11 -fprofile-generate -pedantic -Wextra -Wshadow -Wno-pedantic-ms-format -m64 -DNDEBUG -O3 -DIS_64BIT -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -msse4 -mbmi2 -DUSE_AVX2 -mavx2 -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -msse -DUSE_SSE -DNNUE -DNNUE_EMBEDDED -flto   -c -o polybook.o polybook.c
                      ,
                 from                                                      gcc -Wall -std=c11 -fprofile-generate -pedantic -Wextra -Wshadow -Wno-pedantic-ms-format -m64 -DNDEBUG -O3 -DIS_64BIT -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -msse4 -mbmi2 -DUSE_AVX2 -mavx2 -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -msse -DUSE_SSE -DNNUE -DNNUE_EMBEDDED -flto   -c -o nnue.o nnue.c
                                                                           ,
                 from ,
                 from ,
                 from                                     bitboard.h:26C:/msys64/mingw64/include/win
def.h:9                      ,
                 from ,
                 from ,
                 from ,
                 from                                       evaluate.c:23C:/msys64/mingw64/include/w
indows.h:69                                         bitboard.h:26                      benchmark.c:2
6C:/msys64/mingw64/include/windows.h:69,
                 from                                             :
types.h:53,
                 from C:/msys64/mingw64/include/minwindef.h:163C:/msys64/mingw64/include/minwindef.h
:163:
,
                      ,
                 from C:/msys64/mingw64/include/minwindef.h:163thread.h:50:62:               types.h
:53                                    ,
                 from ,
                 from ,
                 from misc.c:27C:/msys64/mingw64/include/windef.h:9,
                 from main.c:23 ,
                 from ,
                 from ,
                 from C:/msys64/mingw64/include/windef.h:9bitboard.h:26:
movegen.h:24C:/msys64/mingw64/include/windef.h:9:
                                              thread.h:50:62:,
                 from error: thread.h:50:62:,
                 from ,
                 from ,
                 from expected identifier before 'movepick.h:26,
                 from C:/msys64/mingw64/include/windows.h:69C:/msys64/mingw64/include/windows.h:69ex
pected identifier before ' ,
                 from C:/msys64/mingw64/include/windows.h:69( pawns.c:25          ,
                 from ,
                 from  error: types.h:53,
                 from error: ' token
   50 |   THREAD_SLEEP, THREAD_SEARCH, THREAD_TT_CLEAR, THREAD_EXIT, :
,
                 from ,
                 from types.h:53thread.h:50:62:                            movepick.c:23types.h:53ex
pected identifier before '             ' token
   50 |   THREAD_SLEEP, THREAD_SEARCH,                                           (,
                 from THREAD_RESUME(:
,
                      ,
                 from
      |                                                              thread.h:50:62:,
                 from misc.h:33bitboard.h:26
      |                                                              ' token
   50 |   THREAD_SLEEP, THREAD_SEARCH, THREAD_TT_CLEAR, THREAD_EXIT,  bitboard.h:26^~~~~~~~~~~~~^~~~
~~~~~~~~~error:            ,
                 from ,
                 from ' token
   50 |   THREAD_SLEEP                                               THREAD_RESUMEsearch.h:24,
                 from THREAD_RESUME
expected identifier before ':
 position.c:6(
      |                                                              error: In file included from tb
probe.c:12
      |
thread.h:50:62:,
                 from :
' token
                                                                     ^~~~~~~~~~~~~timeman.c:24C:/msy
s64/mingw64/include/minwindef.h:163THREAD_RESUME                                          thread.h:5
0:62::
       :
,
                 from
      |

C:/msys64/mingw64/include/windef.h:9                expected identifier before '       (^~~~~~~~~~~~
~,
                      thread.h:50:62:error:                 ' token
   50 |   THREAD_SLEEP, THREAD_SEARCH, THREAD_TT_CLEAR, THRE         error: C:/msys64/mingw64/includ
e/windows.h:69print_engine_info
':
 (                            ,
                 from ' token
   50 |   THREAD_SLEEP, THREAD_SEARCH, THREAD_TT_CLEAR, THREAD_EXIT,              misc.c:60:21:types
.h:53' token
   50                                                                (error: THREAD_RESUME
      |                                                               ,
                 from              ' token
   50 |   THREAD_SLEEP, THREAD_SEARCH, THREAD_TT_CLEAR, THREAD_EXIT,
      |                                                              ^~~~~~~~~~~~~expected identifie
r before 'endgame.h:24
      |                                                              THREAD_RESUMEvariable '^~~~~~~~
~~~~~
(,
                 from ^~~~~~~~~~~~~
      |                                                              year
' token
   50 |   THREAD_SLEEP, THREAD_SEARCH, THREAD_TT_CLEAR, THREAD_EXIT, material.h:24
             THREAD_RESUME                    ,
                 from

                                                                     -Wunused-but-set-variablethread
.c:23^~~~~~~~~~~~~]
   60 |     int day, month, :

yearthread.h:50:62:;
      |                      ^~~~error:
expected identifier before 'misc.c:60:9:( ' token
   50 |   THREAD_SLEEP, THREAD_SEARCH, THREAD_TT_CLEAR, THREAD_EXIT, warning: THREAD_RESUMEvariable
'
      |                                                              day^~~~~~~~~~~~~' set but not u
sed [
-Wunused-but-set-variable]
   60 |     int day, month, year;
      |         ^~~
In file included from C:/msys64/mingw64/include/minwindef.h:163,
                 from C:/msys64/mingw64/include/windef.h:9,
                 from C:/msys64/mingw64/include/windows.h:69,
                 from types.h:53,
                 from bitboard.h:26,
                 from tt.c:28:
thread.h:50:62: error: expected identifier before '(' token
   50 |   THREAD_SLEEP, THREAD_SEARCH, THREAD_TT_CLEAR, THREAD_EXIT, THREAD_RESUME
      |                                                              ^~~~~~~~~~~~~make[2]: *** [<builtin>: evaluate.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [<builtin>: position.o] Error 1
make[2]: *** [<builtin>: timeman.o] Error 1
make[2]: *** [<builtin>: search.o] Error 1
make[2]: *** [<builtin>: movepick.o] Error 1
make[2]: *** [<builtin>: pawns.o] Error 1
make[2]: *** [<builtin>: benchmark.o] Error 1
make[2]: *** [<builtin>: thread.o] Error 1

make[2]: *** [<builtin>: main.o] Error 1
make[2]: *** [<builtin>: tbprobe.o] Error 1
make[2]: *** [<builtin>: misc.o] Error 1
make[2]: *** [<builtin>: tt.o] Error 1
In file included from C:/msys64/mingw64/include/minwindef.h:163,
                 from C:/msys64/mingw64/include/windef.h:9,
                 from C:/msys64/mingw64/include/windows.h:69,
                 from types.h:53,
                 from evaluate.h:4,
                 from uci.c:23:
thread.h:50:62: error: expected identifier before '(' token
   50 |   THREAD_SLEEP, THREAD_SEARCH, THREAD_TT_CLEAR, THREAD_EXIT, THREAD_RESUME
      |                                                              ^~~~~~~~~~~~~
make[2]: *** [<builtin>: uci.o] Error 1
In file included from C:/msys64/mingw64/include/minwindef.h:163,
                 from C:/msys64/mingw64/include/windef.h:9,
                 from C:/msys64/mingw64/include/windows.h:69,
                 from types.h:53,
                 from nnue.h:7,
                 from settings.c:2:
thread.h:50:62: error: expected identifier before '(' token
   50 |   THREAD_SLEEP, THREAD_SEARCH, THREAD_TT_CLEAR, THREAD_EXIT, THREAD_RESUME
      |                                                              ^~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/minwindef.h:163,
                 from C:/msys64/mingw64/include/windef.h:9,
                 from C:/msys64/mingw64/include/windows.h:69,
                 from types.h:53,
                 from evaluate.h:4,
                 from ucioption.c:30:
thread.h:50:62: error: expected identifier before '(' token
   50 |   THREAD_SLEEP, THREAD_SEARCH, THREAD_TT_CLEAR, THREAD_EXIT, THREAD_RESUME
      |                                                              ^~~~~~~~~~~~~
make[2]: *** [<builtin>: settings.o] Error 1
make[2]: *** [<builtin>: ucioption.o] Error 1
In file included from C:/msys64/mingw64/include/minwindef.h:163,
                 from C:/msys64/mingw64/include/windef.h:9,
                 from C:/msys64/mingw64/include/windows.h:69,
                 from types.h:53,
                 from misc.h:33,
                 from polybook.c:5:
thread.h:50:62: error: expected identifier before '(' token
   50 |   THREAD_SLEEP, THREAD_SEARCH, THREAD_TT_CLEAR, THREAD_EXIT, THREAD_RESUME
      |                                                              ^~~~~~~~~~~~~
make[2]: *** [<builtin>: polybook.o] Error 1
make[2]: Leaving directory '/home/massimilianogoi/cfish'
make[1]: *** [Makefile:1000: gcc-profile-make] Error 2
make[1]: Leaving directory '/home/massimilianogoi/cfish'
make: *** [Makefile:871: profile-build] Error 2
Somebody, help!

Re: Problem in compiling Cfish with MSYS2

Posted: Wed Aug 16, 2023 7:11 pm
by Gannicus
Hi Max,
I don't know what code you are using and I don't know your machine, however you can change the number of processors and disable NUMA if not supported.

mingw32-make profile-build ARCH=x86-64-bmi2 lto=yes extra=yes native=yes numa=yes sparse=no -j 128 COMP=mingw

Re: Problem in compiling Cfish with MSYS2

Posted: Thu Aug 17, 2023 7:07 pm
by massimilianogoi
Gannicus wrote: Wed Aug 16, 2023 7:11 pm Hi Max,
I don't know what code you are using and I don't know your machine, however you can change the number of processors and disable NUMA if not supported.

mingw32-make profile-build ARCH=x86-64-bmi2 lto=yes extra=yes native=yes numa=yes sparse=no -j 128 COMP=mingw
Still getting the same error. Complete output: https://pastebin.com/wY7Lt7pz

I used mingw32-make profile-build ARCH=x86-64-bmi2 lto=yes extra=yes native=yes numa=yes sparse=no -j COMP=mingw

instead of mingw32-make profile-build ARCH=x86-64-bmi2 lto=yes extra=yes native=yes numa=yes sparse=no -j 128 COMP=mingw

because I don't have 128 threads. :techie-typing:

Re: Problem in compiling Cfish with MSYS2

Posted: Thu Aug 17, 2023 8:33 pm
by Gannicus
massimilianogoi wrote: Thu Aug 17, 2023 7:07 pm
Gannicus wrote: Wed Aug 16, 2023 7:11 pm Hi Max,
I don't know what code you are using and I don't know your machine, however you can change the number of processors and disable NUMA if not supported.

mingw32-make profile-build ARCH=x86-64-bmi2 lto=yes extra=yes native=yes numa=yes sparse=no -j 128 COMP=mingw
Still getting the same error. Complete output: https://pastebin.com/wY7Lt7pz

I used mingw32-make profile-build ARCH=x86-64-bmi2 lto=yes extra=yes native=yes numa=yes sparse=no -j COMP=mingw

instead of mingw32-make profile-build ARCH=x86-64-bmi2 lto=yes extra=yes native=yes numa=yes sparse=no -j 128 COMP=mingw

because I don't have 128 threads. :techie-typing:
I wrote you that you have to replace.. you have to change 128 with the total number of threads you have and disable NUMA if not supported

Send me the source you are trying to compile

Re: Problem in compiling Cfish with MSYS2

Posted: Sun Aug 20, 2023 1:37 am
by massimilianogoi
Gannicus wrote: Thu Aug 17, 2023 8:33 pmI wrote you that you have to replace.. you have to change 128 with the total number of threads you have and disable NUMA if not supported

Send me the source you are trying to compile
If you type only -j the compiler automatically assigns the maximum number of threads to the compilation process.

Here' is the source: https://we.tl/t-nNre62RfZM .

Re: Problem in compiling Cfish with MSYS2

Posted: Sun Aug 20, 2023 11:59 pm
by Gannicus
massimilianogoi wrote: Sun Aug 20, 2023 1:37 am
Gannicus wrote: Thu Aug 17, 2023 8:33 pmI wrote you that you have to replace.. you have to change 128 with the total number of

If you type only -j the compiler automatically assigns the maximum number of threads to the compilation process.

No max you are wrong
just -j is equivalent to putting nothing
to assign the maximum number you must put:

Code: Select all

-j %Number_Of_Processors%
I also corrected your misc.c file
the date code string was wrong
download from here:
https://pixeldrain.com/u/DPgweY4B

Image

Regards

M.Z

Re: Problem in compiling Cfish with MSYS2

Posted: Mon Aug 21, 2023 9:47 am
by massimilianogoi
Thank you. Sorry, but the program was meant to have that date since it's the one I have in this site for Cifsh.

You got no errors in compilation, do you?
Gannicus wrote: Sun Aug 20, 2023 11:59 pm
massimilianogoi wrote: Sun Aug 20, 2023 1:37 am
Gannicus wrote: Thu Aug 17, 2023 8:33 pmI wrote you that you have to replace.. you have to change 128 with the total number of

If you type only -j the compiler automatically assigns the maximum number of threads to the compilation process.

No max you are wrong
just -j is equivalent to putting nothing
to assign the maximum number you must put:

Code: Select all

-j %Number_Of_Processors%
I also corrected your misc.c file
the date code string was wrong
download from here:
https://pixeldrain.com/u/DPgweY4B

Image

Regards

M.Z

Re: Problem in compiling Cfish with MSYS2

Posted: Mon Aug 21, 2023 11:56 am
by Gannicus
The size is slightly smaller because I forgot to strip the 210823 version :mrgreen:

I corrected your code, this is the correct way to not get warnings during compilation:

Regards

M.Z

Image

Download Cfish 060821

Image

Re: Problem in compiling Cfish with MSYS2

Posted: Mon Aug 21, 2023 11:20 pm
by massimilianogoi
Thank you so much for your courtesy. I'm going to use your executable for the engine tournament I'm doing. But I would have preferred to know if I missed some library in my MSYS2 because it didn't compile this Cfish. It wasn't compilable even in Linux... I bet I'm missing some C library...
Gannicus wrote: Mon Aug 21, 2023 11:56 am The size is slightly smaller because I forgot to strip the 210823 version :mrgreen:

I corrected your code, this is the correct way to not get warnings during compilation:

Regards

M.Z

Image

Download Cfish 060821

Image

Re: Problem in compiling Cfish with MSYS2

Posted: Mon Aug 21, 2023 11:48 pm
by Gannicus
I don't know I don't use MSYS2.