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

cannot link an old LIB to an IVF exe

Intel_C_Intel
Employee
485 Views
Hello,

We have an old 3rd party LIB file that has a useful matrix solver that was compiled with CVF. Now that we're moving projects to IVF we have encountered the incompatible library problem, which was stated in Steve Lionel's very useful white paper: "Porting Applications from Compaq Visual Fortran to Intel Visual Fortran Compilers".

Unfortunately we don't have the source code or inexpensive support for the 3rd party LIB file, so recompiling the LIB file is not an immediate option. Since Steve's white paper indicates that CVF DLLs can be called from IVF executables we're considering writing a DLL that would call the matrix solver routine in the old LIB. Perhaps this would separate the incompatible link libraries from IVF and CVF and allow continued use of the old LIB file in the updated IVF program.

Are there other approaches to use older LIB files with the new IVF compiler? Your advice is appreciated.

Thanks,
Greg
0 Kudos
2 Replies
Steven_L_Intel1
Employee
485 Views
If you can build a DLL from this LIB in CVF, and you don't need the two Fortrans to understand each other (I/O, allocated variables, etc.), then it should work. Make sure that the DLL is linked against the static libraries. Theoretically, all you should need is a .DEF file that names the entry points.
0 Kudos
Intel_C_Intel
Employee
485 Views
Hi Steve,
Thanks for your reply. The method of putting the old LIB in a DLL works great.

I have built a DLL using the old Compaq Fortran compiler that links to the old third party static LIB file. I have used an intermediate subroutine in the DLL for the executable to call, so that all the array data can be passed into the DLL before calling the matrix solver in the old static LIB. I was able to successfully link the executable to the import/export LIB from the DLL project. And using the DLLIMPORT/DLLEXPORT commands, all the routines are working together just fine. So far, testing shows the same computed results using the new setup. This seems like a useful method to isolate old LIB files in a DLL so that the Intel to Compaq link incompatabilities are avoided.

Thanks for your help.
Regards,
Greg
0 Kudos
Reply