Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

gcc: error: fort77: No such file or directory

136 views
Skip to first unread message

Anouar BOUANO

unread,
Sep 14, 2022, 8:14:41 AM9/14/22
to
I want to compile a fortran77 code and after using the commange :
fort77 lscodaq-sn butfilter.f four1.f /home/dell/Documents/SAC/lib/libsacio.a fort77 lscodaq-sn butfilter.f four1.f /home/dell/Documents/SAC/lib/libsac.a gcc -o mlmcodaq-sn.f -o mlmcodaq-sn.f
I got the message : gcc: error: fort77: No such file or directory

Do you know any idea please how to solve this problem?



Thomas Koenig

unread,
Sep 14, 2022, 10:14:05 AM9/14/22
to
Anouar BOUANO <aboula...@gmail.com> schrieb:
What you have posted is a single command line, but that looks messed up;
you are passing fort77 as an input file to the "fort77" command, which is
probably not what is intended (and which is what the compiler is
complaining about).

What is that fort77 command, is it a local script, or an alias, or... ?

It is best to read an introduction to your compiler to see how
executables are generated. At a guess, you probably want to set
the name of the output file with -o and add all the files that
should be compiled or linked in. So, if you wanted to compile
an output file named hello_goodbye from the source files
hello.f and goodbye.f, it could look something like (using
gfortran here)

gfortran -o hello_goodbye hello.f goodbye.f

Hope this helps.

gah4

unread,
Sep 14, 2022, 10:57:08 AM9/14/22
to
On Wednesday, September 14, 2022 at 5:14:41 AM UTC-7, Anouar BOUANO wrote:
> I want to compile a fortran77 code and after using the commange :

> fort77 lscodaq-sn butfilter.f four1.f /home/dell/Documents/SAC/lib/libsacio.a fort77 lscodaq-sn butfilter.f four1.f /home/dell/Documents/SAC/lib/libsac.a gcc -o mlmcodaq-sn.f -o mlmcodaq-sn.f
> I got the message : gcc: error: fort77: No such file or directory

It looks like what should have been three lines, three commands, was combined into one.


fort77 lscodaq-sn butfilter.f four1.f /home/dell/Documents/SAC/lib/libsacio.a
fort77 lscodaq-sn butfilter.f four1.f /home/dell/Documents/SAC/lib/libsac.a
gcc -o mlmcodaq-sn.f -o mlmcodaq-sn.f

That still leaves a few questions:

Is lscodeqan-sn options for the f77 command?

The gcc command doesn't make sense at all, with two -o options ...

The fort77 lines seem to compile the same Fortran programs with different libraries,
but don't specify an output file.
The default is a.out, which will be overwritten by the second one.

Most often, I recommend gfortran, even for older programs. As well as I know,
it does everything that fort77 does.

Last year, I was compiling Fortran programs written for the IBM 1130
with gfortran. Most things work just fine, even old depracated
features. The one problem I remember, is that IBM allows for
apostrophed character data in DATA statements, instead of the
more usual (for the time), Hollerith constants. gfortran only allows the latter.

You will need to recompile and generate new .a files, though,
to use any other compiler.


Anouar BOUANO

unread,
Sep 15, 2022, 6:02:50 AM9/15/22
to
thank you so much for your quick replay,
In this commande, you can find two fortran77 source files:
mlmcodaq-sn.f
lscodaq-sn.f

and two C-Shell files.

batch-mlmcodaq-sn.csh

batch-lscodaq-sn.csh
Because the fiels are written with fortran77, could you please tell me how I should compile these files

Arjen Markus

unread,
Sep 15, 2022, 6:26:53 AM9/15/22
to

Arjen Markus

unread,
Sep 15, 2022, 6:30:35 AM9/15/22
to
On Thursday, September 15, 2022 at 12:02:50 PM UTC+2, Anouar BOUANO wrote:
There is nothing particularly special about FORTRAN 77: gfortran and a variety of other Fortran compilers can handle such source files as Fortran in its modern versions (90, 95, 2003, 2008, 2018, ...) are all backward compatible. There may be small issues, but those relate to very obscure features of older versions and unusual extensions. So probably, if you replace "fort77" by "gfortran" in the command you showed, it will simply work.

Regards,

Arjen

gah4

unread,
Sep 15, 2022, 7:49:45 AM9/15/22
to
On Thursday, September 15, 2022 at 3:30:35 AM UTC-7, arjen.m...@gmail.com wrote:

(snip)

> There is nothing particularly special about FORTRAN 77: gfortran and a
> variety of other Fortran compilers can handle such source files as
> Fortran in its modern versions (90, 95, 2003, 2008, 2018, ...)
> are all backward compatible. There may be small issues, but those
> relate to very obscure features of older versions and unusual extensions.
> So probably, if you replace "fort77" by "gfortran" in the command
> you showed, it will simply work.

Except that there are also some .a files, which are likely compiler specific.

If there is a Makefile, it will tell how to generate them, possible from C
or Fortran source.

It would be useful to see what the .csh files say, too.


0 new messages