As I wanted to compile my program (using Cusparse) the following lines appeared:
tmp/tmpxft_00001048_00000000-13_matvec.o: In function main\':
tmpxft_00001048_0000
You need to link with the cuSPARSE library. Since you're using Linux, adding -lcusparse
to your nvcc command line should be sufficient.
Note that you may also need to add the CUDA libraries path to your LD_LIBRARY_PATH environment variable if the system fails to find the linked libraries when executing.