module documentation

This file defines a set of system_info classes for getting information about various resources (libraries, library directories, include directories, etc.) in the system. Usage:

info_dict = get_info(<name>)

where <name> is a string 'atlas','x11','fftw','lapack','blas', 'lapack_src', 'blas_src', etc. For a complete list of allowed names, see the definition of get_info() function below.

Returned info_dict is a dictionary which is compatible with distutils.setup keyword arguments. If info_dict == {}, then the asked resource is not available (system_info could not find it).

Several *_info classes specify an environment variable to specify the locations of software. When setting the corresponding environment variable to 'None' then the software will be ignored, even when it is available in system.

Global parameters:
system_info.search_static_first - search static libraries (.a)
in precedence to shared ones (.so, .sl) if enabled.

system_info.verbosity - output the results to stdout if enabled.

The file 'site.cfg' is looked for in

  1. Directory of main setup.py file being run.
  2. Home directory of user running the setup.py file as ~/.numpy-site.cfg
  3. System wide directory (location of this file...)

The first one found is used to get system configuration options The format is that used by ConfigParser (i.e., Windows .INI style). The section ALL is not intended for general use.

Appropriate defaults are used if nothing is specified.

The order of finding the locations of resources is the following:
  1. environment variable
  2. section in site.cfg
  3. DEFAULT section in site.cfg
  4. System default search paths (see default_* variables below).

Only the first complete match is returned.

Currently, the following classes are available, along with their section names:

Numeric_info:Numeric _numpy_info:Numeric _pkg_config_info:None accelerate_info:accelerate agg2_info:agg2 amd_info:amd atlas_3_10_blas_info:atlas atlas_3_10_blas_threads_info:atlas atlas_3_10_info:atlas atlas_3_10_threads_info:atlas atlas_blas_info:atlas atlas_blas_threads_info:atlas atlas_info:atlas atlas_threads_info:atlas blas64__opt_info:ALL # usage recommended (general ILP64 BLAS, 64_ symbol suffix) blas_ilp64_opt_info:ALL # usage recommended (general ILP64 BLAS) blas_ilp64_plain_opt_info:ALL # usage recommended (general ILP64 BLAS, no symbol suffix) blas_info:blas blas_mkl_info:mkl blas_opt_info:ALL # usage recommended blas_src_info:blas_src blis_info:blis boost_python_info:boost_python dfftw_info:fftw dfftw_threads_info:fftw djbfft_info:djbfft f2py_info:ALL fft_opt_info:ALL fftw2_info:fftw fftw3_info:fftw3 fftw_info:fftw fftw_threads_info:fftw flame_info:flame freetype2_info:freetype2 gdk_2_info:gdk_2 gdk_info:gdk gdk_pixbuf_2_info:gdk_pixbuf_2 gdk_pixbuf_xlib_2_info:gdk_pixbuf_xlib_2 gdk_x11_2_info:gdk_x11_2 gtkp_2_info:gtkp_2 gtkp_x11_2_info:gtkp_x11_2 lapack64__opt_info:ALL # usage recommended (general ILP64 LAPACK, 64_ symbol suffix) lapack_atlas_3_10_info:atlas lapack_atlas_3_10_threads_info:atlas lapack_atlas_info:atlas lapack_atlas_threads_info:atlas lapack_ilp64_opt_info:ALL # usage recommended (general ILP64 LAPACK) lapack_ilp64_plain_opt_info:ALL # usage recommended (general ILP64 LAPACK, no symbol suffix) lapack_info:lapack lapack_mkl_info:mkl lapack_opt_info:ALL # usage recommended lapack_src_info:lapack_src mkl_info:mkl numarray_info:numarray numerix_info:numerix numpy_info:numpy openblas64__info:openblas64_ openblas64__lapack_info:openblas64_ openblas_clapack_info:openblas openblas_ilp64_info:openblas_ilp64 openblas_ilp64_lapack_info:openblas_ilp64 openblas_info:openblas openblas_lapack_info:openblas sfftw_info:fftw sfftw_threads_info:fftw system_info:ALL umfpack_info:umfpack wx_info:wx x11_info:x11 xft_info:xft

