Skip to content

How to: Crosscompile Demonstrator & Celix

Marco Jansen edited this page Jan 6, 2016 · 7 revisions

Crosscompile using our scripts

We made simple shell scripts to do the cross-compiling for us. These scripts have been tested and confirmed working on Ubuntu 15 and Fedora systems. Page of source/compile scripts we used

Crosscompile demonstrator & Celix for ARM with Docker

Instead of the shell scripts it is also possible to cross-compile using Docker. This takes more time and is not recommended when you're editing the code often.

  1. Install Docker
  2. Download the Dockerfiles you need from below
  3. Make a directory on your file system where celix & demonstrator will be located
  4. Clone demonstrator git clone https://github.com/INAETICS/demonstrator.git
  5. Checkout to the android branch cd demonstrator && git checkout android && cd ..
  6. Clone Apache Celix git clone https://github.com/apache/celix.git
  7. Checkout to the develop branch cd celix && git checkout develop && cd ..
  8. Place the setup docker file anywhere you want on the file system (Don't put it in the folder containing celix & demonstrator)
  9. Build the setup -> docker build -t setup_<cpu_abi> . - < Dockerfile (Make sure you are in the folder where the dockerfile is and name it Dockerfile!)
  10. Place the Build Dockerfile in the directory containing Celix and Demonstrator
  11. Edit the line that says FROM (line 16) to FROM setup_<cpu_abi> where <cpu_abi> can be armeabi, armeabi-v7a or aarch64
  12. Build it -> docker build -t <image_name> . (Have to be inside the directory)
  13. Run it -> docker run --name <container_name> <image_name>
  14. Copy the files from the builder to local file system -> docker cp <container_name>:/demonstrator/deploy <path> && docker cp <container_name>:/build/output/celix <path>

Dockerfiles:

Setup armeabi
Setup armeabi-v7a
Setup aarch64
Build

Checking ARM version of a File

ARM v8a (aarch64)

file foo.so

Output:

foo.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, not stripped

ARM v5 & ARM v7

readelf -a -W foo.so | grep Tag

Output example

Tag Type Name/Value
Tag_CPU_name: "ARM v7"
Tag_CPU_arch: v7
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-2
Tag_FP_arch: VFPv3-D16
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
Tag_ABI_optimization_goals: Aggressive Speed
Tag_CPU_unaligned_access: v6