XBoard Installation for Dummies - Request

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Richard Allbert
Posts: 792
Joined: Wed Jul 19, 2006 9:58 am

XBoard Installation for Dummies - Request

Post by Richard Allbert »

Hi,

Is there a guide somewhere that details building and installing Xboard on Ubuntu?

Today I've had a bit of a hair tearing session installing Ubuntu (another story, but it works with WLAN now), building Jabba (again more hair tearing trying to understand how to install the build tools) and finally getting XBoard to build and work.

What I've ended up with is XBoard compiled, and running, but all source files, object files, config files are in the same directory, so it's a bit of a mess.

I used the Load Engine dialog to try to add Jabba, but after selecting Engine Directory in the box, and then the executable in the Engine Command box, it doesn't run. I've tried various combinations if with/without path in the Engine Command area, but no avail. It runs ok when I run it in the terminal.

Needless to say, as none of the other engines that come with Winboard are installed, none of those work either.

The mess I've created is my own fault - maybe would be and idea to add a page in the Docs on building and setting up things properly in Unix? Not long, but a few pointers? At the moment the GNU page says "do ./Configure and Make Make Install", which is ok for people who are used to this, but for those who aren't, it's a bit lacking

Again, I like XBoard / Winboard a lot - this isn't a complaint about it, more a request for newbies trying Linux

Thanks

Richard
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: XBoard Installation for Dummies - Request

Post by hgm »

Have you prefixed the engine command with "./"? Linux refuses to run files in the current directory if you just mention the plain name of the binary.
Richard Allbert
Posts: 792
Joined: Wed Jul 19, 2006 9:58 am

Re: XBoard Installation for Dummies - Request

Post by Richard Allbert »

Hi HG

I have in the path textbox
'Documents/JabbaCPP/Jabba09072012/bin/Release'

And in the command box after selecting the executable (Jabba09072012), I have

'Documents/JabbaCPP/Jabba09072012/bin/Release/Jabba09072012'

Where should I put the ./ ?

Thanks

Richard
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: XBoard Installation for Dummies - Request

Post by hgm »

Well, that does not work, because XBoard would first change to the engine directory you specify, and then issue the engine command from there. So eventually this would try to execute

Documents/JabbaCPP/Jabba09072012/bin/Release/Documents/JabbaCPP/Jabba09072012/bin/Release/Jabba09072012

which is probably not what you mean.

What you probably need is:

Engine command: ./Jabba09072012
Directory: Documents/JabbaCPP/Jabba09072012/bin/Release

This is what XBoard should understand automatically if you enter:

engine command: Documents/JabbaCPP/Jabba09072012/bin/Release/Jabba09072012

and leave the directory field empty. (So erase the period that is put there by default!) Then it will split the command in a directory part and an engine-file part, and prefix the latter with "./" so Linux will accept it as a valid command.
Richard Allbert
Posts: 792
Joined: Wed Jul 19, 2006 9:58 am

Re: XBoard Installation for Dummies - Request

Post by Richard Allbert »

Nothing seems to work.

Instead, I've installed Xboard via the software center, to have a go with that.

FairyMax loads ok, Fruit 2.1 doesn't, and I have the same issue with the engine loading.

Should my path begin with Home instead?

Also, where is the config file after installing?? It would be easier just to enter the engines here rather than using the dialog.

I appreciate these are easy questions, but after being used to the Windows dir structure and program organization, this is a little confusing, which is why maybe a small guide wouldn't be a bad idea.

Thanks

Richard
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: XBoard Installation for Dummies - Request

Post by hgm »

It is really hard for me to answer these questions if I don't know how your file system looks. I assume that "Documents" in your postings above is a sub-directory of your home directory, i.e. ~/Documents. And that you run XBoard from your home directory.

The XBoard master config file after "sudo make install" is /etc (or is there something like /local/etc) and is called xboard.config. But it redirects saving of settings to ~/.xboardrc, and that is where you should find your engine list.

I am also puzzled by the fact that the path names you give do not start with "/" . When you brows to a file to set the path, it should give you the absolute path, I think.

But it is a good idea to look in ~/.xboardrc to see what you actually get for -fcp and -fd.
Richard Allbert
Posts: 792
Joined: Wed Jul 19, 2006 9:58 am

Re: XBoard Installation for Dummies - Request

Post by Richard Allbert »

You provide better support than commercial services :)

Ok I found the settings file after clicking on File System, and opening "/etc/xboard" and xboard.conf was in there.

The fairyMax ini is in "usr/share/games" and the fairymax executable is in "usr/games", as is the xboard executable.

Getting there......

In the config file, the -saveSettingsFile "~/.xboard.rc" line means that I should be able to find the xboard.rc file by going to /Home/Richard ?

There isn't such a file in there.

Thanks again

Richard
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: XBoard Installation for Dummies - Request

Post by hgm »

We try! :wink:

