All, I am using a CARMA board for development and am attempting to compile a test program. I am having trouble with a few linker calls and was hoping I could get some assistance.
My development environment:
arm-linux-gnueabi-gcc-4.5
CMake v. 2.8.10 - using find_package(CUDA 4.2)
Super helpful toolchain file from OpenCV - "arm-gnueabi.toolchain.cmake"
My errors are as follows:
arm-linux-gnueabi-ld can’t find lcudart.so. (I tried so many CMake variables to adjust this, and no matter what nothing. I finally solved it by hacking it:
set(CUDA_LIBRARIES “/direct/path/to/workspace/CarmaDev/cuda/lib/libcudart.so”)
My next problem is that all function calls defined in my *.cu scream “undefined reference” yet I see the generated file in the arm-linux-gnueabi call.
Please could anyone offer any assistance? I’ll be glad to post my example cmake file for future arm developers.
I am not familiar with the CARMA board setup, but your link issue appears to be a generic C / C++ link issue. CUDA compiles all code as C++ code, and this means all function names in the object file are decorated in the C++ manner. C on the other hand expects undecorated function names. As the names are therefore different the linker cannot resolve the references. If you declare those functions in your .cu that comprise the externally visible interface as extern “C” I would expect the link issue to disappear.