I resume the post to help me clarify. Please correct me if/where I'm wrong.
Both MSVC and Intel Compilers (both icc and ifort) can link objects that are compiled either with vcomp or iomp.
But I should avoid to mix objects linking different OpenMP libraries, otherwise the output file will depend on both.
can compile either with:
- vcomp (default)
- iomp (with -nodefaultlib:vcomp.lib)(*)
Intel Compilers (both icc and ifort)
can compile with
- iomp (default)
but cannot compile with:
- vcomp (or at least, I cannot avoid to link iomp!)(**)
Now: I'm building shared libraries. One is built with MSVC, the other with Intel(***).
Because of (*) I can make both libraries depend on iomp (just avoid linking vcomp from MSVC and it's done).
But what if I would like to link both to vcomp? Because of (**) it seems to be a little tricky if ever possible.
How can I use two different dlls without previously agreeing on which OpenMP library to use?
P.S.(***) I have to compile the second library with Intel because it's written in Fortran so I need ifort!