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

Linking to MKL_DFTI

evankw21
Beginner
1,516 Views
I want to perform some FFTs using MKL in ifort 11.1 for Windows. I've set the "Use Intel Math Kernel Library" option to "Sequential..." under Project Properties => Fortran => Libraries. In my Fortran subroutine I have "use mkl_dfti". The linker comes back with the first error message being "error #7002: Error opening the compiled module file. Check INCLUDE paths. [MKL_DFTI]." I gather I have to compile the MKL library, but I don't know how to. There are no .mod files with mkl_dfti in the name in any of the diretories below the mkl directory that got installed automatically. I can't find any documentation on whether you have to compile, and, if so, how to. The quick-and-dirty solution has been to copy the mkl_dfti.f90 file to the source directory and include it in the Project. That seemed like a Kluge, but maybe that's how it's supposed to be. Any help would be appreciated.
0 Kudos
9 Replies
TimP
Honored Contributor III
1,516 Views
The libraries come pre-built. The examples (in the folder of that name) seem to assume use of nmake. I would think you would build the .mod files you need and move them under mklinclude, and set the appropriate include dependencies, if not already there, along with the library dependencies. Of course, it's OK to keep the include .f90 and .mod files in your project.
0 Kudos
Gennady_F_Intel
Moderator
1,516 Views
Quoting - tim18
The libraries come pre-built. The examples (in the folder of that name) seem to assume use of nmake. I would think you would build the .mod files you need and move them under mklinclude, and set the appropriate include dependencies, if not already there, along with the library dependencies. Of course, it's OK to keep the include .f90 and .mod files in your project.

Westwood, in the case if the recommendation above will not sufficient, we can do the MVSC Fortran project using such functionality. Please let us know if we may be of further assistance
--Gennady

0 Kudos
evankw21
Beginner
1,516 Views
Quoting - tim18
The libraries come pre-built. The examples (in the folder of that name) seem to assume use of nmake. I would think you would build the .mod files you need and move them under mklinclude, and set the appropriate include dependencies, if not already there, along with the library dependencies. Of course, it's OK to keep the include .f90 and .mod files in your project.
I'm not yet an expert in this area, so I don't understand it when you say the libraries are pre-built, but then you say that I would build the .mod files I need. What does pre-built mean? It seems like it would mean that the .mod files already exist and could be linked to. When you say that I would build the .mod files I need, how specifically? Create a different Project under my Solution and enter the .f90 source code files in the Intel directories? Or Create a Project in the Intel directories themselves?

Thanks for your help.
0 Kudos
evankw21
Beginner
1,516 Views
Quoting - evankw21
I want to perform some FFTs using MKL in ifort 11.1 for Windows. I've set the "Use Intel Math Kernel Library" option to "Sequential..." under Project Properties => Fortran => Libraries. In my Fortran subroutine I have "use mkl_dfti". The linker comes back with the first error message being "error #7002: Error opening the compiled module file. Check INCLUDE paths. [MKL_DFTI]." I gather I have to compile the MKL library, but I don't know how to. There are no .mod files with mkl_dfti in the name in any of the diretories below the mkl directory that got installed automatically. I can't find any documentation on whether you have to compile, and, if so, how to. The quick-and-dirty solution has been to copy the mkl_dfti.f90 file to the source directory and include it in the Project. That seemed like a Kluge, but maybe that's how it's supposed to be. Any help would be appreciated.
Gennady:

Your offer sounds like it would help me. I'm still unsure of what the product of the MVSC project would be and how I would use it.

0 Kudos
Gennady_F_Intel
Moderator
1,516 Views
Quoting - evankw21
Gennady:

Your offer sounds like it would help me. I'm still unsure of what the product of the MVSC project would be and how I would use it.


Please see the MVSC2005 attached.I linked the project with Intel CPEv.11.1 ( build 038).
As an additional info please refer to the following KB article:

http://software.intel.com/en-us/articles/how-to-build-mkl-application-in-intel-visual-fotran-msvc2005/
--Gennady


0 Kudos
evankw21
Beginner
1,516 Views

Please see the MVSC2005 attached.I linked the project with Intel CPEv.11.1 ( build 038).
As an additional info please refer to the following KB article:

http://software.intel.com/en-us/articles/how-to-build-mkl-application-in-intel-visual-fotran-msvc2005/
--Gennady


Gennady:

