I am trying to compile a file in the Intel Fortran Windows compiler. This file calls multiple subroutines which exist as pre-compiled object files and previously they were linked as a library file using the following command:
pgf90 t22load -L /share/lib $2 $3 -lenglib -o$1
I cannot figure out how can I link the object files or the library in my new project. I have added the picture for more clarity.
Object files generated by different compilers are, in general, not interchangeable unless you have documentation that describes how to achieve interchangeability and your object files were generated by following that procedure.
If the object files were generated by a PGI compiler, they will probably depend on routines from the PGI Fortran runtime library, and these routines may not be callable from object files produced by the Intel Fortran compiler.
Try to obtain the source codes from which those PGI object files were generated.
You apparently are using a make file. I suggest you create a static library (xxx.lib) of those files, then add the xxx.lib file as a dependency to your FortranProgram.exe file. In this manner should the xxx.lib change, it will just link the FortranPprogram.exe file.
If you are using Microsoft Visual Studio, then you can add your xxx.lib as a dependency in your Project file.
Rehman, Nas wrote:
I forgot to mention that these object files are c subroutines and were compiled using the pgi compiler to work with Fortran subroutines.
Object files compiled on Linux are not compatible with the Windows linker. The PGI C compiler is not a "companion processor" for Intel Fortran on Windows. You will have to recompile the C sources using VC or Intel C.