File: //usr/local/lib/python3.10/dist-packages/numpy/distutils/__pycache__/system_info.cpython-310.pyc
o
���gf� �
@ s d Z ddlZddlZddlZddlZddlZddlZddlZddlmZ ddl m
Z
ddlmZ ddlm
Z ddlmZ ddlmZ ddlZdd lmZ dd
lmZ ddlmZmZ ddlmZmZmZ dd
lm Z! ddlm"Z# ddlm$Z$ ddl%Z&ddl'Z'ddl(Z(dgZ)ddl*Z*ddd�Z+e+e*�,� d Z-da.dd� Z"dd� Z/dd� Z0ej*dk�r8dej1�2e�3d�d�ga4g Z5g a6dgZ7g Z8g Z9dd gZ:d!gZ;d"d#� e:D �Z:d$d#� e;D �Z;d%d&� Z<e(�=d'�Z>e>�rej1�?e>�Z@e*�,� d d(kr�d)ZAnd*ZAej1�2e@d+�ZBej1�2eBeAd, �ej1�2eBeAd- �fD ]ZCe<eC� �qe(�=d.�ZDeD�r7ej1�?eD�ZEe<ej1�2eEd/d0�� e<ej1�2eEd0�� n�e0g d1�e-�a4g Z5g d2�a6g d3�Z7e0g d4�e-�Z8d5d6gZ9ej1�Fd7��rzed8�ZGeG�rzej1�HeGd �d ZIe8�JeId7g� e9�Jd9d:g� eKejLd;��HZMz
ejNd<d=gejOeMd>�ZPW n eQef�y� Y n'w eReP�S� d �T� �U� �ZVePjWdk�r�e8ej1�2d?eV�g7 Z8t4ej1�2d?eV�g7 a4W d � n 1 �s�w Y ej1�2ejXd!�t4v�r�t4�Ydej1�2ejXd!�� t6�Zej1�2ejXd�� e7�Zej1�2ejXd@�� dAd#� t4D �a4dBd#� e5D �Z5dCd#� t6D �a6dDd#� e7D �Z7e� Z[dEdF� Z\dGdH� Z]�d dIdJ�Z^G dKdL� dLe�Z_G dMdN� dNe�Z`G dOdP� dPe_�ZaG dQdR� dRe_�ZbG dSdT� dTe_�ZcG dUdV� dVec�ZdG dWdX� dXe_�ZeG dYdZ� dZe_�ZfG d[d\� d\e_�ZgG d]d^� d^e_�ZhG d_d`� d`eg�ZiG dadb� dbe_�ZjG dcdd� dde_�ZkG dedf� dfe_�ZlG dgdh� dhe_�ZmG didj� dje_�ZnG dkd� d�ZoG dldm� dmeo�ZpG dndo� doeo�ZqG dpdq� dqeq�ZrG drds� dseq�ZsG dtdu� dueq�ZtG dvdw� dweq�ZuG dxdy� dyeq�ZvG dzd{� d{eq�ZwG d|d}� d}eq�ZxG d~d� deq�ZyG d�d�� d�eo�ZzG d�d�� d�eo�Z{G d�d�� d�e{�Z|G d�d�� d�e{�Z}G d�d�� d�eo�Z~G d�d�� d�e~�ZG d�d�� d�e~�Z�G d�d�� d�eo�Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�eo�Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�eo�Z�G d�d�� d�eo�Z�d�Z�i Z�d�d�� Z�G d�d�� d�eo�Z�G d�d�� d��Z�G d�d�� d�e�e��Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�eo�Z�G d�d�� d�e�e��Z�G d�d d�e��Z�G d�dĄ d�e��Z�G d�dƄ d�eo�Z�G d�dȄ d�eo�Z�G d�dʄ d�e��Z�G d�d̄ d�e��Z�G d�d΄ d�e��Z�G d�dЄ d�e��Z�G d�d҄ d�e��Z�G d�dԄ d�e��Z�G d�dք d�e�e��Z�G d�d d�e��Z�G d�dڄ d�eo�Z�G d�d܄ d�eo�Z�G d�dބ d�e��Z�G d�d� d�eo�Z�G d�d� d�eo�Z�G d�d� d�eo�Z�G d�d� d�e��Z�G d�d� d�e��Z�G d�d� d�e��Z�G d�d� d�eo�Z�G d�d� d�eo�Z�G d�d� d�eo�Z�G d�d� d�eo�Z�G d�d� d�eo�Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d�d�� d�e��Z�G d��d � �d e��Z�G �d�d� �de��Z�G �d�d� �de��Z�G �d�d� �de��Z�G �d�d� �de��Z�G �d �d
� �d
eo�Z�G �d�d� �deo�Z��d
�d� Z�d�d�d�d�d�ZÐd�d�d�d�d�ZĐd�d� ZŐd!�d�d�ZƐd�d�d�Z�eȐdk�r�eǃ dS dS (" a�
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
accelerate_lapack_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_ssl2_info:ssl2
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_ssl2_info:ssl2
lapack_opt_info:ALL # usage recommended
lapack_src_info:lapack_src
mkl_info:mkl
ssl2_info:ssl2
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.
� N)�glob)�reduce)�
NoOptionError)�RawConfigParser)�DistutilsError)�Distribution)�log)�get_platform)�find_executable�filepath_from_subprocess_output)�is_sequence� is_string�get_shared_lib_extension)�config)�customized_ccompiler)�_shell_utils�system_info� �@ )�32bit�64bitc C s t st� a t S �N)�global_compiler�_customized_ccompiler� r r �F/usr/local/lib/python3.10/dist-packages/numpy/distutils/system_info.pyr � s r c C s. | � dd�} | � dd�} | � dd�} d�| �S )zS
Convert a python string into a literal suitable for inclusion into C code
�\z\\�"z\"�
z\nz"{}")�replace�format)�sr r r �_c_string_literal� s
r"