cuda icon indicating copy to clipboard operation
cuda copied to clipboard

rpath linking to cuda toolkit

Open yobson opened this issue 4 years ago • 2 comments

I'm not sure if this is a bug, but I'm packaging an application that depends on this library. The library packages completely fine, the the software I am trying to build doesn't. I get the following error:

ERROR: RPATH "/usr/local/cuda-11.4/targets/x86_64-linux/lib" on /home/abuild/rpmbuild/BUILDROOT/configd-rest-0.4.3.0-dlh.1.1.x86_64/usr/lib64/ghc-8.10.7/configd-rest-0.4.3.0/libHSconfigd-rest-0.4.3.0-HglcCoQAwNE7w6rVOYPnj-ghc8.10.7.so is not allowed

Now this makes a lot of sense. I cannot guarantee that a user of my software has the cuda sdk installed, but I can guarantee that they have the cuda library that comes with the driver installed (/usr/lib[64]/libcuda.so.1).

My question is, do we want/need this rpath when compiling software that depends on this library? or could it link against /usr/lib[64]/libcuda.so.1?

All the best

James

yobson avatar Jan 06 '22 15:01 yobson

Hmm, good point. Initially I added this to avoid other linking problems, but perhaps we should make do without it. I think it's in Setup.hs where we add the option to add the RPATH directly to the located CUDA toolkit.

tmcdonell avatar Jan 11 '22 10:01 tmcdonell

It is. I've patched it out and everything builds fine as far as this package is concerned. For some reason, that alone doesn't fix the RPATH issue when building with other packages, but I need to investigate this further. I'm not that familiar with ghc's linking approach when it comes to consuming libraries but what I think is going on is that this library requires access to the cuda-sdk in order to build, and so GHC adds the RPATH when linking against another library. I'm not 100% sure though. It could be an openSUSE packaging quirk.

yobson avatar Jan 11 '22 11:01 yobson