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

Compiled .EXE will not run on target machine

Dave_A__from_Lifeboa
681 Views
Customer writes:

I am compiling Fortran program using Intel ComposerXE-2011 compiler with Microsoft Visual Studio.

I am on a Windows 7 Dell machine.

I would like to compile an Fortran executable (.exe or dll) for my colleague to use on another PC machine which doesnt have intel compiler installed.

I heard that in order to make that work I need to turn on some static link sort of flag during compiling, do you know where I can find that option?

Thanks....Dave A. from Lifeboat Distribution
0 Kudos
4 Replies
Steven_L_Intel1
Employee
681 Views
Dave,

The default when building an EXE is to link to the static libraries, so nothing else is needed. (An exception is if the program is built with the /Qopenmp option to use OpenMP features.)

The default when building a DLL is to link to the DLL librariies, which does create a dependence on the Intel (and Microsoft) run-time DLLs. This can be changed with the project property Fortran > Libraries. Change "Runtime Library" to "Multithreaded (/MT)". In addition, be sure to build a "Release" configuration when you're going to use the EXE or DLL on another system. Note that changing the runtime library type is per-configuration, so select a Release configuration and then make the change.
0 Kudos
Dave_A__from_Lifeboa
681 Views
Hi Steve,
thanks for that answer, the customer immediately asked:

I was wondering for build a Dll, shall I chose Multithread DLL (/libs:dll/threads) or Multithread?

thanks....Dave A. from Lifeboat Distribution.

0 Kudos
Steven_L_Intel1
Employee
681 Views
You should choose Multithread DLL if your DLL is going to be called by Fortran code - and the executable should also be compiled this way (which is not the default for executables). If you know that the DLL's caller will never be Fortran, it is safe to use Multithread (static library).

For more information, please read http://software.intel.com/en-us/articles/redistribution-of-application-binaries-built-for-microsoft-windows/ (I see this needs to be updated...)
0 Kudos
Dave_A__from_Lifeboa
681 Views
thanks Steve..I'll relay.......daveA. from lifeboat.
0 Kudos
Reply