Page 2 of 3

Re: building for Android

Posted: Thu Apr 20, 2017 12:51 am
by abik
jdart wrote:It is built from the branch I mentioned, except -fPIE has been added to the flags.
Ah, try "-fPIE -pie"

Re: building for Android

Posted: Thu Apr 20, 2017 3:10 am
by jdart
Ok, I added that, and updated the executable on arasanchess.org.

--Jon

Re: building for Android

Posted: Thu Apr 20, 2017 10:18 am
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 ‡

Re: building for Android

Posted: Thu Apr 20, 2017 5:00 pm
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!)

Re: building for Android

Posted: Thu Apr 20, 2017 5:08 pm
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

Re: building for Android

Posted: Thu Apr 20, 2017 5:12 pm
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?

Re: building for Android

Posted: Thu Apr 20, 2017 5:54 pm
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.

Re: building for Android

Posted: Thu Apr 20, 2017 6:09 pm
by kliles
Thanks Aart. Duh. Of course... I missed the context. I enjoy using Arasan and Chess for Android - thanks to you both!

Re: building for Android

Posted: Thu Apr 20, 2017 6:23 pm
by jdart
What is the hardware you are using?

--Jon

Re: building for Android

Posted: Thu Apr 20, 2017 7:59 pm
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