building for Android

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
abik
Posts: 740
Joined: Fri Dec 01, 2006 9:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik
Contact:

Re: building for Android

Post by abik » Wed Apr 19, 2017 10:51 pm

jdart wrote:It is built from the branch I mentioned, except -fPIE has been added to the flags.
Ah, try "-fPIE -pie"

jdart
Posts: 3826
Joined: Fri Mar 10, 2006 4:23 am
Location: http://www.arasanchess.org

Re: building for Android

Post by jdart » Thu Apr 20, 2017 1:10 am

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

--Jon

flok

Re: building for Android

Post by flok » Thu Apr 20, 2017 8:18 am

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 7:35 pm
Location: Toronto Canada

Re: building for Android

Post by kliles » Thu Apr 20, 2017 3:00 pm

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: 3826
Joined: Fri Mar 10, 2006 4:23 am
Location: http://www.arasanchess.org

Re: building for Android

Post by jdart » Thu Apr 20, 2017 3:08 pm

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 7:35 pm
Location: Toronto Canada

Re: building for Android

Post by kliles » Thu Apr 20, 2017 3:12 pm

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: 740
Joined: Fri Dec 01, 2006 9:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik
Contact:

Re: building for Android

Post by abik » Thu Apr 20, 2017 3:54 pm

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 7:35 pm
Location: Toronto Canada

Re: building for Android

Post by kliles » Thu Apr 20, 2017 4:09 pm

Thanks Aart. Duh. Of course... I missed the context. I enjoy using Arasan and Chess for Android - thanks to you both!

jdart
Posts: 3826
Joined: Fri Mar 10, 2006 4:23 am
Location: http://www.arasanchess.org

Re: building for Android

Post by jdart » Thu Apr 20, 2017 4:23 pm

What is the hardware you are using?

--Jon

User avatar
pedrox
Posts: 992
Joined: Fri Mar 10, 2006 5:07 am
Location: Basque Country (Spain)
Contact:

Re: building for Android

Post by pedrox » Thu Apr 20, 2017 5:59 pm

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

Post Reply