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

Cannot compile a fortran file that is dependent on precompile object files

Rehman__Nas
Beginner
677 Views

Hello All,

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.

 

Thanks.

0 Kudos
5 Replies
mecej4
Honored Contributor III
677 Views

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.

0 Kudos
Rehman__Nas
Beginner
677 Views

I forgot to mention that these object files are c subroutines and were compiled using the pgi compiler to work with Fortran subroutines.

0 Kudos
Arjen_Markus
Honored Contributor I
677 Views

That makes very little difference: the C compiler will have to be compatible with the Fortran compiler for this to work.

0 Kudos
jimdempseyatthecove
Honored Contributor III
677 Views

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.

Jim Dempsey

0 Kudos
mecej4
Honored Contributor III
677 Views

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.

0 Kudos
Reply