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

using OpenMP with Visual Fortran Compiler

maria
Beginner
695 Views
Hi there,

I havebeen using Intel Visual Fortran Compiler 10.1 Professional Edition for Windows. The operation system is Windows XP.Recently, I started learning OpenMP. When I compile a simple program, I went to project properties andselected 'generate parallel code (/Qopenmp)' from 'process OpenMP directives' in Project/Properties/Fortran/Language.

I got error message 'unresolved external symbol _OMP_GET_NUM_THREADS referenced in function _MAIN' and 'unresolved external symbol _OMP_GET_THREADS_NUM referenced in function _MAIN'. What went wrong?

What is the correct procedure to compile the program with OpenMP. I have very limited experiences in programming. Detailed instruction is greatly appreciated.Attached is the simple example I used.

Thank you very much, maria
0 Kudos
3 Replies
jimdempseyatthecove
Honored Contributor III
695 Views

Check Link properties, General section, enable Link Library Dependencies

Jim
0 Kudos
Steven_L_Intel1
Employee
695 Views
Your program builds fine for me when /Qopenmp is enabled - no other settings are necessary.

Please attach the buildlog.htm from the Debug or Release folder, after doing a Rebuild of the solution, so we can see what is being used.
0 Kudos
maria
Beginner
695 Views
Your program builds fine for me when /Qopenmp is enabled - no other settings are necessary.

Please attach the buildlog.htm from the Debug or Release folder, after doing a Rebuild of the solution, so we can see what is being used.

Steve, the problem is solved. After several tries, I found that /Qopenmp is enabled in Active(debug) Configuration but not in Debug and Release Configuration. When I reset /Qopenmp for Debug and Release configuration, the program builds fine now.

Thanks a lot.
0 Kudos
Reply