How do I actually link/include cuSolver in my code?

Hey everyone! I’m going to use the function cusolverDnDgesvd() in a C code of mine. I believe I also will be using the functions cusolverDnCreate(), assert(), and the types cusolverDnHandle_t and cusolverStatus_t in order to use the mentioned function.

The thing is, what library do I have to include in the code for the compiler (nvc) to detect it? Now, with these includes I found it detects the types, but not cusolverDnDgesvd() (I’m also using cuBLAS and OpenACC):

#include <openacc.h>
#include <cublas_v2.h>
#include <cuda_runtime_api.h>
#include <cuda.h>

#include <cusolverDn.h>
#include <cuda_runtime.h>
#include <assert.h>

In the makefile I’m using:

LIBRARIES := -lblas -lcublas -lcusolver

OPT := -fast -acc -Minfo -Mcudalib=cublas -DDEBUG

CC = nvc

###########################################

Target rules

all: build
build: myfile

myfile.o: myfile.c
$(CC) $(OPT) -o $@ -c $< -w

myfile: myfile.o
$(CC) $(OPT) -o $@ $+ $(LIBRARIES)

Help!

It might help if you provided the actual output from your make command. Is there any difference if you do:

-Mcudalib=cublas,cusolver

Also, I would generally recommend that you ask questions pertaining to nvc or nvc++ usage on the forum for those tools.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.