Command Line Tool

F2x - A versatile Fortran wrapper

usage: F2x [-h] [-c CONFIG] [-G GRAMMAR] [-C CONFIG_SUFFIX] [-P] [-F]
           [-e ENCODING] [-i TREE_CLASS] [-W STRATEGY] [-m MODULE_NAME]
           [-n LIBRARY_NAME] [-s] [-S NAME CLASS TEMPLATES] [-R PACKAGE]
           [-t NAME] [-T PATH] [-x EXTENSION] [-l LOGFILE] [-v] [-q] [-f]
           [--get {depends,modules,libraries,extlib}] [-d]
           [--py-absolute-import]
           [SOURCE [SOURCE ...]]

Named Arguments

-c, --config

Load configuration file.

Fortran parser

-G, --grammar

Use specified grammar. Bundled grammars should be prefixed by @. (Default: “@fortran.g”)

Default: “@fortran.g”

-C, --config-suffix

Suffix for per-source configuration file. (Default: “-wrap”)

Default: “-wrap”

-P, --output-pre

Write pre-processed source.

Default: False

-F, --configure

Create/update configuration file.

Default: False

-e, --encoding

Use the specified encoding for reading/writing source files.

Default: “utf8”

-i, --tree-class

Tree class to use for parsing (module.name:ClassName).

Automatic wrapping

-W, --wrap

Wrap sources by applying the given STRATEGY.

-m, --module-name

Full name of the module to generate.

Default: “ext.*”

-n, --library-name

Set the library name.

-s, --autosplit

Automatically create an own extension for each source file.

Default: False

-S, --add-strategy

Load a strategy for later use. NAME should be the name for the strategy and CLASS should be the fully qualified class name of a build strategy. TEMPLATES is a comma separated list of templates to use.

Code generation

-R, --register-template

Load a template pacakge into the regitry for later use. PACAKGE should be the fully qualified name of a F2x template package.

-t, --template

Generate wrapping for the given template. NAME should be the name of a F2x template package, the path to a template that can be found in the template path or a bundled template that should be prefixed by @.

Default: []

-T, --template-path

Add PATH to the template search path.

Default: []

-x, --jinja-ext

Add EXTENSION to Jinja2 environment.

Default: [‘jinja2.ext.do’]

Logging

-l, --logfile

Write detailed log to LOGFILE.

-v, --verbose

Increase verbosity.

Default: 0

-q, --quiet

Decrease verbosity.

Default: 2

Action

-f, --force

Force rebuild of wrapper.

Default: False

--get

Possible choices: depends, modules, libraries, extlib

Collect template information about dependencies, modules, libraries, or the name of the extension library.

SOURCE

Wrap the given templates to the SOURCE files.

Deprecated

-d, --copy-glue

Copy ‘glue.py’ (used by ctypes template) into destination folder.

Default: False

--py-absolute-import

Use absolute import for Python helper modules (e.g. F2x.template.ctypes.glue).

Default: False