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

How to deploy just an *.exe file, with no installer, path setting and dll stuff.

farukhsharipov
Beginner
1,126 Views
Can anyone help me with deploying my software just in *.exe file without installing any packages or dll's. Is there no linker switch in Visual Fortran to include the whole intel lib into the exe or into another lib? In Visual Studio IDE under Project -> Project_Name Properties->Command Line: I have /nologo /module:"Release\\\\" /object:"Release\\\\" /Fd"Release\\vc100.pdb" /libs:static /threads /c
But when I try to run the application on the pc which don't have Visual Fortran instaled it gives me error saying, thatlibifcoremd.lib is missing. can anyone help me to resolve this issue.
Any advise would be highly appriciated.
Thanks in advance.
0 Kudos
1 Solution
TimP
Honored Contributor III
1,126 Views
libiomp5 isn't covered by the general static option. The 11.x compilers have a separate option
/Qopenmp-link:static
whose effect is to link libiomp5mt.lib in place of libiomp5md.dll.

This option is labeled deprecated for the 12.0 compilers, so you would not expect to find a GUI check box for it. When the subject came up on this forum earlier this month, it was stated it should still work in command line options, as should putting libiomp5mt.lib explicitly in your library dependencies. One reason for the separate option is it is strongly advised not to link the static openmp library into a .dll (in case you were making one), only to link it into a final .exe.

View solution in original post

0 Kudos
10 Replies
Steven_L_Intel1
Employee
1,126 Views
The options you say are in effect would link in all libraries statically. I am a bit confused as to the error message because you might get an error about libifcoremd.dll (not .lib) - was that a typo?

Please attach the buildlog.htm from the build you used.
0 Kudos
farukhsharipov
Beginner
1,126 Views
Dear Steve
Thanks for you reply.
//--------------------------------------------------
I am not 100% sure right now if it's (*.dll) or (*.lib) since the pc which I tried is not with me right now. But this morning I tried to run the program on our office computers and it worked, even though I didn't changed any settings. But think it's becauseat one point all the office computers had Visual Studio installed. So my question is would this work on the pc's which never had Visual Studio installed ?
Here is the link toBuildLog.htm

Thanks in advance.

0 Kudos
TimP
Honored Contributor III
1,126 Views
dumpbin /dependencies *.exe will show you whether any Visual Studio or ifort dlls are required.
Your log said /libs:static was ignored, but it should be the default.
0 Kudos
farukhsharipov
Beginner
1,126 Views
dumpbin /dependencies *.exe gives me:
[fortran]Microsoft  COFF/PE Dumper Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

LINK : warning LNK4044: unrecognized option '/dependencies'; ignored

Dump of file PSI_Mesh_Generator.exe

File Type: EXECUTABLE IMAGE

  Summary

       11000 .data
       18000 .rdata
        9000 .reloc
        1000 .rsrc
       90000 .text
        1000 .text1
        1000 .trace[/fortran]
Yes I saw that /libs:static was ignored but I don't know why. Any suggestions ?
0 Kudos
TimP
Honored Contributor III
1,126 Views
oops, its spelled dependents on the command line, dependencies in the output
0 Kudos
farukhsharipov
Beginner
1,126 Views
Thanks for the advise. Now i get
[fortran]Microsoft  COFF/PE Dumper Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file PSI_Mesh_Generator.exe

File Type: EXECUTABLE IMAGE

  Image has the following dependencies:

    KERNEL32.dll
    imagehlp.dll

  Summary

       11000 .data
       18000 .rdata
        9000 .reloc
        1000 .rsrc
       90000 .text
        1000 .text1
        1000 .trace[/fortran]
So now my question would be how can I get rid of?
[fortran]KERNEL32.dll
imagehlp.dll[/fortran]
And why compiler ignores /libs:static ?
[bash]Linking...
LINK : warning LNK4044: unrecognized option '/libs:static'; ignored
LINK : warning LNK4044: unrecognized option '/threads'; ignored


PSI_Mesh_Generator - 0 error(s), 2 warning(s)[/bash]
0 Kudos
TimP
Honored Contributor III
1,126 Views
kernel32.dll and imagehlp.dll should always be present in minimum Windows installations. If they've been deleted or corrupted, a windows repair from a trusted DVD would replace them.
0 Kudos
Steven_L_Intel1
Employee
1,126 Views
The compiler is not ignoring the options - the linker is, because you specified them as link options. These should be compiler options.

Looking at the dependence output shows no dependence on Intel Fortran run-time DLLs. Are you sure you're running the same EXE?
0 Kudos
TimP
Honored Contributor III
1,127 Views
libiomp5 isn't covered by the general static option. The 11.x compilers have a separate option
/Qopenmp-link:static
whose effect is to link libiomp5mt.lib in place of libiomp5md.dll.

This option is labeled deprecated for the 12.0 compilers, so you would not expect to find a GUI check box for it. When the subject came up on this forum earlier this month, it was stated it should still work in command line options, as should putting libiomp5mt.lib explicitly in your library dependencies. One reason for the separate option is it is strongly advised not to link the static openmp library into a .dll (in case you were making one), only to link it into a final .exe.
0 Kudos
farukhsharipov
Beginner
1,126 Views
Dear TimP (Intel)
Thanks for your reply.
In Project Properties ->Fortran -> Command Line-> Additional Options: I added:/Qopenmp-link:static

Which simse to solve my problem thanks a lot again.
0 Kudos
Reply