Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

LIBGUIDE40.LIB

Svein-Atle_Engeseth
1,055 Views

Hi,

I have a hard time figuring which libraries to include when I compile a program. I have a program that calls MKL, when I compile and include D:\IVF\Compiler\Fortran\10.1.024\IA32\Lib\LIBGUIDE40.LIB I get these errors:

libguide.lib(kmp_csupport.obj) : error LNK2005: ___kmpc_global_thread_num already defined in LIBGUIDE40.LIB(libguide40.dll)
libguide.lib(kmp_csupport.obj) : error LNK2005: ___kmpc_end already defined in LIBGUIDE40.LIB(libguide40.dll)
libguide.lib(kmp_csupport.obj) : error LNK2005: ___kmpc_begin already defined in LIBGUIDE40.LIB(libguide40.dll)
D:\F90\XE\CLSTSQRA_NEW.exe : fatal error LNK1169: one or more multiply defined symbols found

In the ifort.cfg I have the line /MT and /QxT.

If I compile in debug mode using /MTd I get these errors:

LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

The processor is an Intel Core 2 Duo. The MKL is 10.0.3. Also in the responsefile is D:\MKL\IA32\LIB\MKL_C.LIB.

Please give advice. Does the compiler documentation contain any help?

Sincerely yours,

Svein-Atle Engeseth

0 Kudos
1 Reply
TimP
Honored Contributor III
1,055 Views

When using MKL threaded with ifort, I prefer to link with /Qparallel or /Qopenmp, so instructing ifort to choose the OpenMP run-time library. /Qopenmp can be used throughout, with only the effect of making all your compiled code thread-safe, when no OpenMP directives are included in your source code. Then, you avoid conflicts by not specifying an OpenMP library from the MKL installation. In fact, if you will always use a recent ifort or ICL, you could remove the libguide and libiomp5 libraries from your MKL installatiion. You must avoid linking conflicting OpenMP library versions, such as the dynamic and the static version, as you appear to have tried, or an old one along with a new one, or the libiomp5 along with the libguide, or a 32-bit and a 64-bit one, or a VC OpenMP library along with the Intel one. Libiomp5 is compatible with VC9 /openmp, and will be the only one supported in future ifort releases.

You are correct that multi-threaded Microsoft libraries must be used when using MKL threaded, but the ifort /Qparallel or /Qopenmp will take care of it, if you still use a Visual Studio version which includes non-threaded libraries.

0 Kudos
Reply