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

Use pkg-config To Link CUDA Libraries #55

Open
KodrAus opened this issue Mar 13, 2016 · 7 comments
Open

Use pkg-config To Link CUDA Libraries #55

KodrAus opened this issue Mar 13, 2016 · 7 comments

Comments

@KodrAus
Copy link

KodrAus commented Mar 13, 2016

It'd be good if collenchyma would link to CUDA libraries out of the box when using it as a feature.

To run the leaf-examples on my machine, I needed to provide my own build.rs to get the cuda lib dir added for link searching.

See this thread on rust users.

@KodrAus
Copy link
Author

KodrAus commented Mar 13, 2016

Related: autumnai/leaf-examples#7 (comment)

@hobofan
Copy link
Member

hobofan commented Mar 14, 2016

We have a build.rs for rust-cudnn, which should be adaptable to this. It should also allow for static linking though I've never tried that out.

Did the leaf-examples build after you added the build script?

I originally planned to add build scripts to the respective packages after #3 and #4 have been resolved, but maybe it also works in this repo. Also related to #46.

@KodrAus
Copy link
Author

KodrAus commented Mar 14, 2016

It did work once I'd added a build script including my CUDA lib dir. But I'm fairly new to CUDA so I wasn't sure if I'd just installed it incorrectly. Based on your links it looks like there's a bit more complexity in doing this properly than just cowboying it

@bklooste
Copy link

pkg-config introduce make and together they introduces a whole lot of new issues , collenchyma/ cargo should be doing this.

@hobofan
Copy link
Member

hobofan commented Mar 18, 2016

@bklooste As per cargo guide for build scripts using pkg-config is the advocated way. I don't know about any better and widely spread alternative that solves the same problem as pkg-config, but am open to suggestions.

@bklooste
Copy link

That may be but its a productivity killer ( when it leads to autoconf/automake) , was hoping cargo would take us further. .. A lot of large projects over the years went to cmake and Atom and OK results but then cargo looses its place.

AFAIK cudnn and cuda does not produce pkg-config files so it still wont be found , so you need to create your own pkg-config pc file and rely on LD_LIBRARY_PATH , which defeats the purpose .. Basically you have to ensure those lib folders are in the LD_LIBRARY_PATH path and that is mainly due to the way nvidia works.

@SomeKittens
Copy link

AFAIK cudnn and cuda does not produce pkg-config files so it still wont be found

pkg-config found both cudnn and cuda easily when the typical build failed, so this is wrong.

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

4 participants