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

Linking error against libcuda (using GHC 7.8.2) #11

Closed
svenssonjoel opened this issue Apr 18, 2014 · 12 comments
Closed

Linking error against libcuda (using GHC 7.8.2) #11

svenssonjoel opened this issue Apr 18, 2014 · 12 comments

Comments

@svenssonjoel
Copy link

setup:
Ubuntu Linux 13.04
CUDA version 5.0
Driver Version 304.116
hs cuda version cuda-0.5.1.1

Taste of error messages:
undefined reference to cuCtxAttach' undefined reference tocuCtxDetach'
...

@tmcdonell
Copy link
Owner

I am going to put this down to a Jenkins configuration issue, since installing on the machine interactively works fine. Please reopen though if you find further information.

@amigalemming
Copy link

I got this error, too, with accelerate-cuda-0.15.0.0 from github/head.

@amigalemming
Copy link

However, when compiling with 'cabal configure --enable-executable-dynamic' the linker errors disappear.

@tmcdonell tmcdonell reopened this May 28, 2014
@tmcdonell
Copy link
Owner

@amigalemming @svenssonjoel what version of ghc are you using? I am wondering now if this is an issue introduced with 7.8, which started using dynamic linking.

@tmcdonell
Copy link
Owner

(and I would like to say "does it happen with 7.6", but I don't think getting HEAD to work with 7.6 will be straightforward for you... I'll see if I can dig up a linux box to try it on)

@amigalemming
Copy link

This custom 'configure' stuff usually seems to be quite fragile. I have much better experience with Cabal's support of pkg-config. Unfortunately, not all packages support that, e.g. llvm. Currently I try to generate my own '.pc' file for 'llvm'. Maybe this approach is also reasonable for 'cuda'?

@svenssonjoel
Copy link
Author

I can confirm that I still have the same problem. Just tried it fresh in a sandbox locally on my laptop with accelerate and accelerate-cuda from HEAD. Using GHC 7.8.2 (with the patch - not that it influences this).

@tmcdonell
Copy link
Owner

@amigalemming I've never tried writing my own pgk-config scripts. Could you provide an example script demonstrating what you mean? To my naive eyes, it would just seem like shifting the problem somewhere else...?

@svenssonjoel okay, thanks for the update.

Since I can't reproduce this on my machine, I'm going to need you both to try and provide more information so we can narrow down the problem. Since there are two of you now experiencing this problem, hopefully the differential diagnosis will be easier! For a start, please grab the latest github version of the package and try installing with verbose options enabled, and just copy/paste that into a gist for me.

It might also be good to make sure you have the latest cabal installed, and maybe a clean ~/.cabal/config.

@amigalemming
Copy link

@tmcdonell The pkg-config pc files are simple configuration text files, no scripts, i.e. no running programs. Creating such configuration files certainly shifts the problem - in the long run, we can hopefully shift that to the CUDA maintainers. :-)
Here is an example for a pc file generator for LLVM, unfortunately only tested on Linux:
http://hackage.haskell.org/package/llvm-pkg-config
http://hackage.haskell.org/package/llvm-pkg-config-0.0/src/make-pkg-config.sh
http://llvm.org/bugs/show_bug.cgi?id=9405

@tmcdonell
Copy link
Owner

To clarify, are you getting this on git HEAD?

@tmcdonell
Copy link
Owner

@amigalemming I just noticed that my CUDA-6.0 install includes pkg-config files. I'm not sure if they were also there in 5.5, but they are not there with 5.0. It appears that they aren't installed into a default PKG_CONFIG_PATH, however. They also have names prefixed by version, which is a bit annoying (cuda-6.0.pc instead of cuda.pc). Anyway, not sure if this will be useful right now, but perhaps future versions will have better integration with pkg-config, and we can transition to that at that time.

@tmcdonell
Copy link
Owner

I'm closing this because it's been quiet for so long, and the configuration process is now completely rewritten. Please open a new ticket if you still have problems!

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

3 participants