Skip to content
Little GolemMake your next move.

Playing Hex against the computer: installation instructions for mohex + hex-gui on ubuntu

Public forum discussion.

#1 · broutcha

2 Oct 2014

In short: I've written an all-in-one script that builds mohex and benzene-hexgui on ubuntu. It will prompt you to sudo (just to install the required dependencies).You can get the script from there: https://drive.google.com/file/d/0B5aGEZRviuRvRjBnSWJlbVlpYWc/view?usp=sharing

Just run it; it does everything and in the end it displays information on how to play. Enjoy!

Installation takes between 5min and 1h, depending on your computer's CPU(s).

Details:It worked fine on the two computers I tried (both Ubuntu 14), and I'm really happy to finally be able to play hex against a good AI! The packages "benzene" and "benzene-hexgui" are neat; but haven't been maintained in a while; and building them from scratch fails.There are a number of installation instructions online, but none of them solved all of my issues; and in the end I had to dig in the dirt.

#2 · David J Bush

2 Oct 2014

This is excellent! When I ran the script the first time, I got an error because I did not have svn installed. I installed, it, deleted the created directories benzene and benzene-hexgui, and re-ran the script. It worked perfectly for me under Linux Mint Debian. I greatly appreciate you went to the trouble to create three different engines for different grid sizes.

Is there any way you could incorporate my display options? See this thread: http://boardgamegeek.com/thread/900636/gnu-linux-users-play-strongest-known-hex-engine and this file: http://boardgamegeek.com/filepage/85646/modified-hex-gui-linux

Thank you so much!

#3 · David J Bush

2 Oct 2014

I will modify your benzene-hexgui directory to incorporate my changes and will send it to you for your approval.

#4 · Tom Ace

3 Oct 2014

Thanks for this!  I have it running on Ubuntu 14.04.1 (x86_64).I had to install a few packages:  subversion, git, openjdk-7-jdk .

Is anyone interested in bug reports on the gui?  I saw a minorproblem that I'd like to report if there's a way to.

Again -- thanks!

#5 · wccanard

11 Apr 2016

Meh. With Ubuntu 14.04.4 LTS on x86_64  I get

BoardUtil.cpp: In function ‘benzene::HexPoint benzene::BoardUtil::RandomEmptyCell(const benzene::StoneBoard&)’:

BoardUtil.cpp:114:20: error: ‘Global’ is not a member of ‘SgRandom’

     int randMove = SgRandom::Global().Int(count) + 1;

                    ^

make[3]: *** [libhex_a-BoardUtil.o] Error 1

during the installation (this is when compiling benzene, in src/hex). Can anyone help?

#6 · urmaul

11 Apr 2016

This error happens because the script downloads the newest fuego version, and the function "Global" was removed. It worked for me when I used a slightly older version. I think I used revision 2003. Try appending " -r2003" to the line "svn co https://fuego.svn.sourceforge.net/svnroot/fuego/trunk". However, mohex11 still doesn't work for me, it crashes often. mohex13, mohex14, mohex19 work fine as far as I see.

#7 · wccanard

11 Apr 2016

Many thanks. I've got it working on Ubuntu 14.04. Neither fuego svn version 2003 nor 1371 (the version suggested in the README to benzene) worked for me, but a random version somewhere in the middle did. Explicitly, I added "-r 1758" into the install script so that one line now looks like this:

svn co https://fuego.svn.sourceforge.net/svnroot/fuego/trunk -r 1758 fuego

mohex11 is working for me. The only trouble I had with the instructions which appeared at the end of the installer was that when the Analyse window popped up it was blank and in particular had no "Game Param" to click on. I fixed this by View -> Show Analyse .

#8 · urmaul

11 Apr 2016

Now I was able to check: Actually I used Fuego revision 2002. Surely revision 2003 didn't work either for me.

Interesting that mohex11 works for you. For example, mohex11 crashes for me when I try dfpn-solve-state on an empty 7x7 board. Does that really work for you? If so, maybe that's because we have different versions of the Boost libraries or libdb. I don't think it can be the fuego version because I had very similar crashes when I built Benzene with Fuego revision 1604 in an earlier attempt (and I didn't try "--enable-upto13x13=yes" that time...). I'm using Debian 8, with Boost 1.55 and libdb5.3, also on a x86-64 computer.

This blank Analyze window was the same for me, seems like a small Hexgui bug. "Edit -> Preferences... -> Show Shell/Analyze on Program Connect" are also useful.

#9 · wccanard

11 Apr 2016

I just solved the second row edge template I posted in this thread (the fourth picture I posted) using mohex11 (it's a win for black). I am managing to solve a blank 7x7 board using mohex11. I installed whichever version of boost was being shipped by ubuntu, which looks to me like 1.54, and I also installed the default libdb, which seems to be 5.3 (I must confess I am not 100% sure how to verify which versions I have installed; I just looked through /var/log/dpkg.log and saw things like

2016-04-11 12:44:56 install libdb5.3-dev:amd64 5.3.28-3ubuntu3

and

2016-04-05 22:24:01 install libboost-locale1.54-dev:amd64 1.54.0-4ubuntu3.1

#10 · urmaul

11 Apr 2016

Hmm, I see. Maybe Boost 1.55 sucks, but I doubt it. Whatever goes wrong, it seems weird that only mohex11 is affected.

#11 · Carroll

12 Apr 2016

@ wccanard, welcome back temporarily.

dpkg -l | grep libdb

   should do the job.

#12 · broutcha

13 Apr 2016

I had actually forgotten about having installed this 18 months ago. How nice to remember!

I also got hit by the blank "Analyze" window, but urmaul's suggestion worked for me.

I've updated the script with all suggestions listed above, and moved it to a shared Google Document, so that you can directly enter your own fixes (as comments, but if you want to edit it directly, just ask me and I'll add you as an owner). Feel free to do so.

I ran the script again and it worked fine for me. I also uploaded copies of the git and svn repositories used, so that the script still works even if they disappear.

New URL: http://tinyurl.com/hex-ubuntu