It seems that the mangled c++ symbols for the host side of cuda kernels are not exported by the shared library and causes problems during linking of applications (even non-cuda ones):
Scanning dependencies of target dump_cbuffer
[ 27%] Building C object tools/CMakeFiles/dump_cbuffer.dir/dump_cbuffer.c.o
[ 27%] Linking C executable dump_cbuffer
../sixtracklib/libsixtrack.so: undefined reference to `__cudaRegisterLinkedBinary_55_tmpxft_000026c9_00000000_6_managed_buffer_remap_cpp1_ii_da9df0a7'
../sixtracklib/libsixtrack.so: undefined reference to `__cudaRegisterLinkedBinary_57_tmpxft_000026ae_00000000_6_extract_particles_addr_cpp1_ii_90dc0973'
../sixtracklib/libsixtrack.so: undefined reference to `__cudaRegisterLinkedBinary_64_tmpxft_00002678_00000000_6_be_monitors_assign_out_buffer_cpp1_ii_54dd6e05'
../sixtracklib/libsixtrack.so: undefined reference to `__cudaRegisterLinkedBinary_50_tmpxft_000026e4_00000000_6_track_particles_cpp1_ii_c22b58a6'
../sixtracklib/libsixtrack.so: undefined reference to `__cudaRegisterLinkedBinary_65_tmpxft_00002693_00000000_6_elem_by_elem_assign_out_buffer_cpp1_ii_2a58a681'
collect2: error: ld returned 1 exit status
tools/CMakeFiles/dump_cbuffer.dir/build.make:88: recipe for target 'tools/dump_cbuffer' failed
make[2]: *** [tools/dump_cbuffer] Error 1
CMakeFiles/Makefile2:2253: recipe for target 'tools/CMakeFiles/dump_cbuffer.dir/all' failed
make[1]: *** [tools/CMakeFiles/dump_cbuffer.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
The same source code compiles and links successfully under cmake < 3.15. May have something to do with LINKER_LANGUAGE=C setting for sixtrack_cuda_device and sixtrack_cuda_host which always seemed a bit fishy to me.
It seems that the mangled c++ symbols for the host side of cuda kernels are not exported by the shared library and causes problems during linking of applications (even non-cuda ones):
The same source code compiles and links successfully under cmake < 3.15. May have something to do with
LINKER_LANGUAGE=C
setting forsixtrack_cuda_device
andsixtrack_cuda_host
which always seemed a bit fishy to me.