FORT77(1)
okay so this is fort77 from the Linux Programmer's Manual, section 1, and it's lowkey giving "compiler, but make it a transparent little shapeshifter" π
no cap, bestie, let's get into it.
π NAME π
fort77 β invoke the f2c Fortran translator transparently, like a compiler. β¨
π¦ SYNOPSIS π¦
fort77 [-c] [-g] [-v] [-k] [-P] [-cpp] [f2c option ...] [-L directory
...] [gcc-option ...] [link option ...] [-O optlevel] [-o outfile]
[-s] [-w] [-Wx,arg1[,arg2]...] file ...
πΈ DESCRIPTION πΈ
So the fort77 script invokes the f2c command transparently, which means you can literally just use it like a real Fortran compiler. iconic behaviour honestly π«Ά. You can use it to compile Fortran, C and assembler code, and to link all of that up with the f2c libraries.
Here's the vibe check on what happens to your files, based on their names:
- Files ending in
.fget compiled as Fortran source files. π - Files ending in
.Pare passed through tof2c. - Files ending in
.Fget sent to the C preprocessor first β and that preprocessor is invoked as/lib/cpp -traditional. - Any switches you pass via
-Dget handed straight to the preprocessor. - If the translation works out (slay π
), the resulting C files get passed to
ccso they can be turned into an object file. - Files ending in
.c,.C,.cc,.i,.s,.S,.m,.ccor.cxxgo directly to the GNU C compiler; peepgcc(1)for that. - Every other file gets passed to the linker.
yes, .cc really is in that list twice. it's in the original, we don't touch it, periodt. π
π OPTIONS π
-cβ Supress linking and produce an object (.o) file from each source file.-gβ Include debugging information.-vβ Be verbose; supplying this twice will also tell the C compilers etc to be verbose. (double the-v, double the yapping π₯)-kβ Keep the C files generated byf2caround. no deleting the receipts bestie.-cppβ Pass Fortran code through the C preprocessor, as if filenames ended in.F.-Pβ Generatef2c.Pfiles.-Ldirectoryβ Include directory in the search for libraries in the final linking stage.-o outfileβ Send output to outfile.-trapuvβ Havef2cgenerate code to trap uninitialized values. π-Wx,arg1[,arg2...]β Pass the argument[s] argi through to the subprocess x, where x can assume one of the following values:ffor thef2cstep,pfor the preprocessing step,cfor the C compiler,afor the assembler (this is actually passed to the C compiler, too), andlfor the linker. As an example, defining a preprocessor constant for the C compilation step would be done with-Wc,-DUNIX=1. Specifying the-foption tof2cwould be done via-Wf,-f.
β¨ f2c option β¨
fort77 passes through almost all f2c options: -C, -U, -u, -a, -E, -h, -P, -R, -r, -z, -I2, -I4, -onetrip, -!c, -!l, -!P, -!R, -ext, -!bs, -W[n], -trapuv, -w8, -r8 and -w66.
π§ gcc options π§
The following options are passed through to gcc: -f*, -W*, -U*, -A*, -m*, -S, -E, -v, -x, -pipe, -o, -I, -V, -b*, -p, -pg.
π linker option π
The options passed to the linking stage are -static, -shared, -v, -V, and -symbolic.
tiny heads up: the synopsis up top also shows-O optlevel,-sand-w. iykyk π«Ά
π BUGS π
- To make debugging work, you need to set a breakpoint at
MAIN__before you start. do not skip this step, it's giving "why is nothing working" otherwise. f2cβ This script automatically supplies the-I.option tof2c. Older versions off2cmay not support this.- This script is for the interaction of
gccandf2c; using it with another compiler will probably require modification. - The
fort77script does not strictly conform to Posix.2, because it accepts long options with one leading slash. This is done forgcccompatibility.
π¦ SEE ALSO π¦
π AUTHOR π
Thomas Koenig, ig25@rz.uni-karlsruhe.de
and that's the whole page, bestie π this one comes from the Linux Programmer's Manual, dated Nov 1996, and it lives in section 1 as FORT77(1). go forth and translate some Fortran, you absolute icon ππ
π¦ where this page comes from
- debian bookworm: fort77 1.15-12
- debian trixie: fort77 1.15-13
- ubuntu jammy: fort77 1.15-11.1
- ubuntu noble: fort77 1.15-12
- ubuntu questing: fort77 1.15-13
- ubuntu resolute: fort77 1.15-13build1
- ubuntu stonking: fort77 1.15-13build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms