diff options
Diffstat (limited to 'doc/source/reference/distutils.rst')
-rw-r--r-- | doc/source/reference/distutils.rst | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/doc/source/reference/distutils.rst b/doc/source/reference/distutils.rst index bb01a529a..63174c2c7 100644 --- a/doc/source/reference/distutils.rst +++ b/doc/source/reference/distutils.rst @@ -6,7 +6,7 @@ Packaging (:mod:`numpy.distutils`) NumPy provides enhanced distutils functionality to make it easier to build and install sub-packages, auto-generate code, and extension -modules that use Fortran-compiled libraries. To use features of numpy +modules that use Fortran-compiled libraries. To use features of NumPy distutils, use the :func:`setup <core.setup>` command from :mod:`numpy.distutils.core`. A useful :class:`Configuration <misc_util.Configuration>` class is also provided in @@ -33,7 +33,6 @@ misc_util Configuration get_numpy_include_dirs - get_numarray_include_dirs dict_append appendpath allpath @@ -128,13 +127,13 @@ Other modules Building Installable C libraries ================================ -Conventional C libraries (installed through add_library) are not installed, and +Conventional C libraries (installed through `add_library`) are not installed, and are just used during the build (they are statically linked). An installable C library is a pure C library, which does not depend on the python C runtime, and -is installed such as it may be used by third-party packages. To build and -install the C library, you just use the method add_installed_library instead of -add_library, which takes the same arguments except for an additional -install_dir argument:: +is installed such that it may be used by third-party packages. To build and +install the C library, you just use the method `add_installed_library` instead of +`add_library`, which takes the same arguments except for an additional +``install_dir`` argument:: >>> config.add_installed_library('foo', sources=['foo.c'], install_dir='lib') @@ -142,8 +141,8 @@ npy-pkg-config files -------------------- To make the necessary build options available to third parties, you could use -the npy-pkg-config mechanism implemented in numpy.distutils. This mechanism is -based on an .ini file which contains all the options. A .ini file is very +the `npy-pkg-config` mechanism implemented in `numpy.distutils`. This mechanism is +based on a .ini file which contains all the options. A .ini file is very similar to .pc files as used by the pkg-config unix utility:: [meta] @@ -162,7 +161,7 @@ similar to .pc files as used by the pkg-config unix utility:: Generally, the file needs to be generated during the build, since it needs some information known at build time only (e.g. prefix). This is mostly automatic if -one uses the Configuration method add_npy_pkg_config. Assuming we have a +one uses the `Configuration` method `add_npy_pkg_config`. Assuming we have a template file foo.ini.in as follows:: [meta] @@ -186,22 +185,23 @@ and the following code in setup.py:: >>> config.add_npy_pkg_config('foo.ini.in', 'lib', subst_dict=subst) This will install the file foo.ini into the directory package_dir/lib, and the -foo.ini file will be generated from foo.ini.in, where each @version@ will be -replaced by subst_dict['version']. The dictionary has an additional prefix +foo.ini file will be generated from foo.ini.in, where each ``@version@`` will be +replaced by ``subst_dict['version']``. The dictionary has an additional prefix substitution rule automatically added, which contains the install prefix (since this is not easy to get from setup.py). npy-pkg-config files can also be installed at the same location as used for numpy, using the path returned from -get_npy_pkg_dir function. +`get_npy_pkg_dir` function. Reusing a C library from another package ---------------------------------------- -Info are easily retrieved from the get_info function in numpy.distutils.misc_util:: +Info are easily retrieved from the `get_info` function in +`numpy.distutils.misc_util`:: >>> info = get_info('npymath') >>> config.add_extension('foo', sources=['foo.c'], extra_info=**info) -An additional list of paths to look for .ini files can be given to get_info. +An additional list of paths to look for .ini files can be given to `get_info`. Conversion of ``.src`` files ============================ |