Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

MKL and Intel Fortran - Newbee Question

Intel_C_Intel
Employé
863 Visites

Hi all,

I inherited responsibility for a fortran (IVF) dynamic link project that is part of my Visual Studio solution. I dont know fortran very well.

I have been asked to look at getting MKL to work with this program. MKL is installed. I added the path for the include, library, and executable files. I was not sure which additional dependences were needed in the linker > input section so I left that blank.

Now what do I do? I search the site for an example but could not find anything. I am not sure how I tell the fortran source files to use this new library.

I would appreciate any help to get started.

Thank you,

Eric

0 Compliments
5 Réponses
Chao_Y_Intel
Modérateur
863 Visites

Hi Eric,

You can refer the following documents:

1. The follow page talk to how to set the compiler environment:
http://support.intel.com/support/performancetools/libraries/mkl/win/sb/cs-017282.htm

2. MKL get stated document: MKLDIRGetting_Started.htm
Section "Linking Your Application with Intel MKL" talks about which library you need to link with your application.

Regards,

Chao

0 Compliments
Todd_R_Intel
Employé
863 Visites

In addition,

There is example source in the examples directory of MKL. This might be helpful for seeing how to include MKL headers and modules (depending on what functionality you are using).

-Todd

0 Compliments
aggiedad
Débutant
863 Visites

Hi Chao,

Thanks for the response. I believe I have installed and set the appropiate variables in both the shell and Visual Studio.

The documentation shows command line parameters on how to link the libraries to the program. Since I am using Visual Studio to compile I think I need to add the libraries to the project properties page. I am unsure where or how to do that. Can someone help?

I have found the examples Todd mentioned. I tried to add them as a project in Visual Studio but had no success. Can that be done? Is there any VS/ Fortran examples anywhere?

Thanks!

Eric

0 Compliments
ArturGuzik
Précieux contributeur I
863 Visites
Eric,

clicking in Studio (from main menu) Project/Properties brings up the Project Property pages. Select Linker/Input and in Additional Dependencies add the libraries you need, using the guidelines in Getting Started (as Chao already mentioned). For example, for cdecl interface for static linking, LAPACK, and kernel add: mkl_c.lib libguide.lib in it.
As far as LAPACK-95 interfaces go, read carefully notes, as you need to include in your project provided interfaces to F77 routines. After building project you will get warning LNK4078: multiple '_RDATA' sections found with different attributes (40301040), but this is harmless, so just ignore it.

A.



0 Compliments
TimP
Contributeur émérite III
863 Visites
The libguide provided with MKL is intended mainly for use with compilers which don't provide such a library. When using MKL with an up to date ICL or ifort, it's generally preferable to use the libguide provided by the compiler (e.g. implied by linking with -Qopenmp or -Qparallel). At least, this is my understanding, after getting tangled up several times, and consulting with Intel experts.
As recent responses pointed out, you would normally use only cdecl with compilers which support it. mkl_s is provided for compatibility with 32-bit compilers which used that interface, but are no longer maintained.
0 Compliments
Répondre