Discussion of chess software programming and technical issues.
Moderators: hgm , Dann Corbit , Harvey Williamson
zullil
Posts: 6442 Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli
Post
by zullil » Fri Jul 19, 2013 2:55 pm
Code: Select all
Running benchmark for getting the signature ...
sed: -e: No such file or directory
make: *** [embed-signature] Error 1
This much works:
Code: Select all
LZsMacPro-OSX6: ~/Documents/Chess/Stockfish/src] more sign.txt
4769737
mcostalba
Posts: 2684 Joined: Sat Jun 14, 2008 9:17 pm
Post
by mcostalba » Fri Jul 19, 2013 4:14 pm
zullil wrote: Code: Select all
Running benchmark for getting the signature ...
sed: -e: No such file or directory
make: *** [embed-signature] Error 1
This much works:
Code: Select all
LZsMacPro-OSX6: ~/Documents/Chess/Stockfish/src] more sign.txt
4769737
it seems 'sed' is not installed on your ssetup
zullil
Posts: 6442 Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli
Post
by zullil » Fri Jul 19, 2013 4:31 pm
mcostalba wrote: zullil wrote: Code: Select all
Running benchmark for getting the signature ...
sed: -e: No such file or directory
make: *** [embed-signature] Error 1
This much works:
Code: Select all
LZsMacPro-OSX6: ~/Documents/Chess/Stockfish/src] more sign.txt
4769737
it seems 'sed' is not installed on your ssetup
Hi Marco,
sed is certainly available:
Code: Select all
LZsMacPro-OSX6: ~/Documents/Chess/Stockfish/src] which sed
/usr/bin/sed
LZsMacPro-OSX6: ~/Documents/Chess/Stockfish/src] more sign.txt
4769737
LZsMacPro-OSX6: ~/Documents/Chess/Stockfish/src] sed -i -e 's,^,/static const string Version/s/"\\(.*\\)"/"sig-,1' -e 's,$$,"/1,1' sign.txt
sed: -e: No such file or directory
zullil
Posts: 6442 Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli
Post
by zullil » Fri Jul 19, 2013 4:51 pm
This works for me:
Code: Select all
embed-signature:
@echo "Running benchmark for getting the signature ..."
@$(SIGNBENCH) 2>&1 | sed -n 's/Nodes searched : \(.*\)/\1/p' > sign.txt
@sed -i '' -e 's,^,/static const string Version/s/"\\(.*\\)"/"sig-,1' -e 's,$$,"/1,1' sign.txt
@sed -i '' -f sign.txt 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
mcostalba
Posts: 2684 Joined: Sat Jun 14, 2008 9:17 pm
Post
by mcostalba » Fri Jul 19, 2013 5:19 pm
zullil wrote: This works for me:
Unfortunately not for me.
Could you please test the following ?
Code: Select all
embed-signature:
@echo "Running benchmark for getting the signature ..."
@$(SIGNBENCH) 2>&1 | sed -n 's/Nodes searched : \(.*\)/\1/p' > sign.txt
@sed -e 's,^,/static const string Version/s/"\\(.*\\)"/"sig-,1' -e 's,$$,"/1,1' -i sign.txt
@sed -f sign.txt -i misc.cpp
@rm sign.txt
zullil
Posts: 6442 Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli
Post
by zullil » Fri Jul 19, 2013 6:35 pm
mcostalba wrote: zullil wrote: This works for me:
Unfortunately not for me.
Could you please test the following ?
Code: Select all
embed-signature:
@echo "Running benchmark for getting the signature ..."
@$(SIGNBENCH) 2>&1 | sed -n 's/Nodes searched : \(.*\)/\1/p' > sign.txt
@sed -e 's,^,/static const string Version/s/"\\(.*\\)"/"sig-,1' -e 's,$$,"/1,1' -i sign.txt
@sed -f sign.txt -i misc.cpp
@rm sign.txt
Already tried that, and it didn't work. But I'll try again to be sure.
No good here:
Code: Select all
Running benchmark for getting the signature ...
sed: -i may not be used with stdin
make: *** [embed-signature] Error 1
zullil
Posts: 6442 Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli
Post
by zullil » Fri Jul 19, 2013 6:58 pm
How about this?
Code: Select all
embed-signature:
@echo "Running benchmark for getting the signature ..."
@$(SIGNBENCH) 2>&1 | sed -n 's/Nodes searched : \(.*\)/\1/p' > sign.txt
@sed -i .bak -e 's,^,/static const string Version/s/"\\(.*\\)"/"sig-,1' -e 's,$$,"/1,1' sign.txt
@sed -i .bak -f sign.txt misc.cpp
@rm sign.txt *.bak
Sven
Posts: 4052 Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle
Post
by Sven » Sat Jul 20, 2013 12:35 am
zullil wrote: How about this?
Code: Select all
embed-signature:
@echo "Running benchmark for getting the signature ..."
@$(SIGNBENCH) 2>&1 | sed -n 's/Nodes searched : \(.*\)/\1/p' > sign.txt
@sed -i .bak -e 's,^,/static const string Version/s/"\\(.*\\)"/"sig-,1' -e 's,$$,"/1,1' sign.txt
@sed -i .bak -f sign.txt misc.cpp
@rm sign.txt *.bak
I found
this link which explains the problem, i.e. "sed -i" behaves differently on Mac OS X than on Linux.
@Marco: maybe on Makefile level the "-i" option could be replaced by a variable like SED_INPLACE_OPTION expanding to "-i" on Linux and other platforms where this works, but to "-i .bak" on Mac OS X. Or something similar. It would in fact be a configure issue.
Sven
mcostalba
Posts: 2684 Joined: Sat Jun 14, 2008 9:17 pm
Post
by mcostalba » Sat Jul 20, 2013 1:44 am
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 ?
zullil
Posts: 6442 Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli
Post
by zullil » Sat Jul 20, 2013 1:57 am
mcostalba 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 ?
Fails here, as before:
Code: Select all
Running benchmark for getting the signature ...
sed: -i may not be used with stdin
make: *** [embed-signature] Error 1