I am using “owl” in combination with OptiX and cuda to ray cast a scene. Recently, I switched to Ubuntu 21.10 from Ubuntu 20.04 LTS which also means a switch to a different Cuda (11.5.119), gcc (11.2) and Cmake (3.18.4) version. Since then I am not able to build “owl” any more.
It fails with
nvlink fatal : Could not open input file ‘/usr/lib/x86_64-linux-gnu/librt.a’
The librt.a under this specific path seems to be incompatible with nvcc because when only allowing libraries under that path, building with the verbose option says it’s incompatible (among other libraries). However, FindCUDAToolkit.cmake finds this particular version of rt and adds this specific path to the target
CUDA::cudart_static_deps which then results in above linker error (because owl links to
CUDA::cudart_static). When only compiling with -lrt, everything works fine.
This issue wasn’t present before because the CMake version was below 3.17 and FindCUDAToolkit is present only since 3.17.
Not sure if this is something that can be fixed from the cuda side of things or if I should rather address the CMake people. Maybe someone can shed some light if this version of librt is supposed to be incompatible? As I haven’t found anything about this issue, it doesn’t seem to be common.