Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

segmentation fault in mkl_ddnscsr

pjssilva
Beginner
737 Views

Hello,

I am trying to compile the following simple C program to test mkl_ddnscsr (convert from dense matrix to sparse csr matrix). It creates a dense m x 1 matrix (a dense vector) and tries to convert it. Unfortunately the program crashes (with a segmentation fault) in my enviroment. The program is attached if someone wants to try to compile it.


#include

int main()
{

#define M 100

int m = M;
int n = 1;
double v;
double sv;
int isv[M + 1];
int jsv;
int job[6] = {0, 0, 1, 2, M, 1};
int info;
int i;

for(i = 0; i < m; ++i)
v = 1.0;

mkl_ddnscsr(job, &m, &n, v, &m, sv, jsv, isv, &info);

return 0;
}

I am using Linux (Ubuntu 9.10), gcc 4.4.1 and I believe that I am getting the link options correct (I got the linking line from the link advisor). Here is the command line I use to compile:

gcc -Wall -O3 -funroll-loops -ftree-vectorize -mtune=native -march=native -I/opt/intel/mkl/10.2.2.025/include -DVERBOSE -DDEBUG -lm -o testsparseblas testsparseblas.c /opt/intel/mkl/10.2.2.025/lib/em64t/libmkl_solver_lp64_sequential.a -Wl,--start-group /opt/intel/mkl/10.2.2.025/lib/em64t/libmkl_intel_lp64.a /opt/intel/mkl/10.2.2.025/lib/em64t/libmkl_sequential.a /opt/intel/mkl/10.2.2.025/lib/em64t/libmkl_core.a -Wl,--end-group -lpthread

Any hints?

Obs: Sorry I could not make the editor honor the indentation in the code above, but it is so simple that the lack indentation does not make it unreadable.

0 Kudos
1 Reply
Gennady_F_Intel
Moderator
737 Views

please try

mkl_ddnscsr(job, &m, &n, v, &n, sv, jsv, isv, &info);

and let us know how it will work

--Gennady

0 Kudos
Reply