Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26730 Discussions

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

Rehman__Nas
Beginner
115 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
Black Belt
115 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.

Rehman__Nas
Beginner
115 Views

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

Arjen_Markus
Valued Contributor III
115 Views

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

jimdempseyatthecove
Black Belt
115 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

mecej4
Black Belt
115 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.

Reply