- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page