You are viewing an older version (2.4.3). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.4.3 / numpy / f2py / get_include

function

numpy.f2py:get_include

source: /numpy/f2py/__init__.py :25

Signature

def   get_include ( )

Summary

Return the directory that contains the fortranobject.c and .h files.

Extended Summary

Python extension modules built with f2py-generated code need to use fortranobject.c as a source file, and include the fortranobject.h header. This function can be used to obtain the directory containing both of these files.

Returns

include_path : str

Absolute path to the directory containing fortranobject.c and fortranobject.h.

Notes

Unless the build system you are using has specific support for f2py, building a Python extension using a .pyf signature file is a two-step process. For a module mymod:

  • Step 1: run python -m numpy.f2py mymod.pyf --quiet. This generates mymodmodule.c and (if needed) mymod-f2pywrappers.f files next to mymod.pyf.

  • Step 2: build your Python extension module. This requires the following source files:

    • mymodmodule.c

    • mymod-f2pywrappers.f (if it was generated in Step 1)

    • fortranobject.c

See also

numpy.get_include

function that returns the numpy include directory

Aliases

  • numpy.f2py.get_include