What should I put here? - namccart/201507_codesprint GitHub Wiki

Getting Started

Cross-compiling

To build with Android you need either the Android NDK, or the standalone toolchain. To make a standalone toolchain, follow Tom's instructions at gnuradio.org

Next you need to install the OpenCL header files and a libOpenCL.so that supports your target device in the standalone toolchain. The recommended location is in ${standalone_toolchain_dir}/user/ You will want two directories: include and lib Assuming your host has the OpenCL development headers: Copy all the the ${host}/include/CL directory into ${standalone_toolchain_dir}/user/include Copy libOpenCL.so from the target device (e.g. adb pull /system/vendor/lib{64}/libOpenCL.so) into ${standalone_toolchain_dir}/user/lib

NOTE: You need to set the location of the OpenCL .cl kernel files on the target device. LiDE currently loads the .cl files at runtime, so they need to be available on the device to run (otherwise you will see errors like the following):

Error in clCreateProgramWithSource   -30

This is currently set in ${source_dir}/lang/ocl/CMakeLists.txt - look for the following line, and make it point to somewhere sane on your device (e.g. /data/):

set(INNER_PRODUCT_OCL ${CMAKE_CURRENT_SOURCE_DIR}/src/gems/actors/basic/)

Change the ${CMAKE_CURRENT_SOURCE_DIR}/src/gems/actors/basic/ to e.g. /data/

CMake

To cross-compile - you need to use the AndroidToolchain.cmake toolchain file. You must specify this at cmake time:

cmake ~/Code/lide/ -DCMAKE_TOOLCHAIN_FILE=~/Code/lide/cmake/Toolchains/AndroidToolchain.cmake -DANDROID_STANDALONE_TOOLCHAIN=/opt/android-grand-toolchain