"Fossies" - the Fresh Open Source Software Archive

Member "numpy-1.16.4/numpy/linalg/setup.py" (22 Feb 2019, 1878 Bytes) of package /linux/misc/numpy-1.16.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "setup.py" see the Fossies "Dox" file reference documentation.

    1 from __future__ import division, print_function
    2 
    3 import os
    4 import sys
    5 
    6 def configuration(parent_package='', top_path=None):
    7     from numpy.distutils.misc_util import Configuration
    8     from numpy.distutils.system_info import get_info
    9     config = Configuration('linalg', parent_package, top_path)
   10 
   11     config.add_data_dir('tests')
   12 
   13     # Configure lapack_lite
   14 
   15     src_dir = 'lapack_lite'
   16     lapack_lite_src = [
   17         os.path.join(src_dir, 'python_xerbla.c'),
   18         os.path.join(src_dir, 'f2c_z_lapack.c'),
   19         os.path.join(src_dir, 'f2c_c_lapack.c'),
   20         os.path.join(src_dir, 'f2c_d_lapack.c'),
   21         os.path.join(src_dir, 'f2c_s_lapack.c'),
   22         os.path.join(src_dir, 'f2c_lapack.c'),
   23         os.path.join(src_dir, 'f2c_blas.c'),
   24         os.path.join(src_dir, 'f2c_config.c'),
   25         os.path.join(src_dir, 'f2c.c'),
   26     ]
   27     all_sources = config.paths(lapack_lite_src)
   28 
   29     lapack_info = get_info('lapack_opt', 0)  # and {}
   30 
   31     def get_lapack_lite_sources(ext, build_dir):
   32         if not lapack_info:
   33             print("### Warning:  Using unoptimized lapack ###")
   34             return all_sources
   35         else:
   36             if sys.platform == 'win32':
   37                 print("### Warning:  python_xerbla.c is disabled ###")
   38                 return []
   39             return [all_sources[0]]
   40 
   41     config.add_extension(
   42         'lapack_lite',
   43         sources=['lapack_litemodule.c', get_lapack_lite_sources],
   44         depends=['lapack_lite/f2c.h'],
   45         extra_info=lapack_info,
   46     )
   47 
   48     # umath_linalg module
   49     config.add_extension(
   50         '_umath_linalg',
   51         sources=['umath_linalg.c.src', get_lapack_lite_sources],
   52         depends=['lapack_lite/f2c.h'],
   53         extra_info=lapack_info,
   54         libraries=['npymath'],
   55     )
   56     return config
   57 
   58 if __name__ == '__main__':
   59     from numpy.distutils.core import setup
   60     setup(configuration=configuration)