Note that blas_opt_info and lapack_opt_info honor the NPY_BLAS_ORDER and NPY_LAPACK_ORDER environment variables to determine the order in which specific BLAS and LAPACK libraries are searched for.

This search (or autodetection) can be bypassed by defining the environment variables NPY_BLAS_LIBS and NPY_LAPACK_LIBS, which should then contain the exact linker flags to use (language will be set to F77). Building against Netlib BLAS/LAPACK or stub files, in order to be able to switch BLAS and LAPACK implementations at runtime. If using this to build NumPy itself, it is recommended to also define NPY_CBLAS_LIBS (assuming your BLAS library has a CBLAS interface) to enable CBLAS usage for matrix multiplication (unoptimized otherwise).

Example:

[DEFAULT] # default section library_dirs = /usr/lib:/usr/local/lib:/opt/lib include_dirs = /usr/include:/usr/local/include:/opt/include src_dirs = /usr/local/src:/opt/src # search static libraries (.a) in preference to shared ones (.so) search_static_first = 0

[fftw] libraries = rfftw, fftw

[atlas] library_dirs = /usr/lib/3dnow:/usr/lib/3dnow/atlas # for overriding the names of the atlas libraries libraries = lapack, f77blas, cblas, atlas

[x11] library_dirs = /usr/X11R6/lib include_dirs = /usr/X11R6/include ----------

Note that the libraries key is the default setting for libraries.

Authors:
Pearu Peterson <pearu@cens.ioc.ee>, February 2002 David M. Cooke <cookedm@physics.mcmaster.ca>, April 2002

Copyright 2002 Pearu Peterson all rights reserved, Pearu Peterson <pearu@cens.ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy (BSD style) license. See LICENSE.txt that came with this distribution for specifics.

NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.

