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

Conditional Compilation for different versions of MKL

$
0
0

Hi,

I would like to be able to compile the same source code on platforms with different versions of MKL.  I have come up against several problems:

1.  The compiler will not accept an "include" directive before a "use" statement.  I therefore cannot include the header file mkl.fi and then use values from it to select which library calls to make.  I read about making a new module to wrap the include statement here:  https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux...

2.  Using the separate module approach, I came up with some preprocessor directives which would determine which library calls to make according to which compiler/MKL version was being used.  The macros didnt seem to be defined using this approach though.  Code is below:

A little module which has the include in it

module MKLVersion
include '/opt/intel/mkl/include/mkl.fi'
end module MKLVersion

And then the calling code

use MKLVersion

!DEC$ IF DEFINED (INTEL_MKL_VERSION)
use MKL95_LAPACK, only : ggevx, geevx, sygvd
!DEC$ END IF

The calling code is in a module, and it doesnt make the call to use lapack. 

I would be grateful for any information about how I might be doing this wrong, or if there is a better approach to getting what I want. 

 

Thanks, Angus.

Thread Topic: 

Help Me

Viewing all articles
Browse latest Browse all 2583

Trending Articles



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