Purple Haze v2.1.0

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

vincent
Posts: 34
Joined: Tue Jan 19, 2010 8:38 am
Location: Brittany, France

Purple Haze v2.1.0

Post by vincent »

Hi, Everyone.

It has been six months since the previous release and during this time Purple Haze has made good progress. It should not be too far below 2000 ELO by now.

Code: Select all

git diff v2.0.3 v2.1.0 --shortstat
 52 files changed, 1544 insertions(+), 971 deletions(-)
This version mostly contains bug fixes and code improvements but I can now begin to focus solely on tuning the weights of my evaluation function. Preliminary test results show that there is much to gain in this area.

Purple Haze is written in C++11 and is known to compile successfully with GCC >= 4.6 on Debian, Ubuntu and Arch Linux with x86 and ARM architectures. Support of Clang is broken due to a small incompatibility in libstdc++ currently used on GNU/Linux distributions. Support of Intel C++ Compiler is unknown. Support of BSD and Solaris need some work but it should be okay on Windows and Mac OS.

To download and compile Purple Haze:

Code: Select all

$ git clone git://github.com/vinc/purplehaze.git
$ cd purplehaze
$ make
Vincent
https://github.com/vinc/purplehaze
http://vinc.cc/projects/foss/purplehaze
User avatar
Jim Ablett
Posts: 2455
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Purple Haze v2.1.0

Post by Jim Ablett »

Hi Vincent,
Many thanks for the new version.

I did some 32 bit compiles for Windows, Linux & Android.

Image
Purple Haze v2.1.0 JA

https://dl.dropbox.com/u/5047625/purplehaze-210-ja.zip
Mirror:
http://cl.ly/KpYs/purplehaze-210-ja.zip

Jim.
lucasart
Posts: 3243
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Purple Haze v2.1.0

Post by lucasart »

Jim Ablett wrote:Hi Vincent,
Many thanks for the new version.

I did some 32 bit compiles for Windows, Linux & Android.

Image
Purple Haze v2.1.0 JA

https://dl.dropbox.com/u/5047625/purplehaze-210-ja.zip
Mirror:
http://cl.ly/KpYs/purplehaze-210-ja.zip

Jim.
Nice logo with Jimmy Hendrix :)
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
vincent
Posts: 34
Joined: Tue Jan 19, 2010 8:38 am
Location: Brittany, France

Re: Purple Haze v2.1.0

Post by vincent »

Jim Ablett wrote:Hi Vincent,
Many thanks for the new version.

I did some 32 bit compiles for Windows, Linux & Android.

Image
Purple Haze v2.1.0 JA

https://dl.dropbox.com/u/5047625/purplehaze-210-ja.zip
Mirror:
http://cl.ly/KpYs/purplehaze-210-ja.zip

Jim.
Hi Jim,

Thank you very much! I do not have access to Windows machines so I was trying to figure out the problem to cross-compile for this OS from GNU/Linux.

I hope that Gabor will be able to test it now!
lucasart
Posts: 3243
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Purple Haze v2.1.0

Post by lucasart »

vincent wrote: I do not have access to Windows machines so I was trying to figure out the problem to cross-compile for this OS from GNU/Linux.
I had exactly the same problem, and found a very nice and portable way of doing it. Simply install the package 'mingw-w64', and replace 'g++' by 'x86_64-w64-mingw32-g++' in your command line (or makefile) to compile.

If you really want to be sure, then you have to install Wine, and you can test your windows compile in command line directly, or even by using a windows GUI like Arena, if you install it. But this is not necessary: it just works :D

PS: 'mingw-w64' is part of the Ubuntu repositories, so it will work with any Ubuntu based distro (I prefer Lubuntu 12.10 personally). I don't know about other distributions, but I guess most mainstream ones should have it. At worst, you'll have to compile from source (which is a pain in the ass).
And, of course, don't forget to append a '.exe' to the name of the Windows executable. "executableness" is not a property of the file system like on Unix, Windows really only accepts to execute the file if it ends with '.exe'
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
User avatar
Jim Ablett
Posts: 2455
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Purple Haze v2.1.0