Function get​_info No summary
Function get​_standard​_file No summary
Variable atlas​_version​_c​_text Undocumented
Variable conda Undocumented
Variable conda​_dir Undocumented
Variable default​_include​_dirs Undocumented
Variable default​_lib​_dirs Undocumented
Variable default​_runtime​_dirs Undocumented
Variable default​_src​_dirs Undocumented
Variable default​_x11​_include​_dirs Undocumented
Variable default​_x11​_lib​_dirs Undocumented
Variable global​_compiler Undocumented
Variable inv​_language​_map Undocumented
Variable language​_map Undocumented
Variable platform​_bits Undocumented
Variable so​_ext Undocumented
Variable specifier Undocumented
Variable vcpkg Undocumented
Variable vcpkg​_dir Undocumented
Variable vcpkg​_installed Undocumented
Class ​_ilp64​_opt​_info​_mixin Undocumented
Class ​_numpy​_info Undocumented
Class ​_pkg​_config​_info Undocumented
Class accelerate​_info Undocumented
Class agg2​_info Undocumented
Class ​Aliased​Option​Error Aliases entries in config files should not be existing. In section '{section}' we found multiple appearances of options {options}.
Class amd​_info Undocumented
Class armpl​_info Undocumented
Class atlas​_3​_10​_blas​_info Undocumented
Class atlas​_3​_10​_blas​_threads​_info Undocumented
Class atlas​_3​_10​_info Undocumented
Class atlas​_3​_10​_threads​_info Undocumented
Class atlas​_blas​_info Undocumented
Class atlas​_blas​_threads​_info Undocumented
Class atlas​_info Undocumented
Class atlas​_threads​_info Undocumented
Class ​Atlas​Not​Found​Error No summary
Class blas64​_​_opt​_info Undocumented
Class blas​_armpl​_info Undocumented
Class blas​_ilp64​_opt​_info Undocumented
Class blas​_ilp64​_plain​_opt​_info Undocumented
Class blas​_info No class docstring; 0/3 class variable, 1/2 method documented
Class blas​_mkl​_info Undocumented
Class blas​_opt​_info Undocumented
Class blas​_src​_info Undocumented
Class ​Blas​ILP64​Not​Found​Error 64-bit Blas libraries not found. Known libraries in numpy/distutils/site.cfg file are: openblas64_, openblas_ilp64
Class ​Blas​Not​Found​Error No summary
Class ​Blas​Opt​Not​Found​Error No summary
Class ​Blas​Src​Not​Found​Error No summary
Class blis​_info Undocumented
Class boost​_python​_info Undocumented
Class cblas​_info Undocumented
Class dfftw​_info Undocumented
Class dfftw​_threads​_info Undocumented
Class djbfft​_info Undocumented
Class ​DJBFFTNot​Found​Error No summary
Class f2py​_info Undocumented
Class fft​_opt​_info Undocumented
Class fftw2​_info Undocumented
Class fftw3​_armpl​_info Undocumented
Class fftw3​_info Undocumented
Class fftw​_info No class docstring; 0/3 class variable, 1/2 method documented
Class fftw​_threads​_info Undocumented
Class ​FFTWNot​Found​Error No summary
Class flame​_info Usage of libflame for LAPACK operations
Class ​Flame​Not​Found​Error FLAME (http://www.cs.utexas.edu/~flame/web/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [flame]).
Class freetype2​_info Undocumented
Class gdk​_2​_info Undocumented
Class gdk​_info Undocumented
Class gdk​_pixbuf​_2​_info Undocumented
Class gdk​_pixbuf​_xlib​_2​_info Undocumented
Class gdk​_x11​_2​_info Undocumented
Class gtkp​_2​_info Undocumented
Class gtkp​_x11​_2​_info Undocumented
Class lapack64​_​_opt​_info Undocumented
Class lapack​_armpl​_info Undocumented
Class lapack​_atlas​_3​_10​_info Undocumented
Class lapack​_atlas​_3​_10​_threads​_info Undocumented
Class lapack​_atlas​_info Undocumented
Class lapack​_atlas​_threads​_info Undocumented
Class lapack​_ilp64​_opt​_info Undocumented
Class lapack​_ilp64​_plain​_opt​_info Undocumented
Class lapack​_info Undocumented
Class lapack​_mkl​_info Undocumented
Class lapack​_opt​_info Undocumented
Class lapack​_src​_info Undocumented
Class ​Lapack​ILP64​Not​Found​Error 64-bit Lapack libraries not found. Known libraries in numpy/distutils/site.cfg file are: openblas64_, openblas_ilp64
Class ​Lapack​Not​Found​Error No summary
Class ​Lapack​Src​Not​Found​Error No summary
Class mkl​_info Undocumented
Class ​Not​Found​Error Some third-party program or library is not found.
Class numarray​_info Undocumented
Class ​Numeric_info Undocumented
Class ​Numeric​Not​Found​Error Numeric (https://www.numpy.org/) module not found. Get it from above location, install it, and retry setup.py.
Class numerix​_info Undocumented
Class numpy​_info Undocumented
Class openblas64​_​_info Undocumented
Class openblas64​_​_lapack​_info Undocumented
Class openblas​_clapack​_info Undocumented
Class openblas​_ilp64​_info Undocumented
Class openblas​_ilp64​_lapack​_info Undocumented
Class openblas​_info Undocumented
Class openblas​_lapack​_info Undocumented
Class sfftw​_info Undocumented
Class sfftw​_threads​_info Undocumented
Class system​_info get_info() is the only public method. Don't use others.
Class umfpack​_info Undocumented
Class ​Umfpack​Not​Found​Error No summary
Class wx​_info Undocumented
Class x11​_info Undocumented
Class ​X11​Not​Found​Error X11 libraries not found.
Class xft​_info Undocumented
Function ​_c​_string​_literal Convert a python string into a literal suitable for inclusion into C code
Function ​_parse​_env​_order Parse an environment variable env by splitting with "," and only returning elements from base_order
Function add​_system​_root Add a package manager root to the include directories
Function combine​_paths Return a list of existing paths composed by all combinations of items from arguments.
Function customized​_ccompiler Undocumented
Function dict​_append Undocumented
Function get​_atlas​_version Undocumented
Function libpaths Return a list of library paths valid on 32 or 64 bit systems.
Function parse​Cmd​Line Undocumented
Function show​_all Undocumented
Variable ​_bits Undocumented
Variable ​_cached​_atlas​_version Undocumented
Variable ​_include​_dirs Undocumented
Variable ​_lib​_dirs Undocumented
def get_info(name, notfound_action=0):
notfound_action:
0 - do nothing 1 - display warning message 2 - raise error
def get_standard_file(fname):
Returns a list of files named 'fname' from 1) System-wide directory (directory-location of this module) 2) Users HOME directory (os.environ['HOME']) 3) Local directory
atlas_version_c_text: str =

