BTW, your suggestion with bak files does not work on Linuxmcostalba wrote:Ok, I have modified sed command to write the file in one go, this should work although is ugly as hell
Code: Select all
embed-signature: @echo "Running benchmark for getting the signature ..." @$(SIGNBENCH) 2>&1 | sed -n 's/Nodes searched : \(.*\)/\/string Version\/s\/"\\(.*\\)"\/"sig-\1"\//p' > sign.txt @sed -f sign.txt -i misc.cpp @rm sign.txt
Could you please verify ?
Problem with Stockfish make signature-profile-build
Moderator: Ras
-
mcostalba
- Posts: 2684
- Joined: Sat Jun 14, 2008 9:17 pm
Re: Problem with Stockfish make signature-profile-build
-
mcostalba
- Posts: 2684
- Joined: Sat Jun 14, 2008 9:17 pm
Re: Problem with Stockfish make signature-profile-build
Yes, sorry. I have removed one -i but there is another one. Could you please test the following?zullil wrote: Fails here, as before:
Code: Select all
embed-signature:
@echo "Running benchmark for getting the signature ..."
@$(SIGNBENCH) 2>&1 | sed -n 's/Nodes searched : \(.*\)/\/string Version\/s\/"\\(.*\\)"\/"sig-\1"\//p' > sign.txt
@sed -f sign.txt misc.cpp > misc2.cpp
@mv misc2.cpp misc.cpp
@rm sign.txt
-
zullil
- Posts: 6442
- Joined: Tue Jan 09, 2007 12:31 am
- Location: PA USA
- Full name: Louis Zulli
Re: Problem with Stockfish make signature-profile-build
Works for me. Thanks.mcostalba wrote:Yes, sorry. I have removed one -i but there is another one. Could you please test the following?zullil wrote: Fails here, as before:
Code: Select all
embed-signature: @echo "Running benchmark for getting the signature ..." @$(SIGNBENCH) 2>&1 | sed -n 's/Nodes searched : \(.*\)/\/string Version\/s\/"\\(.*\\)"\/"sig-\1"\//p' > sign.txt @sed -f sign.txt misc.cpp > misc2.cpp @mv misc2.cpp misc.cpp @rm sign.txt
Code: Select all
LZsMacPro-OSX6: ~/Documents/Chess/Stockfish/src] ./stockfish
Stockfish sig-4769737 64 SSE4.2 by Tord Romstad, Marco Costalba and Joona Kiiski-
Sven
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
Re: Problem with Stockfish make signature-profile-build
Have you noticed my post above which contains a link that explains why?mcostalba wrote:BTW, your suggestion with bak files does not work on Linuxmcostalba wrote:Ok, I have modified sed command to write the file in one go, this should work although is ugly as hell
Code: Select all
embed-signature: @echo "Running benchmark for getting the signature ..." @$(SIGNBENCH) 2>&1 | sed -n 's/Nodes searched : \(.*\)/\/string Version\/s\/"\\(.*\\)"\/"sig-\1"\//p' > sign.txt @sed -f sign.txt -i misc.cpp @rm sign.txt
Could you please verify ?
Sven
-
zullil
- Posts: 6442
- Joined: Tue Jan 09, 2007 12:31 am
- Location: PA USA
- Full name: Louis Zulli
Re: Problem with Stockfish make signature-profile-build
Marco noticed. The link you found is referenced in Marco's commit fixing this issue on github.Sven Schüle wrote:Have you noticed my post above which contains a link that explains why?mcostalba wrote:BTW, your suggestion with bak files does not work on Linuxmcostalba wrote:Ok, I have modified sed command to write the file in one go, this should work although is ugly as hell
Code: Select all
embed-signature: @echo "Running benchmark for getting the signature ..." @$(SIGNBENCH) 2>&1 | sed -n 's/Nodes searched : \(.*\)/\/string Version\/s\/"\\(.*\\)"\/"sig-\1"\//p' > sign.txt @sed -f sign.txt -i misc.cpp @rm sign.txt
Could you please verify ?
Sven
By the way, the last (most recent) post on the thread you found offers a simple workaround to the issue, one which purportedly works on gnu and bsd:
This works with both GNU and BSD versions of sed:
sed -i'' -e 's/old_link/new_link/g' *
or with backup:
sed -i'.bak' -e 's/old_link/new_link/g' *
Note missing space after -i option! (Necessary for GNU sed)
-
Sven
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
Re: Problem with Stockfish make signature-profile-build
Thanks for the info!zullil wrote:Marco noticed. The link you found is referenced in Marco's commit fixing this issue on github.
I saw that but my first impression was that Marco would not like it that way (I do not like it as well, using an option immediately followed by a string literal and intentionally without any space inbetween is nothing but an ugly hack), and it seems my impression was rightzullil wrote:By the way, the last (most recent) post on the thread you found offers a simple workaround to the issue, one which purportedly works on gnu and bsd:
This works with both GNU and BSD versions of sed:
sed -i'' -e 's/old_link/new_link/g' *
or with backup:
sed -i'.bak' -e 's/old_link/new_link/g' *
Note missing space after -i option! (Necessary for GNU sed)
Sven
-
mcostalba
- Posts: 2684
- Joined: Sat Jun 14, 2008 9:17 pm
Re: Problem with Stockfish make signature-profile-build
Actually I have missed thisSven Schüle wrote:Thanks for the info!zullil wrote:Marco noticed. The link you found is referenced in Marco's commit fixing this issue on github.
I saw that but my first impression was that Marco would not like it that way (I do not like it as well, using an option immediately followed by a string literal and intentionally without any space inbetween is nothing but an ugly hack), and it seems my impression was rightzullil wrote:By the way, the last (most recent) post on the thread you found offers a simple workaround to the issue, one which purportedly works on gnu and bsd:
This works with both GNU and BSD versions of sed:
sed -i'' -e 's/old_link/new_link/g' *
or with backup:
sed -i'.bak' -e 's/old_link/new_link/g' *
Note missing space after -i option! (Necessary for GNU sed)
Sven
I agree is not so nice, but current hack of using a misc2.cpp tmp file is even uglier !
Thanks to both!
I have pushed yet another fixing patch
-
zullil
- Posts: 6442
- Joined: Tue Jan 09, 2007 12:31 am
- Location: PA USA
- Full name: Louis Zulli
Re: Problem with Stockfish make signature-profile-build
Well, you can't trust the Internet.mcostalba wrote:
Actually I have missed this
I agree is not so nice, but current hack of using a misc2.cpp tmp file is even uglier !
Thanks to both!
I have pushed yet another fixing patch
It doesn't work on OS X. Please revert to the uglier version.
Sorry.
Code: Select all
Running benchmark for getting the signature ...
sed: 1: "sign.txt": unterminated substitute pattern
make: *** [embed-signature] Error 1