Ethereal-14.00 compiling under Windows10

Discussion of chess software programming and technical issues.

Moderator: Ras

chessica
Posts: 919
Joined: Thu Aug 11, 2022 11:30 pm
Full name: Esmeralda Pinto

Ethereal-14.00 compiling under Windows10

Post by chessica »

Hello, I'm trying to compile Ethereal under Windows 10, but I can't. In my virtual
Linux machine, however, I managed to do it without any problems. But then I can
only use it under Linux, which is not so great. In the source files I didn't see any
hints for compiling under Windows. I assume this is due to pthread. Can someone
give me a recipe for my problem here?
tmokonen
Posts: 1355
Joined: Sun Mar 12, 2006 6:46 pm
Location: Kelowna
Full name: Tony Mokonen

Re: Ethereal-14.00 compiling under Windows10

Post by tmokonen »

Are you familiar with using MSYS2? I have used that successfully to build Ethereal 14.00 with Clang in MSYS2's UCRT64 environment. The makefile is already pre-configured to use Clang. I was getting a weird "unable to pass LLVM bit-code files to linker" error message when making the executables, which had something to do with the -flto command line option for link time optimization, but worked around it by adding -fuse=ld-ldd to the command line options in lines 44-46 of the makefile.
chessica
Posts: 919
Joined: Thu Aug 11, 2022 11:30 pm
Full name: Esmeralda Pinto

Re: Ethereal-14.00 compiling under Windows10

Post by chessica »

OK, I see the same Error under ucrt64


