| View previous topic :: View next topic |
| Author |
Message |
hongyon
Joined: 19 Jul 2004 Posts: 551
|
Posted: Wed Oct 06, 2010 5:21 pm Post subject: |
|
|
Hi,
Do you have OpenMP directive in C/C++ source code at all? If that is the case, this could be a problem. Since your C/C++ is compiled with Visual C++ and it has its own Openmp implemenation. While your Fortran code is compiled with PGI and it also has its own implementation.
Let say, you don't have OpenMP code in C/C++, you will need to make sure that your main program/project is linked with PGI OpenMP library instead of Visual C++ OpenMP library.
Hongyon |
|
| Back to top |
|
 |
Eos Pengwern
Joined: 18 Aug 2010 Posts: 14
|
Posted: Wed Oct 06, 2010 5:36 pm Post subject: |
|
|
Thanks Hongyon;
No, I don't use any OpenMP in the C++ code; all the computationally-intensive stuff is kept within the Fortran DLL.
That being the case, is there a library I should explicitly link with, over and above those already listed in my linker command line (see my previous post)?
Stephen. |
|
| Back to top |
|
 |
hongyon
Joined: 19 Jul 2004 Posts: 551
|
Posted: Thu Oct 07, 2010 12:07 pm Post subject: |
|
|
In your Visual C++ main project, this is for a Release configuration:
Open up property page and set following properties:
1)
Configuration Properties -> C/C++ -> Code Generation -> Runtime Library -> Multi-threaded(/MT)
2) Configuration Properties -> General -> Common Language Runtime support ->No Common Language Runtime support
3) Configuration Properties -> Linker -> General -> Additional Library Directories
Added following 2 lines,
the first line depends on which version your PVF is.
the second line depends on where you put your Fortran library.
C:\Program Files\PGI\win64\10.9\lib
C:\Users\myname\Documents\Visual Studio 2008\Projects\openmpf\openmpf\x64\Release
4) Configuration Properties -> Linker -> Input -> Additional Dependencies -> [...]
Added following lines. openmpf.lib is your Fortran library name.
openmpf.lib
-defaultlib:pgmp
-defaultlib:pg
-defaultlib:pgf90
-defaultlib:pgf90_rpm1
-defaultlib:pgf902
-defaultlib:pgf90rtl
-defaultlib:pgftnrtl
-nodefaultlib:msvcrt
-nodefaultlib:msvcmrt
-defaultlib:libcmt
-defaultlib:pgc
-defaultlib:libnspgc
-defaultlib:oldnames
Also, I would make it static library instead of dll library. I am not sure it create DLL properly in PVF. If it works for you, go ahead.
Hongyon
Last edited by hongyon on Thu Oct 07, 2010 1:59 pm; edited 1 time in total |
|
| Back to top |
|
 |
hongyon
Joined: 19 Jul 2004 Posts: 551
|
Posted: Thu Oct 07, 2010 12:16 pm Post subject: |
|
|
I also noticed that you use MKL library. I don't have experience using them but it may have some specific library that you might use with PGI.
Hongyon |
|
| Back to top |
|
 |
hongyon
Joined: 19 Jul 2004 Posts: 551
|
Posted: Thu Feb 17, 2011 2:47 pm Post subject: |
|
|
I posted above that you should build static library instead of DLL.
All the dynamic library build in PVF is now should be as good as static library.
Hongyon |
|
| Back to top |
|
 |
|