Dirty for Android

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

Moderators: hgm, Rebel, chrisw

User avatar
Andres Valverde
Posts: 557
Joined: Sun Feb 18, 2007 11:07 pm
Location: Almeria. SPAIN

Dirty for Android

Post by Andres Valverde »

Hi all,

Jim Ablett managed to compile Dirty for Android. Thanks a lot Jim.

It may run under Aart Bik's Chess for Android GUI

http://www.aartbik.com/MISC/android.html

and can be downloaded at :

http://www.dirtychess.com/release/beta/ ... ndroid.rar

We have not checked it out (no android device available) so any feedback is very welcome.
Saludos, Andres
User avatar
abik
Posts: 819
Joined: Fri Dec 01, 2006 10:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik

Re: Dirty for Android

Post by abik »

Andres Valverde wrote:We have not checked it out (no android device available) so any feedback is very welcome.
Hi Andres,
I did a quick test, and the binary runs fine on an Android device. However, Chess for Android only supports the UCI protocol, not winboard (sorry), so currently it won't run in this GUI. Perhaps this may motivate you to add the UCI protocol to your engine? :-)
Regards,
Aart
kranium
Posts: 2129
Joined: Thu May 29, 2008 10:43 am

Re: Dirty for Android

Post by kranium »

abik wrote:
Andres Valverde wrote:We have not checked it out (no android device available) so any feedback is very welcome.
Hi Andres,
I did a quick test, and the binary runs fine on an Android device. However, Chess for Android only supports the UCI protocol, not winboard (sorry), so currently it won't run in this GUI. Perhaps this may motivate you to add the UCI protocol to your engine? :-)
Regards,
Aart
from protocol.cpp
Fruit 2.1 (2005) Fabien Letouzey:

// start position
if (fen != NULL) { // "fen" present
if (moves != NULL) { // "moves" present
ASSERT(moves>fen);
moves[-1] = '\0'; // dirty, but so is UCI
}

!! ??

Now you have it from the horse's mouth:
UCI is dirty!
Therefore Dirty should be UCI!
?
User avatar
Andres Valverde
Posts: 557
Joined: Sun Feb 18, 2007 11:07 pm
Location: Almeria. SPAIN

Re: Dirty for Android

Post by Andres Valverde »

abik wrote:
Andres Valverde wrote:We have not checked it out (no android device available) so any feedback is very welcome.
Hi Andres,
I did a quick test, and the binary runs fine on an Android device. However, Chess for Android only supports the UCI protocol, not winboard (sorry), so currently it won't run in this GUI. Perhaps this may motivate you to add the UCI protocol to your engine? :-)
Regards,
Aart
Thanks Aart!

We'll have to wait for your GUI supporting WB engines :-D
Saludos, Andres
User avatar
Andres Valverde
Posts: 557
Joined: Sun Feb 18, 2007 11:07 pm
Location: Almeria. SPAIN

Re: Dirty for Android

Post by Andres Valverde »

kranium wrote:
Therefore Dirty should be UCI!
?
We guess it's Dirty enough yet :)
Saludos, Andres
User avatar
hgm
Posts: 27795
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Dirty for Android

Post by hgm »

What tools do you use to build these Android apps?

Someone is trying to build a Xiangqi app with my engine in it, using Cygwin g++ plus Adobe tools. But he has big problems with it. In emulation we crash due to a run-time error (a bad pointer), and debugging it leads to ' impossible' output: when we print p, Z[p], Z[0], and Z[0*p] it prints 0, a nonsense value that causes segfaulting when used as a pointer (as in Z[p][sqr]; Z are the Zobrist keys), and then two valid pounter values. So Z[0] and Z[p] do not produce the same result even when p=0.

So there must be a compiler or emulator error somewhere, but we have no idea where. "g++ -S" does not produce any assembly code we can check for correctness.
User avatar
Jim Ablett
Posts: 1383
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Dirty for Android

Post by Jim Ablett »

hgm wrote:What tools do you use to build these Android apps?

Someone is trying to build a Xiangqi app with my engine in it, using Cygwin g++ plus Adobe tools. But he has big problems with it. In emulation we crash due to a run-time error (a bad pointer), and debugging it leads to ' impossible' output: when we print p, Z[p], Z[0], and Z[0*p] it prints 0, a nonsense value that causes segfaulting when used as a pointer (as in Z[p][sqr]; Z are the Zobrist keys), and then two valid pounter values. So Z[0] and Z[p] do not produce the same result even when p=0.

So there must be a compiler or emulator error somewhere, but we have no idea where. "g++ -S" does not produce any assembly code we can check for correctness.
Hi Harm,

CodeSourcery is all you need to cross-compile Arm executables for Android on Windows or Linux platform (Download the EABI version)
http://www.codesourcery.com/sgpp/lite/a ... plate=lite

You need to statically link the executable and in the case of pthreads you need to statically link the whole library. Here is an command line example (compiling Redqueen engine):

Code: Select all

arm-none-eabi-g++.exe -o redqueen *.cpp -fomit-frame-pointer -fno-rtti -fexceptions -fstrict-aliasing -march=armv5te -O3 -Wno-deprecated -pipe -funroll-all-loops -funsafe-math-optimizations -ffast-math -static -s -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -lc -lm -ldl
Here is a nice tutorial for using within the Eclipse gui >
http://www.acmesystems.it/foxg20/doku.p ... al:eclipse

Jim.
User avatar
abik
Posts: 819
Joined: Fri Dec 01, 2006 10:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik

Re: Dirty for Android

Post by abik »

hgm wrote:What tools do you use to build these Android apps?
Most people use the CodeSoucery toolchain for arm, and generate a static binary. Alternatively, the compiler toolchain of the Google NDK can be used, which allows dynamic linking (in fact, even in the former case, dynamic linking is possible, but this requires some bookkeeping to make it work).
User avatar
Jim Ablett
Posts: 1383
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Dirty for Android

Post by Jim Ablett »

There is also Yagarto toolchain which looks pretty similar to CodeSourcery, but doesn't seem to support pthreads.

http://www.yagarto.de/

Jim.
CRoberson
Posts: 2055
Joined: Mon Mar 13, 2006 2:31 am
Location: North Carolina, USA

Re: Dirty for Android

Post by CRoberson »

Jim Ablett wrote:
hgm wrote:What tools do you use to build these Android apps?

Someone is trying to build a Xiangqi app with my engine in it, using Cygwin g++ plus Adobe tools. But he has big problems with it. In emulation we crash due to a run-time error (a bad pointer), and debugging it leads to ' impossible' output: when we print p, Z[p], Z[0], and Z[0*p] it prints 0, a nonsense value that causes segfaulting when used as a pointer (as in Z[p][sqr]; Z are the Zobrist keys), and then two valid pounter values. So Z[0] and Z[p] do not produce the same result even when p=0.

So there must be a compiler or emulator error somewhere, but we have no idea where. "g++ -S" does not produce any assembly code we can check for correctness.
Hi Harm,

CodeSourcery is all you need to cross-compile Arm executables for Android on Windows or Linux platform (Download the EABI version)
http://www.codesourcery.com/sgpp/lite/a ... plate=lite

You need to statically link the executable and in the case of pthreads you need to statically link the whole library. Here is an command line example (compiling Redqueen engine):

Code: Select all

arm-none-eabi-g++.exe -o redqueen *.cpp -fomit-frame-pointer -fno-rtti -fexceptions -fstrict-aliasing -march=armv5te -O3 -Wno-deprecated -pipe -funroll-all-loops -funsafe-math-optimizations -ffast-math -static -s -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -lc -lm -ldl
Here is a nice tutorial for using within the Eclipse gui >
http://www.acmesystems.it/foxg20/doku.p ... al:eclipse

Jim.
Hi Jim,

I downloaded the lite version of the compiler and after some source mods got it to compile Ares. There is still a problem. It doesn't link and it says " .... can not find -ldl".

A quick read of the getting started manual says I have to use the -T option to define a linking script. The tables show scripts for specific processors, but none are what I have. This doesn't make much sense anyway, because there must be a generic option to support multiple Android devices.

What have I missed that will make this work?

Charles