Privat@Privat-PC UCRT64 /Ethereal-14.00/src
$ make
rm -f *.gcda pyrrhic/*.gcda nnue/*.gcda *.profdata *.profraw
clang -fprofile-instr-generate -O3 -std=gnu11 -Wall -Wextra -Wshadow -DNDEBUG -flto -DUSE_NNUE=0 -march=native -DUSE_POPCNT -fno-asynchronous-unwind-tables *.c pyrrhic/tbprobe.c -lpthread -lm -o Ethereal
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
make: *** [makefile:109: pgo] Error 1

snip from original makefile:

WFLAGS = -std=gnu11 -Wall -Wextra -Wshadow
RFLAGS = -O3 $(WFLAGS) -DNDEBUG -flto $(NN) $(NNFLAGS) -static
CFLAGS = -O3 $(WFLAGS) -DNDEBUG -flto $(NN) $(NNFLAGS) -march=native
TFLAGS = -O3 $(WFLAGS) -DNDEBUG -flto $(NN) $(NNFLAGS) -march=native -fopenmp -DTUNE
PGOFLAGS = -fno-asynchronous-unwind-tables

Privat@Privat-PC UCRT64 /Ethereal-14.00/src


With edited makefile Igot this error:

Privat@Privat-PC UCRT64 /Ethereal-14.00/src
$ make
rm -f *.gcda pyrrhic/*.gcda nnue/*.gcda *.profdata *.profraw
clang -fprofile-instr-generate -O3 -std=gnu11 -Wall -Wextra -Wshadow -DNDEBUG -flto -DUSE_NNUE=0 -march=native -fuse=ld-ldd -DUSE_POPCNT -fno-asynchronous-unwind-tables *.c pyrrhic/tbprobe.c -lpthread -lm -o Ethereal
clang: error: unknown argument: '-fuse=ld-ldd'
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
clang: error: 'x86_64-w64-windows-gnu': unable to pass LLVM bit-code files to linker
make: *** [makefile:109: pgo] Error 1

Privat@Privat-PC UCRT64 /Ethereal-14.00/src


Can you show me the right command file?
Last edited by chessica on Thu Aug 24, 2023 9:29 am, edited 1 time in total.
User avatar
Look
Posts: 382
Joined: Thu Jun 05, 2014 2:14 pm
Location: Iran
Full name: Mehdi Amini

Re: Ethereal-14.00 compiling under Windows10

Post by Look »

You may produce a cmake file for project. Run it for Visual Studio to generate a VS solution. Compile the VS solution with clang compiler supplied with VS.
Farewell.
User avatar
Look
Posts: 382
Joined: Thu Jun 05, 2014 2:14 pm
Location: Iran
Full name: Mehdi Amini

Re: Ethereal-14.00 compiling under Windows10

Post by Look »

Sorry I did it for Cfish code and I was able to compile and run it on windows. But Cfish has particular code for windows case. Code standard here was c11. Still such a c11threads library might be usable.
Farewell.
tmokonen
Posts: 1355
Joined: Sun Mar 12, 2006 6:46 pm
Location: Kelowna
Full name: Tony Mokonen

Re: Ethereal-14.00 compiling under Windows10

Post by tmokonen »

I'm sorry, I mistyped that command line option. It's supposed to be -fuse-ld=lld
chessica
Posts: 919
Joined: Thu Aug 11, 2022 11:30 pm
Full name: Esmeralda Pinto

Re: Ethereal-14.00 compiling under Windows10

Post by chessica »

Ok, it look better, but...

Privat@Privat-PC UCRT64 /ethereal-14.00/src
$ make
rm -f *.gcda pyrrhic/*.gcda nnue/*.gcda *.profdata *.profraw
clang -fprofile-instr-generate -O3 -std=gnu11 -Wall -Wextra -Wshadow -DNDEBUG -flto -DUSE_NNUE=0 -march=native -fuse-ld=lld -DUSE_POPCNT -fno-asynchronous-unwind-tables *.c pyrrhic/tbprobe.c -lpthread -lm -o Ethereal
clang: error: invalid linker name in argument '-fuse-ld=lld'
make: *** [makefile:109: pgo] Error 1

Privat@Privat-PC UCRT64 /ethereal-14.00/src
tmokonen
Posts: 1355
Joined: Sun Mar 12, 2006 6:46 pm
Location: Kelowna
Full name: Tony Mokonen

Re: Ethereal-14.00 compiling under Windows10

Post by tmokonen »

chessica wrote: Thu Aug 24, 2023 8:21 pm Ok, it look better, but...

Privat@Privat-PC UCRT64 /ethereal-14.00/src
$ make
rm -f *.gcda pyrrhic/*.gcda nnue/*.gcda *.profdata *.profraw
clang -fprofile-instr-generate -O3 -std=gnu11 -Wall -Wextra -Wshadow -DNDEBUG -flto -DUSE_NNUE=0 -march=native -fuse-ld=lld -DUSE_POPCNT -fno-asynchronous-unwind-tables *.c pyrrhic/tbprobe.c -lpthread -lm -o Ethereal
clang: error: invalid linker name in argument '-fuse-ld=lld'
make: *** [makefile:109: pgo] Error 1

Privat@Privat-PC UCRT64 /ethereal-14.00/src
You have to make sure that you download all the dependencies as well. Sorry if I'm not being as helpful as I could be, but I am no expert on the environment, and generally just Google things, run pacman, and hope for the best.

https://solarianprogrammer.com/2021/06/ ... mingw-w64/
chessica
Posts: 919
Joined: Thu Aug 11, 2022 11:30 pm
Full name: Esmeralda Pinto

Re: Ethereal-14.00 compiling under Windows10

Post by chessica »

Good morning Tony,

Thank you very much for your help, and it also helped to reduce the errors when compiling. :D

It's a nuisance to deal with. I only get on in bits and pieces, from sticks to sticks, that's what we say.

In addition, when I search the Internet on the PC, I get different results than when I search with
the iPad. If I take a closer look at my last error message, I notice that the linker name is probably
wrong, I probably don't have the right one.



When I search in file explorer, the ld is displayed and not the lld. :oops:
chessica
Posts: 919
Joined: Thu Aug 11, 2022 11:30 pm
Full name: Esmeralda Pinto

Re: Ethereal-14.00 compiling under Windows10

Post by chessica »

Hi all,

now it works... :D :D :D

How?

I taked the original makefile and edit the compiler from clang to gcc.

The exe file was created, but it coms with an error message. This file was missing: libwinpthread-1.dll.

I searched for it and put it into the engine-file.

Not the right way, but it works.

Privat@Privat-PC UCRT64 /ethereal-14.00/src
$ make
lto-wrapper.exe: warning: using serial compilation of 4 LTRANS jobs
lto-wrapper.exe: note: see the '-flto' option documentation for more information
search.c: In function 'search':
search.c:692:45: warning: 'value' may be used uninitialized [-Wmaybe-uninitialized]
692 | if (PvNode && (played == 1 || value > alpha))
| ^
search.c:303:15: note: 'value' was declared here
303 | int eval, value, best = -MATE, syzygyMax = MATE, syzygyMin = -MATE, seeMargin[2];
| ^
./Ethereal bench > /dev/null 2>&1
gcc -fprofile-use -O3 -std=gnu11 -Wall -Wextra -Wshadow -DNDEBUG -flto -DUSE_NNUE=0 -march=native -DUSE_POPCNT -fno-asynchronous-unwind-tables *.c pyrrhic/tbprobe.c -lpthread -lm -o Ethereal
lto-wrapper.exe: warning: using serial compilation of 2 LTRANS jobs
lto-wrapper.exe: note: see the '-flto' option documentation for more information
search.c: In function 'search':
search.c:692:45: warning: 'value' may be used uninitialized [-Wmaybe-uninitialized]
692 | if (PvNode && (played == 1 || value > alpha))
| ^
search.c:303:15: note: 'value' was declared here
303 | int eval, value, best = -MATE, syzygyMax = MATE, syzygyMin = -MATE, seeMargin[2];
| ^
rm -f *.gcda pyrrhic/*.gcda nnue/*.gcda *.profdata *.profraw

Privat@Privat-PC UCRT64 /ethereal-14.00/src