Compiling file with subroutines using gfortran
Patrick Begou
Patrick.Begou@univ-grenoble-alpes.fr
Sun Jan 1 16:21:37 GMT 2023
You're right Jonathan, sorry forthe mistake.
Please read:
gfortran -O3 -ffree-form -c myfile.f
and
gfortran -O3 -ffree-form -c myfile.f -o myfile.o
Patrick
Le 01/01/2023 à 14:32, Jonathan Wakely a écrit :
>
>
> On Sun, 1 Jan 2023, 12:01 Patrick Begou via Gcc-help,
> <gcc-help@gcc.gnu.org> wrote:
>
> You are using a wrong option that may overwrite your fortran
> source file
> with the result of the compilation..
> To create only the .o file use:
>
> gfortran -O3 -ffree-form*-c* myfile.f
>
> or, f you want:
>
> gfortran -O3 -ffree-form*-c* myfile.f*-o myfile.o*
>
>
>
> This markup doesn't really help in plain text rendering.
>
>
>
>
> it will do the same thing.
>
> Patrick
>
> Le 01/01/2023 à 09:52, Hans Lonsdale via Gcc-help a écrit :
> >
> > I want to compile a file containing a number of subroutines.
> >
> > I am using the command
> >
> > gfortran -O3 -ffree-form -o myfile.f
> >
> > But getting problems with recursive and END PROGRAM statement.
> >
> > All I want is making the object file.
> >
> > 44 | recursive subroutine quicksort (array)
> > | 1
> > Error: Unclassifiable statement at (1)
> > myfile.f:112:3:
> >
> > 112 | end subroutine quicksort
> > | 1
> > Error: Expecting END PROGRAM statement at (1)
> > myfile.f:122:35:
> >
> > Have done
> >
> > gfortran -O3 -ffree-form -o myfile.f
> >
> > The command is supposed to make the object file, but I get
> errors with END PROGRAM declaration.
> >
> >
>
More information about the Gcc-help
mailing list