Chess engines compilation

Moderators: Elijah, Igbo, timetraveller

catalano7777

Top contribute Forum
Forum Contributions
Points: 5 554,00 
Posts: 134
Joined: 02/01/2020, 1:08
Status: Offline (Active 10 Hours, 33 Minutes ago)
Medals: 1
Topics: 13
Reputation: 149
Has thanked: 233 times
Been thanked: 264 times

Chess engines compilation

Post by catalano7777 »

MichaelM wrote: 14/07/2023, 14:21
catalano7777 wrote: 14/07/2023, 14:16
sarona wrote: 14/07/2023, 13:53 I think you are missing experience.cpp for an object file compilation.

### Source and object files
SRCS = benchmark.cpp bitboard.cpp evaluate.cpp main.cpp experience.cpp \
misc.cpp movegen.cpp movepick.cpp position.cpp psqt.cpp \
search.cpp thread.cpp timeman.cpp tt.cpp uci.cpp ucioption.cpp tune.cpp syzygy/tbprobe.cpp \
nnue/evaluate_nnue.cpp nnue/features/half_ka_v2_hm.cpp \
book/book.cpp book/polyglot/polyglot.cpp book/ctg/ctg.cpp

After adding it to the makefile, it compiled for me.
Thank you, Sarona,
but, as you can see, experience.cpp file is in my folder
Image
I think there must be an error with patch updating to SF MZ version...
As Sarona said: You have to CHANGE the Makefile according to his advices.
Ahhh, ok! I had misunderstood the instruction.
Finally, after fixing the Makefile, the build worked.
Thanks a lot!
catalano7777

Top contribute Forum
Forum Contributions
Points: 5 554,00 
Posts: 134
Joined: 02/01/2020, 1:08
Status: Offline (Active 10 Hours, 33 Minutes ago)
Medals: 1
Topics: 13
Reputation: 149
Has thanked: 233 times
Been thanked: 264 times

Chess engines compilation

Post by catalano7777 »

sarona wrote: 14/07/2023, 14:58
sarona wrote: 14/07/2023, 13:53 I think you are missing experience.cpp for an object file compilation.

### Source and object files
SRCS = benchmark.cpp bitboard.cpp evaluate.cpp main.cpp experience.cpp \
misc.cpp movegen.cpp movepick.cpp position.cpp psqt.cpp \
search.cpp thread.cpp timeman.cpp tt.cpp uci.cpp ucioption.cpp tune.cpp syzygy/tbprobe.cpp \
nnue/evaluate_nnue.cpp nnue/features/half_ka_v2_hm.cpp \
book/book.cpp book/polyglot/polyglot.cpp book/ctg/ctg.cpp

After adding it to the makefile, it compiled for me.
The declaration is missing in the Makefile. I do not know the specfic line number. Can't check at the moment (using my phone).
Thank you very much, sarona!! It worked perfect.

The line number is #59
sarona

Top contribute Forum
Chief moderators
Points: 20 167,00 
Forum Contributions
Posts: 227
Joined: 14/08/2022, 20:09
Status: Offline (Active 3 Hours, 55 Minutes ago)
Medals: 1
Topics: 8
Reputation: 1784
Has thanked: 360 times
Been thanked: 1463 times

Chess engines compilation

Post by sarona »

I would have been clearer had I been home. I was reading through the forum on my phone while eating breakfast in a small diner ( worst pancakes ever :boh: ) and read through your compiler log.

Use WinMerge to compare sources with Windows OSs. Very good tool for such tasks. I think M.Z mentioned this years ago.
kramnik

Top contribute Forum
Forum Contributions
Points: 40 305,00 
Posts: 1924
Joined: 04/11/2019, 14:45
Status: Offline (Active 3 Months, 6 Days, 22 Hours, 32 Minutes ago)
Medals: 1
Topics: 71
Reputation: 2388
Location: North-Italy
Has thanked: 1185 times
Been thanked: 2951 times

Chess engines compilation

Post by kramnik »

If possible, try to always embed the NNUE network.

and add this parameter to the compiling command: COMP=mingw. If for some reason the compiler uses COMP=gcc, the produced executable won't work outside the compiler environment without its relative libraries.

