I am trying to invoke CUDA C functions from Go by using cgo. This requires
the CUDA libraries libcuda.so and libcudart.so to be linked in.
All the files compile just fine.
The problem occurs when you pack everything into an archive and invoke 6l
to perform the final llinking. Apparently, some of the library functions
call atexit. And 6l errors with
atexit(0) : Undefined
I see that the same problem was discussed here:
However, the solution that the person used (modifying the library) is not
feasible in our case as CUDA is closed source. Furthermore, including
/usr/lib/libc_nonshared.a on the 6l link line doesn't work.
We also tried using the -I and -r flags as specified in the documentation
(-I /usr/lib/ld-linux.so.2 -r /usr/lib64:/opt/nvidia/lib64) so that 6l
links against the CUDA standard headers, but that doesn't seem to help.