Indeed, fairymax is installed by default in the /usr/games/ directory, which is normally in the shell's search path. So yoo can type a plain 'fairymax' to start it, no matter which directory you are in, and there also is no need to prefix it with "./". Fruit should normally be in /usr/games/ too, under the filename 'fruit'. Fairy-Max knows where to find its ini file, that path is hard-coded in the binary, so it does not matter from where you run it. This is actually Linux standard; only engines that do not comply to the standard do need an -fd specification. This is why the Load Engine dialog proposes "." as the engine directory; "cd ." is a no-op, so the engine will run in the directory where you were when you started XBoard (and make, for instance, its log files there, which is what the user probably would expect).

Note that the settings file should be named .xboardrc , and not .xboard.rc . And that files with names starting with '.' are 'hidden files', not shown bij many tools unless you toggle some options. (e.g. you need "ls -al" in stead of "ls -l" to show such files, and also the file explorer would need an altered setting. In the 'open' menu of gedit they are normally listed, though.)

-saveSettingsFile "~/.xboardrc" indeed indicates the saving of settings is 'forcefully' redericted (i.e. the file is created even if it did not exist). -settingsFile "~/.xboardrc" redirects the reading of settings, but only redirects writing if the reading was successful. I guess this was done to prevent you could ever lose settings by specifying an invalid path, but as new users won't have the .xboardrc file in their home directory yet, I had to add the other (more dangerous) one. But "~" is Linux (shell) speak for the current user's home directory, and any user should have such a directory accessible to him, so this is safe use of the option.
Richard Allbert
Posts: 792
Joined: Wed Jul 19, 2006 9:58 am

Re: XBoard Installation for Dummies - Request

Post by Richard Allbert »

Ok, settings file found, hidden files now turned on :)

So, from the terminal I can do:

Code: Select all

richard@richard-ThinkPad-R60:~/Documents/JabbaCPP/Jabba09072012/bin/Release$  ~/Documents/JabbaCPP/Jabba09072012/bin/Release/Jabba09072012
uci
JABBA, UCI MODE
id name Jabba18072012d
id author Richard Allbert
option name Hash type spin default 64 min 4 max 2048
option name Ponder type check default true
uciok
quit
richard@richard-ThinkPad-R60:~/Documents/JabbaCPP/Jabba09072012/bin/Release
but in the settings file I've tried

Code: Select all

-firstChessProgramNames {fairymax
"Fruit 2.1" -fcp fruit -fUCI
"Crafty" -fcp crafty
"GNU Chess" -fcp gnuchess
"Jabba09072012" -fcp Jabba09072012 -fd "~/Documents/JabbaCPP/Jabba09072012/bin/Release/" -fNoOwnBookUCI
}
and

Code: Select all

-firstChessProgramNames {fairymax
"Fruit 2.1" -fcp fruit -fUCI
"Crafty" -fcp crafty
"GNU Chess" -fcp gnuchess
"Jabba09072012" -fcp .Jabba09072012 -fd "~/Documents/JabbaCPP/Jabba09072012/bin/Release/" -fNoOwnBookUCI
}
and

Code: Select all

-firstChessProgramNames {fairymax
"Fruit 2.1" -fcp fruit -fUCI
"Crafty" -fcp crafty
"GNU Chess" -fcp gnuchess
"Jabba09072012" -fcp "~/Documents/JabbaCPP/Jabba09072012/bin/Release/Jabba09072012 -fNoOwnBookUCI
}
And none worked. What's the correct syntax?

Thanks again

Richard
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: XBoard Installation for Dummies - Request

Post by hgm »

Well, the ~ for home directory might not work in this context. It is a shell convention, and bare system calls for opening or executing files would not understand it. Engines in XBoard are not run through the shell, but by a direct execv() call. I don't think I make any attempt to let XBoard itself expand the filename to resolve the ~. I did make a routine for that, which I use on the settingsfile name, but I don't think it is applied in general.

So a good first step would be to try it with ~ replaced by /home/richard .

Furthermore, (1) would only work if Jabba09072012 would be in /bin, /usr/bin or /usr/games, etc. but not if it is in the current directory. (2) would nearly work if you hadn't forgotten the slash. (3), after getting rid of the ~, should be able to start up the engine. But the engine would not find its files in the current directory (unless you happened to start XBoard from there). Which would be OK if it is compliant, and searches its data files in /usr/share/games/Jabba/ , rather than in the current directory.

The root cause of all these problems seems that the browse function does not fill the field with an absolute path, but takes it relative to your home directory. Which would then only work if you actually run XBoard from that home directory.

Now the file browser of 4.6.2 (which was stolen from GhostView) has already been replaced by one I wrote myself, in the latest development version. I am not sure if that would have the same problem. (IIRC I used a library function GetWorkingDir there, and I do't know if that always returns an absolute path.) I am not on Linux now, so I cannot easily check.