- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi!
I use Visual Fortran 11.1 Windows 7 64bit to build a 32bit Library that is used from C++. Everything works as expected as far as I don't activate OpenMP in the Fortran lib. Although the C++ code links against libiomp5 as suggested by the docu, I get linker error LNK2019: unresolved external symbol _omp_get_num_procs_ .
I would appreciate any advice.
Thx,
Jan
Link kopiert
2 Antworten
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
If you have the function call omp_num_procs() in your source code, the standard way to make it go away when you compile without /Qopenmp is to make it conditional compilation:
#ifdef _OPENMP
USE omp_lib
#endif
......
#ifdef _OPENMP
np=omp_get_num_procs()
#endif
This would require the /fpp compile option be set.
#ifdef _OPENMP
USE omp_lib
#endif
......
#ifdef _OPENMP
np=omp_get_num_procs()
#endif
This would require the /fpp compile option be set.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi TimP,
that's what I did and as I said everything works fine without/Qopenmp. With OpenMP enabled I can compile the Fortran lib with no error. The error occurs when I link my C++ code against the Fortran lib because it can't find the OpenMP symbols although I also link against libiomp5. To make it clear: I'd like OpenMP to be enabled.
--
Jan
Antworten
Themen-Optionen
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite