Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
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.

openMP and LNK2019 error!!!

arvinfx
Beginner
1,008 Views
Hi

I try to write simple code for multiprocessing but I have error lnk2019 !
The code is:

Program testme
use omp_lib
implicit none
integer numproc
numproc=-1
numproc=omp_get_num_procs()
print *,numproc
end program testme

And this is my information:

Cpu : AMD Phenon2-940 3000Ghz

Where is my problem guys?

0 Kudos
6 Replies
TimP
Honored Contributor III
1,008 Views
Apparently, you didn't turn on the OpenMP option in Visual Studio Fortran properities for your project. You make an explicit
OpenMP function call, so you must instruct ifort to compile and link with OpenMP.
0 Kudos
Arjen_Markus
Honored Contributor II
1,008 Views
Have you turned on the OpenMP option? It is part of the preprocessor options in Visual Studio.

Regards,

Arjen
0 Kudos
Steven_L_Intel1
Employee
1,008 Views
Fortran > Language options...
0 Kudos
arvinfx
Beginner
1,008 Views
Thanks to all it is work now.
0 Kudos
mohsenmola
Beginner
1,008 Views
Hi
I have a similar problem. what do yo do exactly to solve the problem withLNK2019?
Thanks
0 Kudos
Steven_L_Intel1
Employee
1,008 Views
Are you also using OpenMP? LNK2019 could have many different causes, depemding on your program
0 Kudos
Reply