Search code examples
visual-studiofortranintelintel-fortranintel-mkl

MKL DFT Unresolved External Symbol despite proper INCLUDE file


I am trying to use the MKL Discrete Fourier Transform functions, I have Intel Parallel Studio XE installed with Microsoft Visual Studio, I have been using this setup for quite a while now without issue. I regularly use the MKL VSL libraries for parallel number generation and they work just fine. I am testing it by simply running the basic_dp_real_dft_3d.f90 code which is provided in my mkl folder under mkl/examples/examples_core_f/. I have simply copied this code into a new Visual Studio project (Fortran console application, as I would normally) and added at the beginning

include `mkl_dfti.f90`

I have verified that this file does exist in the mkl/include/ folder, and when I compile the code the module file is in fact compiled and shows up in the Debug/ folder of my project. However, I get the errors

Severity    Code           Description  
Error       error LNK2019: unresolved external symbol _dfti_set_value_intval referenced in function _MAIN__ 
Error       error LNK2019: unresolved external symbol _dfti_compute_forward_dz referenced in function _MAIN__           
Error       error LNK2019: unresolved external symbol _dfti_compute_backward_zd referenced in function _MAIN__      
Error       error LNK2019: unresolved external symbol _dfti_create_descriptor_highd referenced in function _MAIN__          
Error       error LNK2019: unresolved external symbol _dfti_set_value_intvec referenced in function _MAIN__ 
Error       error LNK2019: unresolved external symbol _dfti_commit_descriptor_external referenced in function _MAIN__       

All of these functions are defined in the mkl_dfti.f90 module. Is there something I'm missing? I have ensured that MKL libraries are enabled in the project properties. This is normally sufficient when I use the VSL libraries, so I have no idea what the issue is at this point.


Solution

  • The problem was that I had enabled MKL linking in the project properties for Release compilation, but not for Debug compilation. These can be changed through the dropdown menu at the top left called Configuration.