I am trying to compile the C programme which uses the MKL subroutine.
but when I am trying to compile it,
I am getting error like this.
It seems that I am not linking some path
or flags during the compilation.
icc one.c -L$MKLPATH -I$MKLINCLUDE -lmkl -liomp5 -lpthread
one.c -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lsplas -lm -lmkl -lguide
nothing wordks, got error like this
one.c(9): catastrophic error: cannot open source file "mkl_spblas.h"
compilation aborted for one.c (code 4)
Could some one pelase tell me how to fix this problem.
Is your environment correctly set up to use Intel C and MKL? Assuming that you are running in Linux, first try the simple command icc -mkl one.c.
If that works, but you wish to use other options for multi-threading, 8-bytet integers, etc., you will need to change to more elaborate options. Please consult the helpful MKL Link Line Advisor tool at https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor .
The include path -I$MKLINCLUDE is responsible for finding the .h files associated with MKL. If MKL is installed with your icc, sourceing the compilervars.
You should also use a sane order of options in your compile command. As mecej4 said, the link advisor would give you important hints.