Skip to content

Commit

Permalink
Make some clarifications in ToolchainExample.cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
franz committed Oct 8, 2021
1 parent cee379a commit 17db1d3
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions ToolchainExample.cmake
@@ -1,27 +1,37 @@
# This is an example Toolchain file to cross-compile for ARM/MIPS/other
# boards from x86_64. Copy & modify. Skip 4-8 if using LLVM less build
#
# x86_64 = "build"
# ARM/MIPS/other board = "host" or "board"
#
# Steps:
# 1) Install g++ and gcc cross-compilers
# (note: hwloc is now optional)
# 1) on build system, install g++ and gcc cross-compilers
# (apt install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf)
# 2) On your board, install libltdl, ocl-icd and libhwloc + their development headers
# 3) copy the entire root filesystem of the board somewhere on your host,
# 2) On the board, install ocl-icd and libhwloc (optional) + their development headers
# 3) copy the entire root filesystem of the board somewhere to the build system,
# then set CMAKE_FIND_ROOT_PATH below to this path
# 4) Build clang and llvm for the build machine and install them. ($BUILD_PREFIX)
# 5) Build clang and llvm for the host machine and install them. ($HOST_PREFIX)
# 4) Build clang and llvm for the build system and install them. ($BUILD_PREFIX)
# 5) Build clang and llvm for the host and install them. ($HOST_PREFIX)
# 6) copy llvm-config from build to host. (cp $BUILD_PREFIX/bin/llvm-config $HOST_PREFIX/bin/llvm-config)
# 7) Install pkg-config for build
# 8) Install hwloc, ocl-icd for host and set `PKG_CONFIG_PATH` env variable to the paths
# eg: export PKG_CONFIG_PATH=/path/to/hwloc/prefix/lib/pkgconfig:/path/to/opencl/prefix/lib/pkgconfig
# 9) run cmake like this:
# cmake -DHOST_DEVICE_BUILD_HASH=<SOME_HASH> -DENABLE_LLVM=<0 if LLVM-less, 1 if with LLVM>
# cmake -DHOST_DEVICE_BUILD_HASH=<SOME_HASH> (see below)
# -DENABLE_LLVM=<0 if LLVM-less, 1 if with LLVM>
# -DCMAKE_TOOLCHAIN_FILE=<path-to-this-file>
# -DCMAKE_PREFIX_PATH=$HOST_PREFIX
# -DLLC_TRIPLE=<your-triple (e.g.arm-gnueabihf-linux-gnu)
# -DLLVM_HOST_TARGET=<your-triple (e.g.arm-gnueabihf-linux-gnu)
# -DLLC_HOST_CPU=<your-cpu (e.g. armv7a)>
# -DLLVM_BINDIR=$BUILD_PREFIX/bin
# <path-to-pocl-source>
#
# ... where SOME_HASH is a string that can be set to anything;
# when loading OpenCL program binaries, PoCL uses it to check
# that the PoCL which built the binary is compatible with the
# PoCL that's loading the binary.

SET(CMAKE_SYSTEM_NAME Linux)

Expand Down

0 comments on commit 17db1d3

Please sign in to comment.