I’m trying to use Magma library in my cuda fortran and openACC mixed code on windows 10. I successfully got magma 2.50 compiled after some effort, which uses intel MKL. But I got following link error when linking the library to my code:
VCOMP.lib(VCOMP140.DLL) : error LNK2005: omp_get_num_threads already defined in libpgc.lib(omp.obj)
VCOMP.lib(VCOMP140.DLL) : error LNK2005: omp_set_num_threads already defined in libpgc.lib(lcpu.obj)
VCOMP.lib(VCOMP140.DLL) : error LNK2005: omp_get_thread_num already defined in libpgc.lib(omp.obj)
It seems that these openMP functions have been defined in several libraries: intel MKL’s libiomp5md.lib, PGI’s libpgc.lib and VCOMP.lib. So my question is how to solve this duplicated symbol definition problem?
In the link option, I already intentionally removed the link to intel’s libiomp5md.lib, but it will be best to use the functions from that library. So the best option will be to tell the pgf90 linker to ignore libpgc.lib and VCOMP.lib. Is there any PGI compiler options similar to /NODEFAULT in visual studio to skip specific default library? There is an option -Mnostdlib but it disables all default library and is too much.
Thanks in advance.