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

compiler doesn't recongnize mkl_set_exit_handler.

Pramod_V_
Beginner
327 Views
Hi, I installed the Intel MKL v11.1 update 4 and I am trying to use mkl_set_exit_handler to capture the system errors (#136) we have been seeing lately on our Fortran applications. The compiler doesn't seem to recognize this subroutine as I keep getting the unresolved external symbol error. Do I need any use statements for to call this mkl subroutine? I attached my test project for your reference. It is the same as the one in the manual. Thanks, Pramod
0 Kudos
3 Replies
mecej4
Honored Contributor III
327 Views

When you use external subprograms without providing interfaces, you are probably operating in "separate compilation" mode unless you tell the compiler to do cross-routine checking. Likewise, the MKL (or any such external library) is not going to be searched for missing routines unless you so order the compiler. 

The mere fact of having installing MKL does not cause the MKL libraries to be added by default to a new project. You have to select one of the options in the IDE to make the search happen.

For your toy example, ifort /Qmkl Console1.f90 MyExit.f90 will produce an executable file at the command line. Note the /Qmkl option (on Linux, it is -mkl).

0 Kudos
Pramod_V_
Beginner
327 Views

I realize that I need to turn on the MKL compiler switch, but it still doesn't recognize this function. I also added the interface for the myexit, but doesn't help.

It seems mkl_set_exit_handler is one of the recently released with 11.1 update 4. 

0 Kudos
mecej4
Honored Contributor III
327 Views

In your project properties pop-up window, set Configuration Properties->Fortran->Libraries->Use Intel Math Kernel Library to one of the options provided (e.g., Sequential). In your present configuration, that line is blank, so MKL libraries are not searched.

0 Kudos
Reply