bfort(1)
π β¨ bfort(1) β the Fortran-to-C interface short-def extractor β¨π
β¨ NAME β¨
okay so bfort is literally a program to extract short definitions for a Fortran to C interface. that's the whole vibe, bestie π«Άπ
π₯ INPUT π₯
like here's the group chat of inputs and flags, no cap:
filenamesβ Names the files from which lint definitions are to be extracted.-nomsgsβ Do not generate messages for routines that can not be converted to Fortran.-nofortβ Generate messages for all routines/macros without a Fortran counterpart.-dir nameβ Directory for output file.-I nameβ file that contains common includes.-mapptrβ translate pointers to integer indices.-ptrprefixβ prefix for names of functions to convert to/from pointers (default is__). The macro that selects the form based on the pointer size can be changed with-ptr64.-anynameβ Generate a single Fortran wrapper that works for almost all systems, by adding C preprocessor names (see below). These names can be changed with-fcaps,-fuscore, and-fduscore.-ferrβ Fortran versions return the value of the routine as the last argument (an integer). This is used in MPI and is a not uncommon approach for handling error returns.-shortargnameβ Use short (single character) argument names instead of the name in the C definition.-fstringβ Enable handling of Fortran character parameters, using the most common call interface. This is the default unless the environment variableBFORT_STRINGHANDLINGis set toIGNORE.-fnostringβ Disable handling of Fortran character parameters. Routines with char arguments in C will not have interface routines generated for them.-fstringβ (the second-fstringentry, yes really π)asisβ No special processing for string arguments. Provided for backward compatiblity to older versions of bfort that did not handle strings.-mpiβ Handle MPI types (some things are pointers by definition).-no_pmpiβ Do not generate PMPI names.-pmpi nameβ Change macro used to select MPI profiling version.-noprofileβ Turn off the generation of the profiling version.-mnativeβ Multiple indirects are native datatypes (no coercion).-voidisptrβ Consider"void *"as a pointer to a structure.-nodebugβ Do not add this lil block to the wrapper file:
#ifndef DEBUG_ALL
#define DEBUG_ALL
#endif
-anynameβ (second-anynameentry, iconic π ) Generate a single wrapper that can handle the three most common cases: trailing underscore, no underscore, and all caps. The choice is based on whether these are defined:
FORTRANCAPS: Names are uppercase, no trailing underscore
FORTRANUNDERSCORE: Names are lowercase, trailing underscore
are defined. And also:
FORTRANDOUBLEUNDERSCORE: Names are lowercase, with TWO trailing
underscores.
This is needed when some versions of "f2c" are used to generate C for Fortran routines. Note that f2c uses two underscores ONLY when the name already contains an underscore (at least on the FreeBSD system that I use that uses f2c). To handle this case, the generated code contains the second underscore only when the name already contains one.
If -mapptr is also chosen, then POINTER_64_BITS will also be used to determine if pointers are to long to fit in a 32-bit Fortran integer. Routines that destroy a pointer will need to manually insert a call to __RmPointer. The routines for managing the pointers are in ptrcvt.c.
In addition, if -mpi is used and -no_pmpi is not, the MPI profiling names are also generated, surrounded by MPI_BUILD_PROFILING.
π NOTE π
okay real talk: "We really need a way to specify a general type as a pointer, so that it will be handled as a pointer. The-mpioption is a kludge for a pressing need. Eventually should provide a"-ptr name"option and keep in a search space when looking for known types."
π AUTHOR π
Bill Gropp. that's the icon behind it ππ
π LOCATION π
bfort.c β that's where it lives, bestie π¦
okay bestie, that's the whole manual vibe π this page's footer is giving bfort(1) and 6/25/2019 β go interface your Fortran and C like the main character you are π
β¨πΈ
π¦ where this page comes from
- arch rolling: sowing 1.1.26.12-2 Β· GPL
- nixos 26.05: sowing 1.1.26.12
- nixpkgs unstable: sowing 1.1.26.12
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms