Skip to content

Cross compile AllScale runtime for ARM

Kiril Dichev edited this page Nov 14, 2018 · 35 revisions
  • GCC cross-compiler for ARM: Install it from your Debian/Ubuntu distro:

    • gcc-aarch64-linux-gnu
    • g++-aarch64-linux-gnu
  • Download Boost (1.67.0 used), and compile it as follows:

    • modify user-project.jam to contain following:

if ! gcc in [ feature.values <toolset> ] { using gcc : arm : /usr/bin/aarch64-linux-gnu-g++ ; }

    • Then build Boost as follows sudo ./b2 install -a toolset=gcc-arm architecture=arm abi=aapcs address-model=64 -j20 --prefix=/opt/cross/boost
  • Download jemalloc and configure as: ../configure --host aarch64-linux-gnu --prefix=/opt/cross/jemalloc CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ ; sudo make install
  • Download hwloc 1.11.3 (later hwloc is not binary compatible and will fail with HPX!) and cross-compile it for ARM: CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ ./configure --prefix=/opt/cross/hwloc ; sudo make install
  • Download and configure HPX to cross-compile:
    • git clone https://github.com/STEllAR-GROUP/hpx.git
    • Add a toolchain file:

set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR aarch64) set(CMAKE_SYSROOT /home/heller/suitable/sysroot) #set(CMAKE_STAGING_PREFIX /home/devel/stage) #set(tools /home/devel/gcc-4.7-linaro-rpi-gnueabihf) set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)

    • Configure as cmake -DCMAKE_TOOLCHAIN_FILE=toolchain.txt -DHWLOC_LIBRARY=/opt/cross/hwloc/lib/libhwloc.so -DHWLOC_INCLUDE_DIR=/opt/cross/hwloc/include -DHPX_WITH_GENERIC_CONTEXT_COROUTINES=On -DHPX_WITH_STATIC_LINKING=On -DHPX_WITH_FAULT_TOLERANCE=ON -DBOOST_DIR=/opt/cross/boost/ -DHPX_WITH_THREAD_IDLE_RATES=ON -DBOOST_ROOT=/opt/cross/boost -DHPX_WITH_MALLOC=jemalloc -DHPX_WITH_DYNAMIC_HPX_MAIN=Off -DBOOST_UNDERLYING_THREAD_LIBRARY=/usr/aarch64-linux-gnu/lib/libpthread.so -DJEMALLOC_LIBRARY=/opt/cross/jemalloc/lib/libjemalloc.a ..
    • You may get an error during compile in file hpx/hpx/util/plugin/detail/dll_dlopen.hpp If you do, add a missing include #include <linux/limits.h>
  • Clone AllScale API and AllScale runtime

    • For AllScale runtime, add to the CMakeLists.txt the same as above for HPX.
    • Compile AllScale runtime cmake -DCMAKE_TOOLCHAIN_FILE=<URL to the same toolchain.txt> -DHPX_DIR=/home/kdichev/hpx/build/lib/cmake/HPX/ -DCMAKE_DISABLE_FIND_PACKAGE_CPUFREQ=TRUE -DALLSCALE_API_DIR=/home/kdichev/allscale_api ..
Clone this wiki locally