cross compiling

Discussion of chess software programming and technical issues.

Moderator: Ras

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

Re: cross compiling

Post by lucasart »

abik wrote:
lucasart wrote: However, I am shocked at the size of the executables:
- Linux x86-64 is 76 KB only!
- Windows x86-64 is 760 KB !!
- Android (ARMv7) is just over 1 MB !!!
Dynamically linked binary for Android: 479K
Runs well on a Nexus 7:

Code: Select all

$ ./discocheck401-ab
uci
id name DiscoCheck 4.0.1
id author Lucas Braesch
option name Hash type spin default 32 min 1 max 8192
option name Clear Hash type button
uciok
Thank you.
Your compile works perfectly on my Samsung Galaxy-R too.

So how did you do compile it ?
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

Re: cross compiling

Post by Michel »

So how did you do compile it ?

The Android NDK has a command to generate a gcc toolchain specifically for Android. Using that you can make dynamic executables.

It is possible to do it with standard gcc (e.g. CodeSourcery) but then you need a command line of half a page (I have done it).
User avatar
abik
Posts: 824
Joined: Fri Dec 01, 2006 10:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik

Re: cross compiling

Post by abik »

lucasart wrote:Your compile works perfectly on my Samsung Galaxy-R too.
So how did you do compile it ?
Michel already kindly explained how to obtain a dynamically linked binary.
For your reference, here are the sizes of your engine binaries I compiled or collected from Jim in the past.

Code: Select all

  75K Aug  2  2011 doublecheck1.1-ab
  79K Aug 11  2011 doublecheck1.2-ab
  79K Aug 22  2011 doublecheck1.3.1-ab
  95K Nov  4  2011 doublecheck2.0-ab
  93K Dec 20  2011 doublecheck2.3-ab
  93K Jan 23  2012 doublecheck2.5-ab
 608K May  2  2012 doublecheck-26-ja
  72K Mar 10  2012 doublecheck2.7-ab
  64K May  2  2012 doublecheck3.4-ab

  65K Jun 28  2012 discocheck3.5.1-ab
  79K Jun 29  2012 discocheck3.6-ab
  75K Jan 26 13:26 discocheck371-ab
 479K Jan 30 12:50 discocheck401-ab
 1.1M Jan 31 09:31 discocheck-401-ja
One last point of concern, the "bench 12" score of my 401 does not agree with Jim's score (which does not agree with the earlier other reported numbers). If this number is supposed to be deterministic, perhaps good to look into a few portability pitfalls.

Code: Select all

$ ./discocheck-401-ja bench 12
....
signature = 7253093
time = 50.8134

$ ./discocheck401-ab bench 12
....
signature = 7265714
time = 54