I want to build a custom Linux using the Yocto Project for a system using the nvidia tegra k1 processor, which has an arm cortex A 15 (32bit) and a GPU. Furthermore, OpenCV (version >= 3.0) with CUDA support needs to be installed.
Now when Bitbake tries to compile OpenCV with CUDA it crashes because nvcc throws an error Syntax error: word unexpected (expecting ")")
which I learned is usually the case if you try to run an nvcc binary that is for the wrong system (e.g. 32bit-nvcc on 64bit-system). So I guess it just runs the nvcc that is suppost for the target system and therefore crashes.
I figured it out:
-DCUDA_NVCC_FLAGS
EXTRA_OECMAKE_append = "-DCUDA_NVCC_EXECUTABLE=${PATH_TO_THE_NVCC_BINARY}"
The whole statement in the bbappend file could look like this
EXTRA_OECMAKE_append = " \
-DCUDA_NVCC_EXECUTABLE=${NVCC_BINARY} \
-DCUDA_NVCC_FLAGS="--compiler-bindir ${GCC_BINARY}" \
"