Proper compiling command example:
make -j profile-build ARCH=x86-64-bmi2 COMP=mingw

angel44e wrote: 11/07/2023, 14:57 I have some problems with engines compiled with MingW and msys2.When I click on compiled .exe file when it's still in folder src and run bench it's ok and run normally.But when I move the engine.exe anywhere,when click on .exe and run bench it's only flashes and command window dissapears.If I put the engine in Arena GUI it's running properly.What could be causing this problem? sm59
P.S. I"ve reinstalled MingW and msys2,but the problem had remained.
Igbo

Top contribute Forum Book Maker
Global moderators
Points: 78 856,00 
Forum Contributions
Posts: 670
Joined: 21/03/2022, 20:57
Status: Offline (Active 4 Hours, 55 Minutes ago)
Medals: 2
Topics: 41
Reputation: 2963
Location: terrassa, Spain
Has thanked: 700 times
Been thanked: 4046 times

Chess engines compilation

Post by Igbo »

A few months ago from debian I managed to compile, but from windows, not even wanting to. Of course I don't know how to program, etc. And I'm sure I left something. I have tried to do it as Mz comments. the variables in your path and the same with the lib folder. But nothing, the console says that it is not a valid directory, etc. I am clumsy and of course when you are faced with an unknown language, I imagine that someone who knows how to program sees it as easy, but I despair.... hehehehhe.
I am not an expert in anything, I do not believe in anything, but everything is possible.
catalano7777

Top contribute Forum
Forum Contributions
Points: 5 554,00 
Posts: 134
Joined: 02/01/2020, 1:08
Status: Offline (Active 10 Hours, 33 Minutes ago)
Medals: 1
Topics: 13
Reputation: 149
Has thanked: 233 times
Been thanked: 264 times

Chess engines compilation

Post by catalano7777 »

kramnik wrote: 14/07/2023, 22:36 If possible, try to always embed the NNUE network.

and add this parameter to the compiling command: COMP=mingw. If for some reason the compiler uses COMP=gcc, the produced executable won't work outside the compiler environment without its relative libraries.

Proper compiling command example:
make -j profile-build ARCH=x86-64-bmi2 COMP=mingw

angel44e wrote: 11/07/2023, 14:57 I have some problems with engines compiled with MingW and msys2.When I click on compiled .exe file when it's still in folder src and run bench it's ok and run normally.But when I move the engine.exe anywhere,when click on .exe and run bench it's only flashes and command window dissapears.If I put the engine in Arena GUI it's running properly.What could be causing this problem? sm59
P.S. I"ve reinstalled MingW and msys2,but the problem had remained.
DO you know which lines should I add to make NNUE embed network in c++ files?

Thank you!
sarona

Top contribute Forum
Chief moderators
Points: 20 167,00 
Forum Contributions
Posts: 227
Joined: 14/08/2022, 20:09
Status: Offline (Active 3 Hours, 55 Minutes ago)
Medals: 1
Topics: 8
Reputation: 1784
Has thanked: 360 times
Been thanked: 1463 times

Chess engines compilation

Post by sarona »

Current Stockfish development makefile has embedding set as default in line 370.

For embedded net
CXXFLAGS = $(ENV_CXXFLAGS) -Wall -Wcast-qual -fno-exceptions -std=c++17 $(EXTRACXXFLAGS)

For external net
CXXFLAGS = $(ENV_CXXFLAGS) -Wall -Wcast-qual -fno-exceptions -std=c++17 -DNNUE_EMBEDDING_OFF $(EXTRACXXFLAGS)
sssergI
Inactive User
Points: 70,00 
Posts: 6
Joined: 25/01/2020, 10:02
Status: Offline (Active 3 Months, 4 Weeks, 3 Hours, 18 Minutes ago)
Topics: 0
Reputation: 0
Has thanked: 9 times
Been thanked: 6 times

Chess engines compilation

Post by sssergI »

The compilation error only concerns Brain Learn.
Antique

Top contribute Forum
Forum Contributions
Points: 12 460,00 
Posts: 55
Joined: 27/02/2023, 12:15
Status: Offline (Active 19 Hours, 26 Minutes ago)
Medals: 1
Topics: 12
Reputation: 11
Has thanked: 7 times
Been thanked: 70 times

