Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

How to include mkl_spblas.f90 ?

dimdol10
New Contributor I
268 Views

Hello,

I'm trying to use mkl_sparse_spmm routine, which seems to require include mkl_spblas.f90.

When I just state include 'mkl_spblas.f90' at the head of my subroutine, it triggers many compile errors.

Could you give me some comments or an example of including the mkl_spblas.f90??

Thanks.

 

 

 

0 Kudos
2 Replies
mecej4
Black Belt
268 Views

If you look at the contents of the file mkl_spblas.f90, you will see that it contains the source code of a complete MODULE. Such lines of code should not occur inside the source code of another program unit. Do one of the following, with the second alternative preferred because it avoids repetitive compilations of the module source:

  1. Place include 'mkl_spblas.f90' outside any block of code that constitutes a program unit
  2. Place include 'mkl_spblas.f90' by itself in a separate file.

In either case, the source file containing  include 'mkl_spblas.f90' should be compiled before attempting to compile other program units that USE the module mkl_spblas.

dimdol10
New Contributor I
268 Views

Many thanks for your help, mecej4.

I add the mkl_spblas.f90 file to my project, and state 'USE MKL_SPBLAS' at the subroutine, then it works.

I think, in this way, we don't need the statement include 'mkl_spblas.f90' and seperate compilation.

Thanks again.

 

Reply