Search code examples
c++eclipsecudagslnsight

How to use the GNU scientific library (gsl) in nvidia Nsight eclipse


I would like to use some gsl functions in my CUDA code. (in Nsight eclipse on linux) I have installed gsl and now I should setup the linker setting in eclipse.

I have tried to follow the steps outlined here, but I have some issues. In the project properties there is no "C/C++ Build" menu only "Build" and I was not able to find the setting mentioned in the above blog post.

How can I setup the linker settings ?

Thanks in advance!


Solution

  • You won't be able to use gsl routines directly in CUDA device code. The gsl libraries (-lgsl) are compiled for x86 usage and will not run on a GPU.

    If you only want to use gsl routines in host code, it should be sufficient to simply specify the include file and path, the linker path, and the linker library:

    -I/usr/local/include/gsl
    -L/usr/local/lib (or /usr/local/lib64)
    -lgsl
    

    Here's a question/answer discussing how to make these kind of additions in nsight eclipse