Post by Jim Ablett »

lucasart wrote:
vincent wrote: I do not have access to Windows machines so I was trying to figure out the problem to cross-compile for this OS from GNU/Linux.
I had exactly the same problem, and found a very nice and portable way of doing it. Simply install the package 'mingw-w64', and replace 'g++' by 'x86_64-w64-mingw32-g++' in your command line (or makefile) to compile.

If you really want to be sure, then you have to install Wine, and you can test your windows compile in command line directly, or even by using a windows GUI like Arena, if you install it. But this is not necessary: it just works :D

PS: 'mingw-w64' is part of the Ubuntu repositories, so it will work with any Ubuntu based distro (I prefer Lubuntu 12.10 personally). I don't know about other distributions, but I guess most mainstream ones should have it. At worst, you'll have to compile from source (which is a pain in the ass).
And, of course, don't forget to append a '.exe' to the name of the Windows executable. "executableness" is not a property of the file system like on Unix, Windows really only accepts to execute the file if it ends with '.exe'
I did have a small problem compiling with mingw, std::stoi doesn't exist which is a definite bug in mingw. Well actually it does exist but it is being ignored. I found the answer here which involved editing the mingw basic_string.h header > http://stackoverflow.com/questions/8542 ... 1-on-mingw. I use latest version of mingw so this bug still hasn't been fixed.

Jim.
vincent
Posts: 34
Joined: Tue Jan 19, 2010 8:38 am
Location: Brittany, France

Re: Purple Haze v2.1.0

Post by vincent »

lucasart wrote:
vincent wrote: I do not have access to Windows machines so I was trying to figure out the problem to cross-compile for this OS from GNU/Linux.
I had exactly the same problem, and found a very nice and portable way of doing it. Simply install the package 'mingw-w64', and replace 'g++' by 'x86_64-w64-mingw32-g++' in your command line (or makefile) to compile.

If you really want to be sure, then you have to install Wine, and you can test your windows compile in command line directly, or even by using a windows GUI like Arena, if you install it. But this is not necessary: it just works :D

PS: 'mingw-w64' is part of the Ubuntu repositories, so it will work with any Ubuntu based distro (I prefer Lubuntu 12.10 personally). I don't know about other distributions, but I guess most mainstream ones should have it. At worst, you'll have to compile from source (which is a pain in the ass).
And, of course, don't forget to append a '.exe' to the name of the Windows executable. "executableness" is not a property of the file system like on Unix, Windows really only accepts to execute the file if it ends with '.exe'
Hi Lucas,

Don't you also have to cross-compile the C++ Standard Library? I don't use any other dependency like Boost for the main executable but I thought the former was required. I almost always use dynamic languages and Purple Haze is currently the only exception so there is still much to learn!

As a matter of fact, this very week I had to learn a few things about how to write a good Makefile in order to use Travis CI (a distributed build system for continuous integration service). For example you would now be able to invoke "env CXX=x86_64-w64-mingw32-g++ make" directly from the command line which previously required editing the Makefile. "make test" is also smarter and know how to download and compile the Google C++ Testing Framework for executing my unit tests.
Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

Re: Purple Haze v2.1.0

Post by Michel »

Simply install the package 'mingw-w64', and replace 'g++' by 'x86_64-w64-mingw32-g++' in your command line (or makefile) to compile.
This is one way of doing it. Another way is to use autoconf and then to run configure with

./configure --host=x86_64-w64-mingw32

This is what I do for gnuchess.
lucasart
Posts: 3243
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Purple Haze v2.1.0

Post by lucasart »

vincent wrote:Don't you also have to cross-compile the C++ Standard Library ?
No, you just compile your code normally. Try it, you'll be amazed :)
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.