Chess engines compilation

Post by Antique »

Hello. Where i can download MinGW GCC 10.2.0? If possible an official site with compilers thankyou
timetraveller

Top contribute Forum Top Active Users
Global moderators
Points: 6 310,00 
Forum Contributions
Posts: 2147
Joined: 01/11/2019, 14:27
Status: Offline (Active 4 Hours, 46 Minutes ago)
Medals: 2
Topics: 351
Reputation: 392
Location: Biergarten
Has thanked: 1920 times
Been thanked: 4098 times

Chess engines compilation

Post by timetraveller »

Antique wrote: 15/09/2023, 9:54 Hello. Where i can download MinGW GCC 10.2.0? If possible an official site with compilers thankyou
https://github.com/brechtsanders/winlibs_mingw/tags

https://winlibs.com/
IbaiBuR

Top contribute Forum
Administrators
Points: 7 707,00 
Forum Contributions
Posts: 149
Joined: 05/01/2021, 15:29
Status: Offline (Active 18 Hours, 6 Minutes ago)
Medals: 1
Topics: 6
Reputation: 252
Location: Madrid, ES
Has thanked: 64 times
Been thanked: 319 times

Chess engines compilation

Post by IbaiBuR »

sssergI wrote: 28/08/2023, 14:11 The compilation error only concerns Brain Learn.
I guess the error you are getting is related to curl, right? Or can you specify whats the error?

If it is the curl related error probably when you try to compile it it says:"curl/curl.h file does not exist" or something similar.

In my case, under Ubuntu 22.04 I managed to fix it in this way:

Code: Select all

sudo apt-get install libcurl4-openssl-dev
cd /usr/include/x86_64-linux-gnu
sudo mv curl ..
Hope it helps,

Ibai
Antique

Top contribute Forum
Forum Contributions
Points: 12 460,00 
Posts: 55
Joined: 27/02/2023, 12:15
Status: Offline (Active 19 Hours, 26 Minutes ago)
Medals: 1
Topics: 12
Reputation: 11
Has thanked: 7 times
Been thanked: 70 times

Chess engines compilation

Post by Antique »

timetraveller wrote: 15/09/2023, 10:33
Antique wrote: 15/09/2023, 9:54 Hello. Where i can download MinGW GCC 10.2.0? If possible an official site with compilers thankyou
https://github.com/brechtsanders/winlibs_mingw/tags

https://winlibs.com/
If anyone have, can post a link with this compiler _ase4 I see that was deleted

https://github.com/brechtsanders/winlibs_mingw/releases/tag/10.2.0-11.-9.0.0-r2
M.Z

Top contribute Forum Engines Maker
Founder
Points: 31 381,00 
Forum Contributions
Posts: 1457
Joined: 31/10/2019, 8:50
Status: Offline (Active 5 Hours, 23 Minutes ago)
Medals: 2
Topics: 217
Reputation: 4119
Has thanked: 655 times
Been thanked: 3112 times

Chess engines compilation

Post by M.Z »

32
the curl folder to:
i686-w64-mingw32\include\
file libcurl.a to:
i686-w64-mingw32\lib

64
the curl folder to:
x86_w64-mingw32\include
file libcurl.a to:
x86_w64-mingw32\lib

Curl library 32-64 Bit

Need for livebook
OrgZ
I've been banned!
Points: 3 164,00 
Posts: 154
Joined: 16/02/2023, 13:14
Warnings: 1
Status: Offline (Active 3 Weeks, 5 Days, 14 Hours, 1 Minute ago)
Topics: 8
Reputation: 611
1
Has thanked: 511 times
Been thanked: 733 times

Chess engines compilation

Post by OrgZ »

M.Z wrote: 15/09/2023, 13:25 32
the curl folder to:
i686-w64-mingw32\include\
file libcurl.a to:
i686-w64-mingw32\lib

64
the curl folder to:
x86_w64-mingw32\include
file libcurl.a to:
x86_w64-mingw32\lib

Curl library 32-64 Bit

Need for livebook
Tnx i was having trouble installing this in msys2 wfgwg
Post Reply

Return to “Programming, Technical Discussions, Chess related questions etc.”