NVIDIA / build-system-archive-import-examples

Examples for importing precompiled binary tarball and zip archives into various build and packaging systems
MIT License
10 stars 5 forks source link

Explicit DT_NEEDED #5

Open SomeoneSerge opened 1 year ago

SomeoneSerge commented 1 year ago

It seems that many of the https://developer.download.nvidia.com/compute/cuda/redist/ packages come with empty DT_NEEDED. For example patchelf --print-rpath lib/libnvrtc.so is empty, but libnvrtc.so (depending on usage) tries to dlopen libnvrtc-builtins.so at runtime.

In nixpkgs we use DT_NEEDED to infer dependencies of pre-built binaries and automatically patchelf them with appropriate Runpaths. When libraries dlopen() undeclared dependencies we currently only discover this from users' error reports and have to handle these dependencies manually, e.g.

We're still looking for better way to do things, but meantime I wonder if it would be possible to build cuda packages such that dependencies end up listed in DT_NEEDED in the first place. Thanks!