This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: g77 building own library of subroutines
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: stephen dot buckley at excite dot com
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 04 Jul 2002 21:53:52 +0200
- Subject: Re: g77 building own library of subroutines
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <20020703195457.89335B6E5@xmxpita.excite.com>
stephen.buckley@excite.com wrote:
> this is my third attempt to get this to the help list. Message follows:
>
> I have a couple of fortran subroutines that I would like to put together in my own library [and then call them with other programs] and would like to know how to do this using g77--the manuals don't seem to say much on this--on building your own library of subroutines and functions etc.
Not surprisingly as this is mostly OS dependent.
On Unix it goes like this:
1. Make object files from your Fortran source code:
g77 [compiler flags] -o <source>.f
2. Make a library from all object files:
ar r <lib>.a *.o
3. [ Depending on the exact Unix OS you either do or do not do this step
]
Make an index for this library:
ranlib <lib>.a
Hope this helps,
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)