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

Can the VF Compiler for Windows use .A libraries

Eric_T_2
Beginner
558 Views

We're getting from somebody a Fortran static library in archive (.a) format, compiled on a Linux box with gfortran.  Is it possible to include this library in a build of a Fortran program using VFW?  

Second question.  If our supplier were to use an Intel fortran compiler on Linux, would it then be compatible?  What about gfortran under Windows?

Thanks for all info on this.

0 Kudos
3 Replies
Steven_L_Intel1
Employee
558 Views

No, no and no. Objects and libraries are OS/architecture specific. And in the Fortran world, objects compiled with one Fortran compiler are almost never mixable with objects from a different Fortran on the same platform.

0 Kudos
mecej4
Honored Contributor III
558 Views

The answers are 'no', 'no' and 'no', at least without substantial effort. Library files in Windows contains objects in COFF format, whereas on current versions of Linux objects are in ELF format. Register conventions are different, especially in 64-bit objects. Then, of course, there is the issue of issuing calls to different operating systems services.

There are utilities available that help with porting, but the effort required is substantial enough that the 'must do' reasons have to be strong enough. 

0 Kudos
TimP
Honored Contributor III
558 Views

As you mentioned gfortran for Windows, you might make a .a library out of gfortran Windows objects, but those would be built for one or another gfortran run-time library which is generally incompatible with ifort.  gcc and gfortran don't build against Microsoft Visual Studio run-time library. although some versions do use the basic msvcrt, but all Fortran compilers depend on their own specific run-times as well.

0 Kudos
Reply