Beginner question - Compiling with MKL_DFTI in Fortran

Beginner question - Compiling with MKL_DFTI in Fortran

I am experimenting with the Intel compiler and MKL and comparing them to GFortran and FFTW. I am unable to compile my program using the MKL library. I get the following error:

error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MKL_DFTI]

My command is:

ifort -I/opt/intel/Compiler/11.0/083/mkl/include -o procsl procsl.f90 -L/opt/intel/Compiler/11.0/083/mkl/lib/em64t/ -lmkl_core

When using my own modules, I always use -module when using a "USE MODULE" statement, but I don't see any *.mod files in the MKL directories.

I'm sure this is a simple fix, but I can't find it anywhere in the documentation or this forum. Any help would be greatly appreciated.

13 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quoting - chambes

error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MKL_DFTI]

My command is:

ifort -I/opt/intel/Compiler/11.0/083/mkl/include -o procsl procsl.f90 -L/opt/intel/Compiler/11.0/083/mkl/lib/em64t/ -lmkl_core

The .mod files in my installation are in the subdirectories in the mkl/include directory. For example, for x86_64, there are mkl/include/em64t/lp64/*.mod (32-bit integers) and mkl/include/em64t/ilp64/*.mod (64-bit integers).
The -L path should be set implicitly when you source the ifortvars script, so that's redundant.
-lmkl_core won't work by itself. You need also the ilp64 or lp64 library and (since you don't have any threading library option) -lmkl_sequential

Quoting - tim18

The .mod files in my installation are in the subdirectories in the mkl/include directory. For example, for x86_64, there are mkl/include/em64t/lp64/*.mod (32-bit integers) and mkl/include/em64t/ilp64/*.mod (64-bit integers).
The -L path should be set implicitly when you source the ifortvars script, so that's redundant.
-lmkl_core won't work by itself. You need also the ilp64 or lp64 library and (since you don't have any threading library option) -lmkl_sequential

Thanks for the quick reply!

I realize now that my linking isn't complete - I'll get that fixed once I get it to compile.

In my MKL installation directory I have mkl/include/*.f90 but no *.mod files and no em64t directory. Any ideas on why I wouldn't have that directory?

Quoting - chambes

Thanks for the quick reply!

I realize now that my linking isn't complete - I'll get that fixed once I get it to compile.

In my MKL installation directory I have mkl/include/*.f90 but no *.mod files and no em64t directory. Any ideas on why I wouldn't have that directory?

The difference in my installations seems to be that the blas95 .mod files have to be built by the makefile procedure in one case, and come pre-built in the other. I went off track there in my previous answer. It looks like they leave it up to you to compile mkl_dfti.f90 (with the same compiler you will use in your application) to make the corresponding .mod.

For those who may be having a similar issue - my system administrator had to manually compile the .f90 files in mkl/include. They were not compiled during the installation of the Professional Compiler Suite.

Quoting - chambes
They were not compiled during the installation of the Professional Compiler Suite.

This is actually clearly written in the User's Guide (Fortran 95 Interfaces and Wrappers to LAPACK and BLAS) on pages 7-2 to 7-4, and full procedure (how to create thme) given. So it is "by design" and not that your installation failed or partially went wrong.

A.

Quoting - ArturGuzik

This is actually clearly written in the User's Guide (Fortran 95 Interfaces and Wrappers to LAPACK and BLAS) on pages 7-2 to 7-4, and full procedure (how to create thme) given. So it is "by design" and not that your installation failed or partially went wrong.

A.

I was not using LAPACK or BLAS, though. I was using the FFT library.

Quoting - chambes
I was not using LAPACK or BLAS, though. I was using the FFT library.

Sorry, I must have missed something. I admit I don't get it why did you need to compile the files (I understand you needed some include files for MKL DFTI lib)? I see no reason for that as VS should automatically create it for you.

A.

Quoting - ArturGuzik

Sorry, I must have missed something. I admit I don't get it why did you need to compile the files (I understand you needed some include files for MKL DFTI lib)? I see no reason for that as VS should automatically create it for you.

A.

I need the .mod files, which needed to be compiled from .f90 files as part of the installation. I'm assuming you meant visual studio by VS - I am in a Linux environment using ifort from the command line.

Best Reply

Hi,

MKL did not provide precompiled .mod files because they are compiler dependent. Even if they were compiled with one version of Intel ifort, they won't be compatible with another, not to say about other compilers that MKL supports. Moreover, on64-bit systems MKLsupports LP64 and ILP64 bit interafaces. Forthese interfaces.mod files are different, but should have the same name. That is the reason why the module definition files such as mkl_dfti.f90 are left forcompilation at user's side.

Dima

Thanks for your reply. I found I had to include a couple of lib files to get it compile. Now the problem is solved.

I have always had similar issues with Fortran and C++ compilers.

Although INTEL provides code samples and comprehensive documentation to use with the compilers, they never provide the compilation approach in the same documentation of the example code. The compilation or coupling with other libs is usually the main and starting point of frustration in Fortran and C++ for beginners and sometimes intermediate users.

The documentation source to use INTEL FFT and example codes without the clear declaration of the compilation approach is an example of what I mean:

The link: https://software.intel.com/en-us/mkl-developer-reference-fortran-fft-cod...

The documentation could directly point out that the user needs to execute the following command for proper compilation:

 

ifort -mkl [link to mkl_dfti.f90] file.f90

I have found it frustrating because just mentioning the use of "MKL_DFTI" module in the documentation is not enough for easy compilation.

Best

Vahid

you may find out many examples how to build MKL DFT*.f90 examples - see mklroot/examples/dftf and see how to use makefile and then easy compile.  

Leave a Comment

Please sign in to add a comment. Not a member? Join today