I would like to implement mkl_lapack's tridiagonal eigenvalue algorithm dstevr
in one of my header files
#include "mkl.h"
void trideigs(int N, int LDZ, double *Z, double *W, double *D, double *E){
double VL=0.0, VU=1.0, ABSTOL=0.0;
int IL=1, IU=N, M=N, LWORK=20*N, LIWORK=10*N, INFO;
int *ISUPPZ=(int*)malloc(2*M*sizeof(int));
int *IWORK=(int*)malloc(LIWORK*sizeof(int));
W=(double*)malloc(N*sizeof(double));
Z=(double*)malloc(LDZ*M*sizeof(double));
double *WORK=(double*)malloc(LWORK*sizeof(double));
dstevr("V","A",&N,D,E,&VL,&VU,&IL,&IU,&ABSTOL,&M,W,Z,&LDZ,ISUPPZ,WORK,&LWORK,IWORK,&LIWORK,&INFO);
}
I managed to change Nsight's default compiler to icc and set the -mkl
option directly with -Xcompiler
.
At compile time NVCC Compiler runs successfully, but NVCC Linker fails with the following error message:
Building target: cuMatlab Invoking: NVCC Linker /usr/local/cuda-8.0/bin/nvcc --cudart static -L/usr/local/cuda/lib64 -ccbin /opt/intel/bin/icpc --relocatable-device-code=false -gencode arch=compute_52,code=compute_52 -gencode arch=compute_52,code=sm_52 -link -o "cuMatlab" ./src/cuMatlab.o -lcublas -lcusolver -lcufft -lgomp ./src/cuMatlab.o: In function
trideigs(int, int, double*, double*, double*, double*)': /tmp/tmpxft_000045f8_00000000-13_cuMatlab.ii:85694: undefined reference to
dstevr' makefile:59: recipe for target 'cuMatlab' failed make: *** [cuMatlab] Error 1
Do I need to add a library path? Any ideas?