A strange behaviour by Mediocre (Java/Linux problem?)
Posted: 19 Mar 2008, 12:55
While installing the newest versions of the engines on my computer I re-discovered a strange behaviour by Mediocre. I found a way to avoid the problem, but I don't understand how the solution works . Maybe a java or linux expert can explain this.
Background for winboard users: there is nothing similar to a winboard.ini in linux. One possibility to start xboard matching two engines would be to type somthing similar as
Of course I'm much to lazy for that. Therefore I start xboard using two scripts (something similar as a .bat file, but much more powerful). One script informs xboard about the time control, design of the board and so on, the other is engine specific and informs xboard about the name of the engine and the path to it.
For a usual executale xboard engine this script looks like this one:
Those who are familar with winboard weill easily guess what it does.
Because Mediocre is a java engine there is no executable which can run by itself. It has to be started using java with some additional options. It seems to be correct to put all that in the script:
Unfortunately that does not work, but ends in a crash:
Now my walk around which I don't understand myself:
If i use the first line of the script in a script of its own then the program works fine! the additional script contains the first line only.
and in the initial script fcp is replaced by the name of that additional script. Maybe this is useful for someone else or someone can explain me why this works.
Volker
Background for winboard users: there is nothing similar to a winboard.ini in linux. One possibility to start xboard matching two engines would be to type somthing similar as
- Code: Select all
nice xboard -tc $tc -inc $inc -mps $mps -xexit -$debugType -$ponderType -fcp "$fcp" -fd $fd -scp "$scp" -sd $sd -size $size -highlight -drag -legal -timeDelay -1 -coords -$autoflagType -xreuse -xreuse2 -sgf $sgf -$thinkingType -mg $mg
Of course I'm much to lazy for that. Therefore I start xboard using two scripts (something similar as a .bat file, but much more powerful). One script informs xboard about the time control, design of the board and so on, the other is engine specific and informs xboard about the name of the engine and the path to it.
For a usual executale xboard engine this script looks like this one:
- Code: Select all
#! /bin/bash
fcp=./crafty220
fd=$cp/crafty
Those who are familar with winboard weill easily guess what it does.
Because Mediocre is a java engine there is no executable which can run by itself. It has to be started using java with some additional options. It seems to be correct to put all that in the script:
- Code: Select all
#! /bin/bash
fcp="java -Xmx1024M -classpath /home/volker/schach/mediocre/mediocre_v0.332/bin Mediocre"
fd=$cp/mediocre/mediocre_v0.332/bin
Unfortunately that does not work, but ends in a crash:
- Code: Select all
volker@vpittlik:~/schach> xbtest
...
xboard 4.2.7 + java
...
StartChildProcess (dir="/home/volker/schach/mediocre/mediocre_v0.332/bin") java -Xmx1024M -classpath /home/volker/schach/mediocre/mediocre_v0.332/bin Mediocre
76 >first : xboard
protover 2
400 <first :
400 <first : Welcome to Mediocre v0.332. Type 'help' for commands.
...
734 >first : go
748 <first : move g1f3
...
1083 >first : usermove 1083 >first : b7b6
AnimateMove: piece 6 slides from 1,6 to 1,5
xboard: Error: first chess program (java -Xmx1024M -classpath /home/volker/schach/mediocre/mediocre_v0.332/bin Mediocre) exited unexpectedly
Now my walk around which I don't understand myself:
If i use the first line of the script in a script of its own then the program works fine! the additional script contains the first line only.
- Code: Select all
#! /bin/bash
java -Xmx1024M -classpath /home/volker/schach/mediocre/mediocre_v0.332/bin Mediocre
and in the initial script fcp is replaced by the name of that additional script. Maybe this is useful for someone else or someone can explain me why this works.
Volker