From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wilbur.contactoffice.com (wilbur.contactoffice.com [212.3.242.68]) by sourceware.org (Postfix) with ESMTPS id A70323858C50 for ; Sun, 1 Jan 2023 15:33:51 +0000 (GMT) Received: from hologram (hologram.co-bxl [10.2.0.17]) by wilbur.contactoffice.com (Postfix) with ESMTP id C8D2A1A99; Sun, 1 Jan 2023 16:33:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1672587230; s=20210208-e7xh; d=mailfence.com; i=hanslonsdale@mailfence.com; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type; l=7097; bh=a9rcPi79jATnWVdFVOTSyg4Bv3vyuxKRMIQfbOEz3GE=; b=wq1R/jLgmgfO8s6vTw6McMqZhMtOeXbUgy5wa7CiCZuy2rK/8JonVtJq6mU1Czo0 x7aKGtC6gepkq1pQbWgCK4FeNk6Uzifq4FJTs4dVsnS5BgPPEZlAaZpW7LZWAM4WRhC /G49vk645/ov49xxIQgqgSGUhOj00wSJHQY3LGuXfwMeDBpoHHC+YMTjfcu8A/wBcZA MXMKBZIfvMNe8MGchJHsZ+Pc+M28dbqnKA67l4h7KPHr3PJ0PUfu6WQLpsKtoek2J89 hX4egSttv09XCIMA2RxrHikdOQ56kqNjDhsqloMOOVhr1XAfBpyGtTB/+TFZWu/0nEN Ro46QaY0GA== Date: Sun, 1 Jan 2023 15:41:03 +0100 (CET) From: Hans Lonsdale To: Jonathan Wakely , Patrick Begou Cc: gcc-help Message-ID: <169342516.761954.1672584062991@ichabod.co-bxl> In-Reply-To: References: <166133795.746116.1672563145928@ichabod.co-bxl> <386d6312-6919-af36-5efa-e5ce3a8c886b@univ-grenoble-alpes.fr> Subject: Re: Compiling file with subroutines using gfortran MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_761951_986165455.1672584062990" X-Mailer: ContactOffice Mail X-ContactOffice-Account: com:377787701 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: ------=_Part_761951_986165455.1672584062990 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline January 1, 2023 at 2:32:49 PM CET Jonathan Wakely w= rote: On Sun, 1 Jan 2023, 12:01 Patrick Begou via Gcc-help, wrote: You are using a wrong option that may overwrite your fortran source file=20 with the result of the compilation.. To create only the .o file use: gfortran -O3 -ffree-form*-c*=C2=A0 myfile.f or, f you want: gfortran -O3 -ffree-form*-c*=C2=A0 myfile.f*-o myfile.o* This markup doesn't really help in plain text rendering. The file is not complicated, I just have defined an array and a recursive s= ubroutine. implicit none integer, parameter :: prec=3Dkind(1d0), i64=3Dselected_int_kind(15) integer, parameter :: L(0:43) =3D (/=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 & =C2=A01, 1, 3, 5, 9, 15, 25, 41, 67, 109,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= & =C2=A0177, 287, 465, 753, 1219, 1973, 3193, 5167, 8361,=C2=A0=C2=A0=C2=A0= =C2=A0 & =C2=A013529, 21891, 35421, 57313, 92735, 150049,=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 & =C2=A0242785, 392835, 635621, 1028457, 1664079, 2692537,=C2=A0=C2=A0=C2=A0 & =C2=A04356617, 7049155, 11405773, 18454929, 29860703,=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 & =C2=A048315633, 78176337, 126491971, 204668309, 331160281,=C2=A0 & =C2=A0535828591, 866988873, 1402817465 /) recursive subroutine quicksort (array) =C2=A0real(prec), intent(inout) :: array(:) =C2=A0real(prec) :: temp, pivot =C2=A0integer :: i, j, last, left, right =C2=A0last =3D size (array) end subroutine quicksort =C2=A0 it will do the same thing. Patrick Le 01/01/2023 =C3=A0 09:52, Hans Lonsdale via Gcc-help a =C3=A9crit=C2=A0: > > 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) >=C2=A0 =C2=A0 =C2=A0 =C2=A0 | 1 > Error: Unclassifiable statement at (1) > myfile.f:112:3: > >=C2=A0 =C2=A0 112 | end subroutine quicksort >=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A01 > 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 EN= D PROGRAM declaration. > > -- Sent with https://mailfence.com Secure and private email= ------=_Part_761951_986165455.1672584062990--