numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersBackRef
add_npy_pkg_config(self, template, install_dir, subst_dict=None)

The config file generated from :None:None:`template` is installed in the given install directory, using :None:None:`subst_dict` for variable substitution.

Notes

This works for both standard installs and in-place builds, i.e. the @prefix@ refer to the source directory for in-place builds.

Parameters

template : str

The path of the template, relatively to the current package path.

install_dir : str

Where to install the npy-pkg config file, relatively to the current package path.

subst_dict : dict, optional

If given, any string of the form @key@ will be replaced by subst_dict[key] in the template file when installed. The install prefix is always available through the variable @prefix@ , since the install prefix is not easy to get reliably from setup.py.

Generate and install a npy-pkg config file from a template.

See Also

add_installed_library
get_info

Examples

config.add_npy_pkg_config('foo.ini.in', 'lib', {'foo': bar})

[meta] Name=@foo@ Version=1.0 Description=dummy description

[default] Cflags=-I@prefix@/include Libs=

[meta] Name=bar Version=1.0 Description=dummy description

[default] Cflags=-Iprefix_dir/include Libs=

and will be installed as foo.ini in the 'lib' subpath.

When cross-compiling with numpy distutils, it might be necessary to use modified npy-pkg-config files. Using the default/generated files will link with the host libraries (i.e. libnpymath.a). For cross-compilation you of-course need to link with target libraries, while using the host Python installation.

You can copy out the numpy/core/lib/npy-pkg-config directory, add a pkgdir value to the .ini files and set NPY_PKG_CONFIG_PATH environment variable to point to the directory with the modified npy-pkg-config files.

[meta] Name=npymath Description=Portable, core math library implementing C99 standard Version=0.1

[variables] pkgname=numpy.core pkgdir=/build/arm-linux-gnueabi/sysroot/usr/lib/python3.7/site-packages/numpy/core prefix=${pkgdir} libdir=${prefix}/lib includedir=${prefix}/include

[default] Libs=-L${libdir} -lnpymath Cflags=-I${includedir} Requires=mlib

[msvc] Libs=/LIBPATH:${libdir} npymath.lib Cflags=/INCLUDE:${includedir} Requires=mlib

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.distutils.misc_util.get_info numpy.distutils.misc_util.get_pkg_info numpy.distutils.misc_util.Configuration.add_installed_library

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/distutils/misc_util.py#1652
type: <class 'function'>
Commit: