how to compile a program

erik.edelmann@iki.fi erik.edelmann@iki.fi
Sat Mar 10 01:58:00 GMT 2007


On Fri, Mar 09, 2007 at 09:51:11PM +0100, Tobias Burnus wrote:
> Tobias Burnus wrote:
> > Hi,
> >
> > Eswari Natrajan wrote:
> >   
> >> I want to know what extension is use to save
> >> gfortran whether .f90 or .f and also how to compile
> >> program which is saved as filename.f?
> >>     
> I missed the second part of the question.
> 
> To compile the source file "test.f90", you call
> 
>    gfortran -o test  test.f90
> 
> which produces the executable "test".

And if you are running something Unix-like (e.g. Linux) when you give your
executable the name "test", remember to execute it as 

        ./test

rather than

        test

(assuming you have the executable in you current directory).

The result might suprise you otherwise (yes, I have made that mistake
several times :-)


        Erik



More information about the Fortran mailing list