- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page