Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

linking to OPENMP libraries

mhovers
Beginner
362 Views

I am trying to add some openmp to my existing code, which is a mix of fortran and C. The OPENMP calls will all be from fortran routins. I have tired to add /Qopenmp-lib:compat under Properties->Linker->Command Line but i still get:

Error 3 error LNK2019: unresolved external symbol _OMP_SET_NUM_THREADS referenced in function _MAIN__ main.obj

at the first occurance of and openmp call.

What do I have to do in the compile/link parameters??

thanks,

0 Kudos
2 Replies
IDZ_A_Intel
Employee
362 Views
Did you also add /Qopenmp to the compile?
0 Kudos
Grant_H_Intel
Employee
362 Views

Hi mhovers,

You do not typically need to specify /Qopenmp-lib:compat for mixed Fortran and C code unless you are mixing OpenMP code from Intel and Native compilers in the same application. In addition, that command line argument is already the default in the version 11 compilers and beyond.

As Steve Lionel says below, the important switch you need is /Qopenmp. That switch is necessary to link in the OpenMP run-time library called libiomp5.dll. I hope this helps.

- Grant

0 Kudos
Reply