- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi: We deliver our product as a static library. It's mostly written in FORTRAN with a thin C++ wrapper. It performs a complicated operation (basically solving a large system of equations) and consists of a several dozen source files. The interface visable to the end-user is essentially one function call. Some common functions appear in separate modules in separate source files and we would like to have the compiler inline them if it's appropriate. Is it possible to build our library as a plain static library which has all the suitable FORTRAN functions inlined? The result must be a plain static library which can be linked into a program.
Thanks,
Allen
Thanks,
Allen
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, it can't do that. The actual optimization of an IPO build happens during the link step with the Intel compiler driver (or xilink) used to start the link. You could build a DLL this way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve: Thanks. That's what I figured.
Can you give me the correct arguments to the linker to produce a DLL with IPO? Is there anything special about using FORTRAN to build a DLL? Like $DEC directives for the exported symbols or special treatment of common blocks or similar? (I admit I'm lost in windows development subtleties.)
Thanks,
Allen
Can you give me the correct arguments to the linker to produce a DLL with IPO? Is there anything special about using FORTRAN to build a DLL? Like $DEC directives for the exported symbols or special treatment of common blocks or similar? (I admit I'm lost in windows development subtleties.)
Thanks,
Allen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In each routine you want exported, add:
!DEC$ ATTRIBUTES DLLEXPORT :: routinename
You could, as an alternative, create a .def file with the appropriate lines in it to name the routines you want exported. This is described in the documentation. The .def file is then included in the ifort command you use to link.
To link, use ifort /dll
!DEC$ ATTRIBUTES DLLEXPORT :: routinename
You could, as an alternative, create a .def file with the appropriate lines in it to name the routines you want exported. This is described in the documentation. The .def file is then included in the ifort command you use to link.
To link, use ifort /dll
you may want to add /libs:static to make sure there are no dependencies on other libraries.
The link will produce a .dll and a .lib. The end user links against the .lib, and the .dll has to be in PATH somewhere.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the help!
(I should take typing lessons.)
(I should take typing lessons.)

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page