- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a source, exe program compiled by G95 used :
G95 *.f03 mainlib.a
where the mainlib.a is a compact index of a lot of subroutines and compiled as the following:
G95 -c *.f03 *.o
ar -r mainlib.a *.o
The mainlib.f03 shown as following:
MODULE main
!
INTERFACE
!
SUBROUTINE mesh(g_coord,g_num,ips)
!
! this subroutine draw the finite element mesh
!
IMPLICIT NONE
REAL,INTENT(IN)::g_coord(:,:)
INTEGER,INTENT(IN)::g_num(:,:),ips
END SUBROUTINE mesh
!
SUBROUTINE interp(k,dt,rt,rl,al,ntp)
.
.
.
END SUBROUTINE interp
!
END INTERFACE
!
END MODULE MAIN
I want know how to compile this exe in Intel Fortran. The mainlib.a is not a library and I do not know how to link it with other Fortran program.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When using
G95 -c mainlib.f03
I got two files: main.mod & mainlib.o
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Where is the source code for the main program? Without it, you cannot build an EXE. The archive mainlib.a IS a library. It contains the object files compiled from a number of source files, and is much more than "an index". The usual suffix for a library file in Windows is ".lib". The normal convention with Intel Fortran on Windows is to use ".f90" as the suffix for free-format Fortran source files, regardless of whether the language level is Fortran 90, 95, 2003 or (partly, to the extent implemented) 2008.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. Let me try to compile these f03(need changed into f90 as you mentioned) into a new library first. Hope it worked.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page