Friday, 19 June 2009

Compiling modules separately

When I have a module declared in mymodule.f90, I can compile it like so:
gfortran -m32 -c mymodule.f90
... I can also compile the main file this way:
gfortran -m32 -c mainfile.f90
Finally I must link it, possibly also with the NAG library:
gfortran -m32 mymodule.o mainfile.o /opt/NAG/fll3a21dfl/lib/libnag_nag.a -o mainfile

No comments: