Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpath linking to cuda toolkit #69

Open
yobson opened this issue Jan 6, 2022 · 2 comments
Open

rpath linking to cuda toolkit #69

yobson opened this issue Jan 6, 2022 · 2 comments

Comments

@yobson
Copy link

yobson commented Jan 6, 2022

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

@tmcdonell
Copy link
Owner

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.

@yobson
Copy link
Author

yobson commented Jan 11, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants