building for Android

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

Re: building for Android

Post by abik »

jdart wrote:It is built from the branch I mentioned, except -fPIE has been added to the flags.
Ah, try "-fPIE -pie"
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: building for Android

Post by jdart »

Ok, I added that, and updated the executable on arasanchess.org.

--Jon
flok

Re: building for Android

Post by flok »

Sofar no luck:

Code: Select all

10:18:09 folkert@belle:~/t/trunk-temop trunk(1) 130 ‡ /usr/src/android-ndk-r14b/ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=/usr/src/android-ndk-r14b/sources/third_party/vulkan/src/build-android/jni/Android.mk
&#91;arm64-v8a&#93; Compile++      &#58; VkLayer_core_validation <= core_validation.cpp
/usr/src/android-ndk-r14b/sources/third_party/vulkan/src/build-android/jni/../../layers/core_validation.cpp&#58;31&#58;10&#58; fatal error&#58; 'algorithm' file not found
#include <algorithm>
         ^
1 error generated.
make&#58; *** &#91;obj/local/arm64-v8a/objs/VkLayer_core_validation/__/__/layers/core_validation.o&#93; Error 1
10&#58;18&#58;16 folkert@belle&#58;~/t/trunk-temop trunk&#40;1&#41; 2s 2 ‡
kliles
Posts: 22
Joined: Fri Mar 23, 2012 8:35 pm
Location: Toronto Canada

Re: building for Android

Post by kliles »

Do you have a URL for the executable on arasanchess.org ? I looked there and could not see an Android download... (apologies if I just missed it completely!)
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: building for Android

Post by jdart »

It is not officially released yet, so not on the Web pages.

Direct link is:

https://www.arasanchess.org/arasanx-android-arm

--Jon
kliles
Posts: 22
Joined: Fri Mar 23, 2012 8:35 pm
Location: Toronto Canada

Re: building for Android

Post by kliles »

Thanks! As soon as I posted the question I saw that link up thread... of course. I am a real newbie here - that doesn't seem to be .apk Am I making a bad assumption that it is an Android executable? How is that file used?
User avatar
abik
Posts: 819
Joined: Fri Dec 01, 2006 10:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik

Re: building for Android

Post by abik »

jdart wrote:Ok, I added that, and updated the executable on arasanchess.org.
This one is proper pie, but traps on an illegal instruction on any first input.

Code: Select all

# ./arasanx-android-arm                                
Arasan v20.0.0-54-g2be3283 Copyright 1994-2017 by Jon Dart. All Rights Reserved.
uci
Illegal instruction 
Kerry, please have a look at my UCI and XBoard Protocols for Android webpage with an explanation on how to run third party engines in Chess for Android.
kliles
Posts: 22
Joined: Fri Mar 23, 2012 8:35 pm
Location: Toronto Canada

Re: building for Android

Post by kliles »

Thanks Aart. Duh. Of course... I missed the context. I enjoy using Arasan and Chess for Android - thanks to you both!
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: building for Android

Post by jdart »

What is the hardware you are using?

--Jon
User avatar
pedrox
Posts: 1056
Joined: Fri Mar 10, 2006 6:07 am
Location: Basque Country (Spain)

Re: building for Android

Post by pedrox »

jdart wrote:I am going to try a PIC executable because at least I can get that to build.

But the actual error I am getting now is "Permission denied". I copied the file to sdcard/My Documents and it appears that strips off the execute permissions. And the phone is not rooted so I can't change them.

It appears adb can set permissions so maybe I need to install that.

--Jon
Unfortunately the sd-card is always mounted with "noexec" which means that you can't execute anything from here.

Therefore you have to copy the executable to the local filesystem, e.g. to /data/local. In case the device is not rooted you can simply use cat: cat /sdcard/myengine > /data/local/tmp/myengine.

Then you have to set the executable permission on the executable. Chmod on android usually does not support the "u+x" syntax. Therefore you have to call chmod 555 /data/local/tmp/myengine.

Now:
cd /data/local/tmp
and
./myengine