Quantcast
Channel: Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2583

Not including mkl.fi

$
0
0

I'd actually like to ask about why I'm able to compile this example program. Obviously, this isn't an issue for the system I'm on right now, but I hope to not run into compiling issues when I'm working on a different system. The example program is very simple, it calls the LAPACK axillary function dzsum1. Here it is:

program dzsum1_test

integer, parameter :: WP = selected_real_kind(15,307)
complex(WP) :: a(5)
real(WP) :: res
real(WP) :: dzsum1
external :: dzsum1

a(1) = cmplx(1.d0,1.d0)
a(2) = cmplx(1.d0,1.d0)

res = dzsum1(5,a,1)
write(*,*) res

end program

Now, I can compile and run this program successfully with

ifort dzsum1_test.f90 -mkl
  1. Why does this work? Specifically, why don't I need to put
    include "mkl.fi"
    anywhere in my program? That is an include file for this function that's listed in the MKL Reference and I thought that I would need to make sure dzsum1 was declared in my file before I declared it as external. Whether I put the include line before or after the program statement, the compilation doesn't work. I'm assuming this has something to do with the behavior of "-mkl" but I can't find anything in the MKL user guide, MKL reference, or ifort man pages that talk about this switch doing anything except linking libraries, which I thought wasn't sufficient for an external declaration.
  2. If it is in fact the "-mkl" switch that makes all this possible, is there a way to print out what it's doing?

Sorry for such a simple question, any help would be appreciated.


Viewing all articles
Browse latest Browse all 2583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>