Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
告知
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 ディスカッション

linking to OPENMP libraries

mhovers
ビギナー
624件の閲覧回数

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 件の賞賛
2 返答(返信)
IDZ_A_Intel
従業員
624件の閲覧回数
Did you also add /Qopenmp to the compile?
Grant_H_Intel
従業員
624件の閲覧回数

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

返信