Linking several object files
Roberto Bellasio
rbellasio@enviroware.com
Wed Jul 5 08:00:00 GMT 2006
Hi,
I hope this is the correct place to post my question, otherwise I
apologise.
I'm trying to compile an atmospheric dispersion model written
mainly in Fortran and with a single file containing some C
routines. There are a total of about 360 files. My previous
attempts with Lahey Fortran90 are failed due to the presence of
the C routines and to the fact that Lahey F90 seems to be
compatible only with MS Visual C and to an old version of Borland
C (and maybe to my bad knowledge of C).
Yesterday I discovered gfortran, I tried to compile a
simple Fortran main with a C routine and the attempt went well.
The 360 files are placed in 12 different directories, a makefile
would be very useful but, if I understood well, it is not yet
available. Therefore, using DOS batch files and Perl, cycling in
all the directories, I have produced all the object files of the
Fortran and C routines, and now I need to link them. This is
where I have the problem, since if I use
gfortran -o myprog.exe f1.o f2.o ... fN.0
(where fi.o are the object files with their path) the list of
object file is too long and I get an error (from DOS, not from
gfortran). Is there any way to create something similar to a
response file and to refer to it during linking? Do you have any
suggestion to solve my (probably trivial) problem?
Thank you in advance.
Best regards
Roberto
More information about the Fortran
mailing list