I had to do a few things for the enclosed test program to run and run quickly on my computer.

First, I changed the extension to .f90 because some of the lines extended beyond 72 characters, I suspect. Maybe you had a flag set to have unlimited line width, but I thought that would have transferred with the .vproj file.

Second, I had to set the "Use Intel Math Kernel Library" under the Libraries tab of the Fortran tab. Otherwise I got unsatisfied references to the dfti routines.

Third, I turned off IPO under the Linker => Optimization tab. Otherwise, the Linking would take several minutes, a problem I had already run to ground.

Let me know if any of these "fixes" are not kosher or recommended for some reason.

Thanks.

Evan
0 Kudos
Gennady_F_Intel
Moderator
1,516 Views
Quoting - evankw21
Gennady:

I had to do a few things for the enclosed test program to run and run quickly on my computer.

First, I changed the extension to .f90 because some of the lines extended beyond 72 characters, I suspect. Maybe you had a flag set to have unlimited line width, but I thought that would have transferred with the .vproj file.

Second, I had to set the "Use Intel Math Kernel Library" under the Libraries tab of the Fortran tab. Otherwise I got unsatisfied references to the dfti routines.

Third, I turned off IPO under the Linker => Optimization tab. Otherwise, the Linking would take several minutes, a problem I had already run to ground.

Let me know if any of these "fixes" are not kosher or recommended for some reason.

Thanks.

Evan

1- some of the lines extended beyond 72 characters - If you are using Intel Fortran Compiler, you can use options /4L132 or /extend-source 132. These options will specify the length of the statement field in a fixed-form source file. For more info refer to the Fortran documentation.

2)Do you mean you set the "Use Intel Math Kernel Library" == as Parallel (/Qmkl:parallel) or Sequential (/Qmkl:sequential) ? otherwise - unresolved refererncies?
that's very strange - these options, for example (Qmkl:parallel == mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib ) for the win32

3) Turning off IPO - we saw this tread where Dima recommended you to do that:) http://software.intel.com/en-us/forums/showthread.php?t=69481
--Gennady

0 Kudos
evankw21
Beginner
1,516 Views

1- some of the lines extended beyond 72 characters - If you are using Intel Fortran Compiler, you can use options /4L132 or /extend-source 132. These options will specify the length of the statement field in a fixed-form source file. For more info refer to the Fortran documentation.

2)Do you mean you set the "Use Intel Math Kernel Library" == as Parallel (/Qmkl:parallel) or Sequential (/Qmkl:sequential) ? otherwise - unresolved refererncies?
that's very strange - these options, for example (Qmkl:parallel == mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib ) for the win32

3) Turning off IPO - we saw this tread where Dima recommended you to do that:) http://software.intel.com/en-us/forums/showthread.php?t=69481
--Gennady

Gennady:

Regarding (2), maybe it wasn't clear that I am on a Windows 32 machine. I don't recall if I set it to the Parallel or Sequential setting, but I don't think it mattered.

Evan
0 Kudos
Ying_H_Intel
Employee
1,516 Views
Quoting - evankw21
Gennady:

Regarding (2), maybe it wasn't clear that I am on a Windows 32 machine. I don't recall if I set it to the Parallel or Sequential setting, but I don't think it mattered.

Evan

Hi Evan,
Your fix about the enclosed test program looks not problem.

Regarding to 2), you and gennadyis meaning same option:
the "Use Intel Math Kernel Library" option to "Sequential..." under Project Properties => Fortran => Libraries.set /Qmkl:sequential or /Qmkl:parallel.
The option works.

(The option'sfunctionalityis to set MKL include path, library path, and library automatically. These paths and library in the DFT project gennady providedare set bymanuallybased onhismkl install directory: C:AppsIntelCompiler11.1�38mklinclude, your mkl may not locate in the folder, so you can 't build the sample untill open the option, which set right paths based on your mkl install directory).

About your originalproblem:
"error #7002: Error opening the compiled module file. Check INCLUDE paths. [MKL_DFTI]."
Right, the quick-and-dirty solution is to copy the mkl_dfti.f90 file to the source directory and include it in the Project.
And if you doesn'tlike to copy and include it in your project, then as DFT project show, you need add

! Include to build module MKL_DFTI
INCLUDE 'mkl_dfti.f90'
before the code
USE MKL_DFTI

Regards,
Ying
0 Kudos
Reply