Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Roger_X_
Beginner
75 Views

Printing Constant from mkl library

Hi. 

I am trying to compile the following program (test.c) to find value of a constant in the mkl 10.0.4.023.

#include<stdio.h>
#include "mkl.h"
main()
{
	int a = SPARSE_INDEX_BASE_ZERO;
	printf("%d", a);

}

with the following commands:

source compilervars.sh intel64

icc test.c -DMKL_ILP64 -I${MKLROOT}/include  -L${MKLROOT}/lib/mic -lmkl_intel_ilp64 -lmkl_core -l    mkl_sequential -lpthread -lm -ldl

The message that I get is:

 

-bash: MKLROOT: command not found
-bash: MKLROOT: command not found
find_constant.c(7): error: identifier "SPARSE_INDEX_BASE_ZERO" is undefined
      int a = SPARSE_INDEX_BASE_ZERO;
              ^

compilation aborted for find_constant.c (code 2)

Is the program that I write correct?

If not, how to find out the value of the constants used in mkl?

 

Thank you.

 

0 Kudos
2 Replies
Gennady_F_Intel
Moderator
75 Views

These constants are defined into header files. Pls have a look at the mkl_spblas.h as an example. How to check this value? You may find out the example - sparse_spmm.c. 

Roger_X_
Beginner
75 Views

I found out that my mkl version was too old. After installing a newer mkl, that program compiled. Thanks for the help.

Reply