error LNK2019: unresolved external symbol dfti_commit_descriptor_external referenced in function MAIN__

Problem:

When linking an application against PDE Poisson solver or DFTI solver you may obtain error messages like this:  error LNK2019: unresolved external symbol dfti_commit_descriptor_external referenced in function MAIN__ error #7002: Error opening the compiled module file.  Check INCLUDE paths.

The Root Cause
of this problem is in the wrong FORTRAN precompiled modules handling. Using MKL DFTI  in your FORTRAN program requires including precompiled modules into your project. There are few ways to do this. We will show in this article how to link an application against MKL DFTI when VS Solution or Makefile used for a project build.
1. MSVC  Solutions:
1.1  Using FORTRAN ‘INCLUDE' statement.
i.
Add the following line into the source file that defines a subroutine or a function with ‘use mkl_dfti' statement:
This line includes the definition of mkl_dfti module for compilation. The include line should be placed in the file 
before the function with ‘use mkl_dfti' statement. 
ii. Add MKL Include directory   (<MKL root directory>\include) to
Properties->Fortran->General->Additional Include Directories.
Add MKL libraries directory (<MKL root directory>\<ia32|em64t>\lib) to
the Properties->Linker->General->Additional Library Directories.
Fig.1


iii.
After that add to Properties->Linker->General->Additional Library Directories correct libraries path (<MKL root directory>\<ia32|em64t>\lib).

Fig.2

iv. Add references to MKL *.lib files to Properties->Linker->Input->Additional Dependencies.
Fig. 3


Example solution: dfti_with_include.zip
Win32, MSVC* 2005

Direct adding files into project (*)  
v.
Use ‘Project->Add Existing Item...' menu item to include mkl_dfti.f90  file from "<MKL root directory>\include" directory in your project.
Fig. 4

vi. After that add to Properties->Linker->General->Additional Library Directories correct libraries path (<MKL root directory>\<ia32|em64t>\lib).
the same as Fig.2
vii. Add references to MKL *.lib files to  Properties->Linker->Input->Additional Dependencies
the same as Fig 3.

Example solution: dfti_with_module.zip
Win32, MSVC* 2005

2. Makefile.

Using FORTRAN ‘INCLUDE' statement.
i. Add the following line into the source file that defines a subroutine or a function with ‘use mkl_dfti' statement:

This line includes the definition of mkl_dfti module for compilation.
The include line should be placed in the file before the function with ‘use mkl_dfti' statement.

ii.   Add -I$(MKLROOT)/include argument to ifort command in the makefile that build your application.  MKLROOT environment variable should contain the full path to MKL root directory.

iii. Link your application against MKL Library.

Example Solution: dfti_linux.zip
Linux, Intel®64), lp64

 

(*) Note, this method is not recommended because of mkl_dfti.90 may be changed in another version of mkl without notification.

You can also refer to the MKL user guide document, Chapter 10, "Creating, Configuring, and Running the Intel® Visual Fortran Project" and to the KB article How to build MKL application in Intel Visual Fotran (MSVC*2005)

Para obter informações mais completas sobre otimizações do compilador, consulte nosso aviso de otimização.