Changes between Version 14 and Version 15 of AndroidBuildApp
- Timestamp:
- Nov 19, 2014, 4:26:14 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AndroidBuildApp
v14 v15 2 2 = How To Build BOINC Apps for Android = 3 3 4 This document describes how to build BOINC apps 5 for Android devices. 4 This document describes how to build BOINC apps for Android devices. 6 5 7 6 == Requirements == … … 9 8 * Android NKD: http://developer.android.com/tools/sdk/ndk/index.html 10 9 * BOINC on Android build script: [http://boinc.berkeley.edu/trac/browser/boinc-v2/android] 11 12 10 13 11 == Used versions == … … 21 19 * Android platform 2.3.4 22 20 23 24 21 == Compatibility with BOINC on Android == 25 22 26 BOINC on Android runs on all Android devices, regardless of its CPU architecture. 27 Possible architectures are ARM, x86 and MIPS. ARM is the predominant platform on Android. 23 BOINC on Android runs on all Android devices, regardless of their CPU architecture. 24 Possible architectures are ARM, x86 and MIPS. 25 ARM is the dominant platform on Android. 28 26 29 27 Even within ARM, higher ABIs or specific CPU capabilities might only be available … … 41 39 == Setup NDK toolchain == 42 40 43 To set up a custom cross compilation toolchain, 44 see article at AndroidBuildClient 45 41 To set up a custom cross compilation toolchain, see AndroidBuildClient. 46 42 47 43 == Build script == … … 64 60 }}} 65 61 66 It's often useful to build a single executable that can support the vfp or neon libraries & instructions, and then use the BOINC APP_INIT_DATA and HOST_INFO structures to find the capabilities of the host and call the appropriate optimized routines (member variable 'p_features' e.g. strstr(aid.host_info.p_features, " neon "). 62 It's often useful to build a single executable that can support the vfp or neon libraries & instructions, 63 and then use the BOINC APP_INIT_DATA and HOST_INFO structures 64 to find the capabilities of the host and call the appropriate optimized routines 65 (member variable 'p_features' e.g. strstr(aid.host_info.p_features, " neon "). 67 66 68 You can do this by selectively compiling using the above options, into separate small libraries that you link into the single executable, and use C++ namespaces to separate similar function calls. Refer to the boinc/client/Makefile.am and client/whetstone.cpp, and client/cs_benchmark.cpp files for an example of how to do this. 67 You can do this by selectively compiling using the above options, 68 into separate small libraries that you link into the single executable, 69 and use C++ namespaces to separate similar function calls. 70 Refer to the boinc/client/Makefile.am and client/whetstone.cpp, and client/cs_benchmark.cpp files 71 for an example of how to do this. 69 72 70 == Fortran on Android NDK (optional build) == 73 == Position-independent executables (PIE) == 74 Starting with version 4.1, Android supports '''position-independent executables''' (PIE). 75 Starting with version 5.0, PIE is mandatory - Android will refuse to run native executables 76 that are not PIE. 71 77 72 Note that the Android NDK currently does not have a fortran compiler distributed with it. But it is possible to build GNU Fortran (gfortran) libraries for ARM/Android using the information at [http://danilogiulianelli.blogspot.co.uk/2013/02/how-to-build-gcc-fortran-cross-compiler.html] 78 You can build PIE apps by including in your Makefile: 79 {{{ 80 LOCAL_CFLAGS += -fPIE 81 LOCAL_LDFLAGS += -fPIE -pie 82 }}} 83 84 == FORTRAN on Android NDK (optional build) == 85 86 The Android NDK currently does not have a FORTRAN compiler distributed with it. 87 But it is possible to build GNU Fortran (gfortran) libraries for ARM/Android using the information at 88 [http://danilogiulianelli.blogspot.co.uk/2013/02/how-to-build-gcc-fortran-cross-compiler.html] 73 89 74 90 == Example == 75 Setup the environment: [http://boinc.berkeley.edu/trac/browser/boinc-v2/samples/example_app/build_android.sh] 91 Setup the environment: 92 [http://boinc.berkeley.edu/trac/browser/boinc-v2/samples/example_app/build_android.sh] 76 93 77 94 Android Makefile: [http://boinc.berkeley.edu/trac/browser/boinc-v2/samples/example_app/Makefile_android]