Undocumented

conda =

Undocumented

conda_dir =

Undocumented

default_include_dirs =

Undocumented

default_lib_dirs =

Undocumented

default_runtime_dirs =

Undocumented

default_src_dirs =

Undocumented

default_x11_include_dirs: list =

Undocumented

default_x11_lib_dirs: list =

Undocumented

global_compiler =

Undocumented

inv_language_map: dict[int, str] =

Undocumented

language_map: dict[str, int] =

Undocumented

platform_bits =

Undocumented

so_ext =

Undocumented

specifier: str =

Undocumented

vcpkg =

Undocumented

vcpkg_dir =

Undocumented

vcpkg_installed =

Undocumented

def _c_string_literal(s):
Convert a python string into a literal suitable for inclusion into C code
def _parse_env_order(base_order, env):

Parse an environment variable env by splitting with "," and only returning elements from base_order

This method will sequence the environment variable and check for their individual elements in base_order.

The items in the environment variable may be negated via '^item' or '!itema,itemb'. It must start with ^/! to negate all options.

Raises

ValueError: for mixed negated and non-negated orders or multiple negated orders

Parameters

base_order : list of str
the base list of orders
env : str
the environment variable to be parsed, if none is found, base_order is returned

Returns

allow_order : list of str
allowed orders in lower-case
unknown_order : list of str
for values not overlapping with base_order
def add_system_root(library_root):
Add a package manager root to the include directories
def combine_paths(*args, **kws):
Return a list of existing paths composed by all combinations of items from arguments.
def customized_ccompiler():

Undocumented

def dict_append(d, **kws):

Undocumented

def get_atlas_version(**config):

Undocumented

def libpaths(paths, bits):

Return a list of library paths valid on 32 or 64 bit systems.

Inputs:
paths : sequence
A sequence of strings (typically paths)
bits : int
An integer, the only valid values are 32 or 64. A ValueError exception

is raised otherwise.

Examples:

Consider a list of directories >>> paths = ['/usr/X11R6/lib','/usr/X11/lib','/usr/lib']

For a 32-bit platform, this is already valid: >>> np.distutils.system_info.libpaths(paths,32) ['/usr/X11R6/lib', '/usr/X11/lib', '/usr/lib']

On 64 bits, we prepend the '64' postfix >>> np.distutils.system_info.libpaths(paths,64) ['/usr/X11R6/lib64', '/usr/X11R6/lib', '/usr/X11/lib64', '/usr/X11/lib', '/usr/lib64', '/usr/lib']

def parseCmdLine(argv=(None)):

Undocumented

def show_all(argv=None):

Undocumented

_bits: dict[str, int] =

Undocumented

_cached_atlas_version: dict =

Undocumented

_include_dirs =

Undocumented

_lib_dirs =

Undocumented