#i dont know how to say it
204 messages · Page 1 of 1 (latest)
Use git grep -n "text to be searched for", the result was already pointed out by Disservin:
~/Stockfish$ git grep -n "the Stockfish developers"
src/misc.cpp:183: << "the Stockfish developers (see AUTHORS file)";
By the way Stockfish is released under GPL-3 license, you are free to modify the source code, but you must make the modified code available to users, see:
https://www.gnu.org/licenses/gpl-3.0.html
https://www.gnu.org/licenses/gpl-faq.html
The easiest way to be compliant is to fork the Stockfish official repository on Github and push your changes in your forked repository.
what about the stockfish 16 text at the beginning will that also be chanegd or
ill just release the chess engine on github
Here is "Stockfish" and his version number.
https://github.com/official-stockfish/Stockfish/blob/46756996e7884c665da18f357208c2344a0f9374/src/misc.cpp#L157
when it says "the Stockfish developers (see AUTHORS file)" is it what it prints out of the cmd prompt when opening up the exe file?
like with the stockfish 16
Im doubting that you will add new stuff
(If you are already struggling with changing a string lol)
im just tryna make sure that i dont mess around with the code
so that it wont like sef destruct itself
:d
is the 0 the version
(i dont know much code)
if im hurting your braincells im sorry
You can trigger the Continuous Integration (GitHub Actions) to check your changes: simply push the branch with your changes on the github_ci branch as well:
git switch master
git fetch -p upstream
git switch -c my_sf_version
# makes you changes and push to your repository
git push origin HEAD
# push on the branch github_ci as well to trigger the Continuous Integration
git push -f origin HEAD:github_ci
its some random test name
i havent made a name for the engine yet
is there a tutorial i can watch
He talked about << version
Here are the Actions at work on the official repository:
https://github.com/official-stockfish/Stockfish/actions
The workflows compile the source code for several OS/CPU combination and check that the code is working.
you asked if std::setfill('0') is the version. When there literally is a variable on the left side which says, version ?
idk any code @tawny fiber
then learn some code, it helps no one if you change the name and say it's your engine..
when have i said the engine is my own becasue i change the name for it
well then i dont get the purpose of any of this xd
version is the version
and you can delete the rest that follows until
ss << (to_uci ? "\nid author ": " by ")
why r u helping them lol
all i wanted to do was to change what it said on the exe when you opened it to something else
😭
string engine_info(bool to_uci) {
stringstream ss;
ss << "Something Else";
return ss.str();
}
$ ./stockfish
Something Else
so for the string thing i tried searching for keywords and i couldnt find any with this and for the second one what does it do
You simply must change the content of the body of the function string engine_info(bool to_uci), deleting all the red lines and adding the green line
diff --git a/src/misc.cpp b/src/misc.cpp
index 29ef757e9..6767a20a1 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -154,34 +154,7 @@ public:
string engine_info(bool to_uci) {
stringstream ss;
- ss << "Stockfish " << version << setfill('0');
-
- if constexpr (version == "dev")
- {
- ss << "-";
- #ifdef GIT_DATE
- ss << stringify(GIT_DATE);
- #else
- constexpr string_view months("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec");
- string month, day, year;
- stringstream date(__DATE__); // From compiler, format is "Sep 21 2008"
-
- date >> month >> day >> year;
- ss << year << setw(2) << setfill('0') << (1 + months.find(month) / 4) << setw(2) << setfill('0') << day;
- #endif
-
- ss << "-";
-
- #ifdef GIT_SHA
- ss << stringify(GIT_SHA);
- #else
- ss << "nogit";
- #endif
- }
-
- ss << (to_uci ? "\nid author ": " by ")
- << "the Stockfish developers (see AUTHORS file)";
-
+ ss << "Something Else";
return ss.str();
}
To make the story short the function must be:
string engine_info(bool to_uci) {
stringstream ss;
ss << "Something Else";
return ss.str();
}
Then compile the code with: make -j build ARCH=x86-64
Read the wiki to install a compiler https://github.com/official-stockfish/Stockfish/wiki/Compiling-from-source
so delete all the things highlighted in red
and add ss<<"-";
so i add + ss << "Something Else"; but delete everything else
No, it must be:
string engine_info(bool to_uci) {
stringstream ss;
ss << "Something Else";
return ss.str();
}
like this?
Delete the last closing brace (the yellow one)
so like this then
Yes
okay so when i save main.cpp and load it up it should change the name
to something else
string engine_info(bool to_uci) {
return "Something Else";
}
this should have done the job as well :p
main.cpp?, the file you just edited was hopefully misc.cpp
nono not main i mean misc
i get words mixed up
and what do you mean by "load it up"
like when i run the exe
read the end of this message again
- ss << "Something Else";
return ss.str();
}
or smth
the end.
return ss.str();
}
?
Then compile the code with: make -j build ARCH=x86-64
Read the wiki to install a compiler https://github.com/official-stockfish/Stockfish/wiki/Compiling-from-source
where should i run this
@faint shard
I suppose you are on windows, steps:
okay i've installed it now what
4 minutes that was fast
i have a 5 year old laptop
- follow these instructions to download and compile the official Stockfish https://github.com/official-stockfish/Stockfish/wiki/Compiling-from-source#gcc
- if successful, edit the file
misc.cppwith your changes
That is a Msys shell, close it, and open a MinGW x64 shell, double click on C:\msys64\mingw64.exe if you have installed msys2 with the official installer or C:\tools\msys64\mingw64.exe if you have used chocolatey. In the folder C:\msys64\home\<your_username> (or C:\tools\msys64\home\<your_username> if you have used chocolatey) write a text file named makefish.sh
Run it with bash makefish.sh
#!/bin/bash
# makefish.sh
# install packages if not already installed
pacman -S --noconfirm --needed unzip make mingw-w64-x86_64-gcc
branch='master'
github_user='official-stockfish'
# download the Stockfish source code
wget -O ${branch}.zip https://github.com/${github_user}/Stockfish/archive/refs/heads/${branch}.zip
unzip -o ${branch}.zip
cd Stockfish-${branch}/src
file_nnue=$(grep 'define.*EvalFileDefaultName' evaluate.h | grep -Ewo 'nn-[a-z0-9]{12}.nnue')
ls *.nnue | grep -v ${file_nnue} | xargs -d '\n' -r rm --
# check all given flags
check_flags () {
for flag; do
printf '%s\n' "$flags" | grep -q -w "$flag" || return 1
done
}
# find the CPU architecture
output=$(g++ -Q -march=native --help=target)
flags=$(printf '%s\n' "$output" | awk '/\[enabled\]/ {print substr($1, 3)}' | tr '\n' ' ')
arch=$(printf '%s\n' "$output" | awk '/march/ {print $NF; exit}' | tr -d '[:space:]')
if check_flags 'avx512vnni' 'avx512dq' 'avx512f' 'avx512bw' 'avx512vl'; then
arch_cpu='x86-64-vnni256'
elif check_flags 'avx512f' 'avx512bw'; then
arch_cpu='x86-64-avx512'
elif check_flags 'bmi2' && [ $arch != 'znver1' ] && [ $arch != 'znver2' ]; then
arch_cpu='x86-64-bmi2'
elif check_flags 'avx2'; then
arch_cpu='x86-64-avx2'
elif check_flags 'sse4.1' 'popcnt'; then
arch_cpu='x86-64-sse41-popcnt'
elif check_flags 'ssse3'; then
arch_cpu='x86-64-ssse3'
elif check_flags 'sse3' 'popcnt'; then
arch_cpu='x86-64-sse3-popcnt'
else
arch_cpu='x86-64'
fi
# build the fastest Stockfish executable
make -j profile-build ARCH=${arch_cpu} COMP=mingw
make strip
mv stockfish.exe ../../stockfish_${arch_cpu}.exe
make clean
cd
so like this?
what do you mean by edit misc.cpp when ive already edited it
Do you have edited the misc.cpp file on your PC?
you have told me to do this
.
Open a MinGWx64 shell run this command pacman -S --noconfirm --needed unzip make mingw-w64-x86_64-gcc.
Move the Sotckfish folder with the modified file in C:\msys64\home\<your_username> (or C:\tools\msys64\home\<your_username> if you have used chocolatey)
Then write these commands:
cd Stockfish/src
make -j ARCH=x86-64 COMP=mingw
Beware that you should be able to understand any command suggested on the web before running on your PC.
No, follow the instruction and start learning.
so i ran the command
so do i have to move my modified stockfish folder into the ddirectory you gave me?
yes
Open a MinGWx64 shell and run this command pacman -S --noconfirm --needed unzip make mingw-w64-x86_64-gcc.
Then write these commands:
cd <your_misterious_folder_name>/src
make -j ARCH=x86-64 COMP=mingw
ive already done that before i put the file in these
Then write these commands:
cd <your_misterious_folder_name>/src
make -j ARCH=x86-64 COMP=mingw
in mingw32?
@faint shard
error target not found
Run this: pacman -Syuu --needed --noconfirm
The shell should inform you that it neede to be closed. Close it, restart a new shell and run for a second time pacman -Syuu --needed --noconfirm
Then run pacman -S --noconfirm --needed unzip make mingw-w64-x86_64-gcc
Open a MinGW x64 shell, double click on C:\msys64\mingw64.exe
I simply copied and pasted instructions already wrote in previous posts.
what should i copy and paste
this?
My fault. I should have written more clearly that in the past 8 hours I simply copied and pasted instructions already written in previous posts or written in the wiki. You should have already read them by yourself. It seems that you don't want support to solve an issue but simply to waste the time of the people that try to help you.
Sorry but I and the other maintainers are moving some repositories under the Organization, so I need to stay focused to avoid errors.
im not trying to waste time ive been trying to fix this problem already ive alreayd read whats about on the wiki
Typo
You are running MinGW 32 shell, look at your picture, and you wrote pacam, look at your picture.
I wonder why is so hard to read and execute the instructions:
- open a MinGW x64 shell, double clicking on
C:\msys64\mingw64.exe - run
pacman -Syuu --needed --noconfirm - close the shell when requested
- open a MinGW x64 shell, double clicking on
C:\msys64\mingw64.exe - run
pacman -Syuu --needed --noconfirmfor the second time - run
pacman -S --noconfirm --needed unzip make mingw-w64-x86_64-gcc
i ran all the commands you sent
Now you should be able to run, in a MinGW x64 shell
cd your_secret_folder_name/srcmake -j build ARCH=x86-64 COMP=mingw
ok i did it
When the compilation is finished, run:
./stockfish
You should view your custom Welcome message.
Wait a minute, we need one more step.
ok
We need to know the architecture of your CPU to build the fastest Stockfish.
Open a new MinGW x64 shell and run this command:
curl -sSL https://raw.githubusercontent.com/ppigazzini/stockfish-downloader/main/posix_helper.sh | sh -s
This downloads the official Stockfish optimized for your CPU, let me know the name of the zip file downloaded.
so i run a mingw x64 and what i do for the first step
Copy and paste this line, then push the "Enter" key.
curl -sSL https://raw.githubusercontent.com/ppigazzini/stockfish-downloader/main/posix_helper.sh | sh -s
u cannot copy and paste this
cuz then for me it would show a v
and thats it
Try to paste with a right click, otherwise you need to write the command.
nevermind
@faint shard i dont understand why you need this to know how fast stockfish runs on my laptop
Wow, a very recent CPU, AMD Ryzen I suppose 🙂
Now in the first MinGW64 shell still opened in your secret folder, we rebuild Stockfish optimized for your CPU and with the Profile Guided Optimization (profile-build instead than the previous build):
make clean
make -j profile-build ARCH=x86-64-avx512 COMP=mingw
make strip
intel core i7
do i copy and paste these 1 by 1 or all in once
make clean
make -j profile-build ARCH=x86-64-avx512 COMP=mingw
make strip
It should work pasting all the lines as well, be sure to push a couple of time the "Enter" key to execute the last command.
could you rephrase that last part again i couldnt understand on what you meany by that
i think it broke too
Sometimes, when pasting more than one command in a shell, the last command is not executed and need an extra push on the "Enter" key.
You need to enter in your secret folder, the tilde ~ means that you are still in your HOME folder.
cd your_secret_folder/src
uhhhhhhhh
oh wait
do i change the secret folder to the current folder i have in the home folder?
Yes, you never shared the foldername
Do you have still opened the MinGW64 shell where the compilation has worked?
yes
Write in that shell the commands:
make clean
make -j profile-build ARCH=x86-64-avx512 COMP=mingw
make strip
No, it's not that shell, the tilde mean that the current path is your $HOME
so its already in my hone
i think it was when i had the secret folder copied and pasted
Open with file explorer C:\msys64\home\kadeu, you should view your secret folder.
Write in a MinGW 64 shell the commands:
cd stockfish/src
make clean
make -j profile-build ARCH=x86-64-avx512 COMP=mingw
make strip
Yes, the compiler enabled the instructions for your very advanced CPU.
Now you can run:
./stockfish bench
You will get when finished the "Nodes / second" number, it's the speed of your CPU when running Stockfish.
so i ran it
===========================
Total time (ms) : 6025
Nodes searched : 2593605
Nodes/second : 430473
i also found something weird
and i think bad
i open up the winrar file that was build
and looked into it
now irt just says this
That is the last developer build downloaded from https://github.com/official-stockfish/Stockfish/releases
is it good?
The last developer build is the stronger version. It's the same version that you built yourself from the source code.
ah ok
Ok, I think to have finished my duty here, enjoy your night.
this one
Use your custom build, it's the file C:\msys64\home\kadeu\stockfish\src\stockfish.exe
Open the file C:\msys64\home\kadeu\stockfish\src\misc.cpp with a text editor, change the function, redo all the command
cd ~/stockfish/src
make clean
make -j profile-build ARCH=x86-64-avx512 COMP=mingw
make strip
so redo all the code where you delete lines of code then adding code
string engine_info(bool to_uci) {
stringstream ss;
ss << "Something Else";
return ss.str();
}
this one
Yes
And you ran all of this after changing that in the file?
he saying to build stockfish and then change it
The change needs to be saved before the make commands are run
He did?
"Open the file C:\msys64\home\kadeu\stockfish\src\misc.cpp with a text editor, change the function, redo all the command "
so extract the file
change it
and then redo every command
ive already ran all of these
there are no problems
there is just one problem thats been on my mind that i cannot understand
this image
ive ran everything
no problems
double checked everything
but its still somehow not working
what is the exact file you are changing?
Actually, what is that filepath? Check C:\msys64\home\kadeu\stockfish\src\stockfish.exe
That is the official dev Stockfish binary downloaded with the donwloader script to view his CPU ARCH.
i can send you the current development of stockfish that i currently built