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

file locations

Brian_Allison
Beginner
1,259 Views
When I compile my program, I am creating a dll with it. when the dll is created there are 4 files that are created with it. A .lib, .exp, .obj, and a .manifest. Is there a way to specify where these files are placed when they are created. I do not want them in the base directory.
0 Kudos
1 Solution
Steven_L_Intel1
Employee
1,259 Views
I'm not surprised. If you read what you have posted carefully, you won't be either.

View solution in original post

0 Kudos
10 Replies
TimP
Honored Contributor III
1,259 Views
/exe: and /object: options may be used for the .lib .exe and .obj files. For the manifest, you should be able to append /link /MANIFESTFILE:filename or use VS linker properties.
0 Kudos
Brian_Allison
Beginner
1,259 Views
I want to specify where the .exp and .lib files are placed, that are generated to create the dll. Also, with the latest version of the Fortran compiler, we are getting this manifest file. Where and why does it come from?
0 Kudos
Steven_L_Intel1
Employee
1,259 Views
The manifest file is created by the linker, as of VS2005. It is used by the Manifest Tool (mt.exe) to embed the manifest in the DLL - this is done as part of the normal build from Visual Studio. Manifests are used by Windows to locate dependent DLLs and can be used in conjunction with "shared assemblies" to install dependent DLLs in such a way that they are not dependent on PATH, etc., and avoid version conflicts. Normally, this is handled for you automatically and you don't need to refer to the manifest file again.
0 Kudos
Brian_Allison
Beginner
1,259 Views
Ok, I understand that, but what about the .exp and .lib file that is created when creating the dll. Can I tell the maker where to place them.
0 Kudos
Steven_L_Intel1
Employee
1,259 Views
You can specify the .lib location under Linker > Advanced > Import Library. You could probably redirect the default by changing the value of Configuration Properties > General > Output Directory and then set the linker output to be where you want the DLL to be written.
0 Kudos
Brian_Allison
Beginner
1,259 Views
I am compiling from an INTEL command prompt. Do you know what the commands would be?
Also, I am noticing that my program does does work now with the latest version IFC. If I tell it to ignore the dll, then it runs.
When I try to run it with the dll, I am getting a window with an error.
THe application was unable to start correctly (0x80000003). Click OK to close the application.
THe program with the DLL works fine when compiles with CFC.
Also why is it that the CFC deletes the obj file for my dll when it is done and IFC does not.
I also just noticed that my CFC places the .lib and .exp where ever I tell it to put the dll, but the IFC does not.
0 Kudos
Steven_L_Intel1
Employee
1,259 Views
If you build from the command line, you have to run the Manifest Tool to embed the manifest the way that Visual Studio does. This is required starting with VS2005.

To do this, add this after your link command:

mt /manifest $(name).dll.manifest /outputresource:$(name).dll;2

where $(name) is the name of your DLL.

It's the Microsoft linker that creates the .lib and .exp files. Any difference is due to different Visual Studio versions, though I have not seen this as a difference myself.

The linker option for the manifest file is /MANIFESTFILE. The one for the export library is /IMPLIB.
0 Kudos
Brian_Allison
Beginner
1,259 Views
So I added the line that you mentioned.
$(f90) -nologo $(FFLAGS) $(FPSTOP) $(FL) -dll -Id \
relap\relap5l.for relap\ufilef.$O envrl\fabend.$O \
-link -out:relap5.dll
mt -manifest relap5l.dll.manifest \
-outputresource:relap5l.dll;2
$(f90) -nologo $(FFLAGS) $(FPSTOP) $(FL) -dll -Id \ relap\relap5l.for relap\ufilef.$O envrl\fabend.$O \ -link -out:relap5.dll mt -manifest relap5l.dll.manifest \ -outputresource:relap5l.dll;2
I am getting an error.
mt.exe : general error c10100b1: Failed to load file "relap5l.dll". The system cannot find the file specified.
0 Kudos
Steven_L_Intel1
Employee
1,260 Views
I'm not surprised. If you read what you have posted carefully, you won't be either.
0 Kudos
Brian_Allison
Beginner
1,259 Views
oops! The coding got pasted twice. Here is what I have.

$(f90) -nologo $(FFLAGS) $(FPSTOP) $(FL) -dll -Id \
relap\relap5l.for relap\ufilef.$O envrl\fabend.$O \
-link -out:relap5l.dll
mt -manifest relap5l.dll.manifest \
-outputresource:relap5l.dll;2
The F90 = ifort
Yay! I figured it out after reposting the coding. Thank you for your help!
0 Kudos
Reply