Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

libifcoremd.dll dependency

fabian
Beginner
1,833 Views
Is it possible to link the intel fortran runtime libs statically to my fortran libs, so my application is not dependent on libifcoremd.dll, libmmd.dll and others?
I'm using MD runtime library (/LD Compiler switch) and msvc2005. I link my fortran libs to a C++ application.
Thank you very much.

0 Kudos
12 Replies
Steven_L_Intel1
Employee
1,833 Views
Yes, you can use /MT or /libs:static /threads

With VS2005, there is no longer a single-threaded static library.
0 Kudos
fabian
Beginner
1,833 Views
Thank you so far. The problem ist, with MT runtime library I get problems with Qt and other packages. Is it possible to have MD runtime library and still link the libifcoremd.lib etc. statically (no dll loading at runtime)?
0 Kudos
Steven_L_Intel1
Employee
1,833 Views
No - the library type you specify has to match that of external libraries you are using. If there is a way around this, I'm unaware of it. With MD, you already have to have the MSVC DLLs available (and the specific ones you link against) - why not make the ifort DLLs available too?
0 Kudos
fabian
Beginner
1,833 Views
I want to deploy just an .exe file, with no installer, path setting and dll stuff.
Is there no linker switch in Visual Fortran to include the whole intel lib into the exe or into another lib?


0 Kudos
Steven_L_Intel1
Employee
1,833 Views
Into an EXE, yes, and this is a compiler switch. It's "/libs:static /threads" Into another .LIB, no, but you're not deploying a .LIB, are you?

This works fine until you link in some C/C++ code that was built to use the DLL libraries, or some library different than the one you specified. Then the headaches start. This is not a Fortran issue - the C++ compiler actually generates different code for using DLL vs. static libraries - Fortran doesn't.
0 Kudos
fabian
Beginner
1,833 Views
ok, thank you very much.
0 Kudos
Doug1
Beginner
1,833 Views
Into an EXE, yes, and this is a compiler switch. It's "/libs:static /threads" Into another .LIB, no, but you're not deploying a .LIB, are you?

This works fine until you link in some C/C++ code that was built to use the DLL libraries, or some library different than the one you specified. Then the headaches start. This is not a Fortran issue - the C++ compiler actually generates different code for using DLL vs. static libraries - Fortran doesn't.

Sorry to revive this thread but I am wanting to do exactly what you said that was a headache :). In my solution, I have the Fortran part as a static library, and then the main C++ code would use that library. How do I compile everything into a single exe file? I tried both "Multithreaded (/libs:static /threads)" and "Multithreaded DLL (/libs:dll /threads)" but those 2 dll files are still not built in.
0 Kudos
Steven_L_Intel1
Employee
1,833 Views
If you have indeed specified "Multithreaded (/libs:static /threads)" and rebuilt your Fortran project, then you are linking in some library that was compiled with different options. If you change the linker property Linker > General > Show Progress to "Show some progress messages" (this would be in the C++ project), the build log should show you when it comes across the reference to libifcoremd.lib and give you a clue as to which object is referencing this.
0 Kudos
Doug1
Beginner
1,833 Views
Would you suggest if I should include the whole lib folder for Visual Fortran in the Linker -> General -> Additional Library Directories or just include the necessary libs in Linker -> Input -> Additional Dependencies? The problem with the latter is that I would need to compile and see what is needed and include it and repeat... Would the compiler pick only the needed libs if I go with the former?

BTW, I tried making the solution fresh from start again to make sure there's no other settings and it looks like the "Multithreaded" switch works now.
0 Kudos
Steven_L_Intel1
Employee
1,832 Views
I generally recommend adding the library folder. See here.
0 Kudos
marshall-l-buhl
Beginner
1,832 Views

Steve,

First off, I'm happy to see you are still doing this after all these years.  You've been a great resource for me.

I'm using Visual Fortran Composer XE 2013 SP1 Update 2 and I want to make it the default that Fortran/Libraries/Runtime Library defaults to Multithreaded for Release mode instead of Multithreaded DLL.  I thought that adding /libs:static to Tools/Options/Intel Compose XE/Visual Fortran/Compilers/Default options would do the trick, but every new project defaults to Multithreaded DLL.

It is really important that I make it the default because I've wasted my time and others' time when I send them an exe that needs the library.  Did I miss an important step?

Marshall

0 Kudos
Steven_L_Intel1
Employee
1,832 Views

Marshall,

Thanks for the kind words.

What you did will cause any applications to be linked to the static libraries. It won't change the project settings, but the options you specify will override the project settings. You can verify this by looking at the build log. There isn't a way to change the project defaults so that you see it represented in the project properties. Please be aware that some libraries, such as OpenMP and coarray support, are provided in DLL form only.

0 Kudos
Reply