本文整理匯總了Python中numpy.distutils.system_info.get_info方法的典型用法代碼示例。如果您正苦於以下問題:Python system_info.get_info方法的具體用法?Python system_info.get_info怎麽用?Python system_info.get_info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類numpy.distutils.system_info
的用法示例。
在下文中一共展示了system_info.get_info方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_blas_info
# 需要導入模塊: from numpy.distutils import system_info [as 別名]
# 或者: from numpy.distutils.system_info import get_info [as 別名]
def get_blas_info():
def atlas_not_found(blas_info_):
def_macros = blas_info.get('define_macros', [])
for x in def_macros:
if x[0] == "NO_ATLAS_INFO":
# if x[1] != 1 we should have lapack
# how do we do that now?
return True
if x[0] == "ATLAS_INFO":
if "None" in x[1]:
# this one turned up on FreeBSD
return True
return False
blas_info = get_info('blas_opt', 0)
if (not blas_info) or atlas_not_found(blas_info):
cblas_libs = ['cblas']
blas_info.pop('libraries', None)
else:
cblas_libs = blas_info.pop('libraries', [])
return cblas_libs, blas_info
示例2: configuration
# 需要導入模塊: from numpy.distutils import system_info [as 別名]
# 或者: from numpy.distutils.system_info import get_info [as 別名]
def configuration(parent_package='', top_path=None):
from numpy.distutils.system_info import get_info
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('cluster', parent_package, top_path)
blas_opt = get_info('lapack_opt')
config.add_data_dir('tests')
config.add_extension('_vq',
sources=[('_vq.c')],
include_dirs=[get_numpy_include_dirs()],
extra_info=blas_opt)
config.add_extension('_hierarchy',
sources=[('_hierarchy.c')],
include_dirs=[get_numpy_include_dirs()])
config.add_extension('_optimal_leaf_ordering',
sources=[('_optimal_leaf_ordering.c')],
include_dirs=[get_numpy_include_dirs()])
return config
示例3: configuration
# 需要導入模塊: from numpy.distutils import system_info [as 別名]
# 或者: from numpy.distutils.system_info import get_info [as 別名]
def configuration(parent_package='', top_path=None):
from numpy.distutils.system_info import get_info
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('cluster', parent_package, top_path)
blas_opt = get_info('lapack_opt')
config.add_data_dir('tests')
config.add_extension('_vq',
sources=[('_vq.c')],
include_dirs=[get_numpy_include_dirs()],
extra_info=blas_opt)
config.add_extension('_hierarchy',
sources=[('_hierarchy.c')],
include_dirs=[get_numpy_include_dirs()])
return config
示例4: configuration
# 需要導入模塊: from numpy.distutils import system_info [as 別名]
# 或者: from numpy.distutils.system_info import get_info [as 別名]
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
'''
from distutils.sysconfig import get_python_inc
from numpy.distutils.system_info import get_info, NotFoundError, numpy_info
from numpy.distutils.misc_util import get_numpy_include_dirs
from scipy._build_utils import (get_sgemv_fix, get_g77_abi_wrappers, split_fortran_files)
config = Configuration('odr', parent_package, top_path)
lapack_opt = get_info('lapack_opt')
if not lapack_opt:
raise NotFoundError('no lapack/blas resources found')
atlas_version = ([v[3:-3] for k, v in lapack_opt.get('define_macros', [])
if k == 'ATLAS_INFO']+[None])[0]
if atlas_version:
print(('ATLAS version: %s' % atlas_version))
sources = ['dqrsl.pyf.src']
sources += get_g77_abi_wrappers(lapack_opt)
sources += get_sgemv_fix(lapack_opt)
# add the fortran module
config.add_extension('dqrsl',
sources=sources,
depends=[],
extra_info=lapack_opt
)
return config
'''
config = Configuration('odr', parent_package, top_path)
config.add_extension('dqrsl',
sources=['dqrsl.f'])
return config
示例5: configuration
# 需要導入模塊: from numpy.distutils import system_info [as 別名]
# 或者: from numpy.distutils.system_info import get_info [as 別名]
def configuration(parent_package='',top_path=None):
from numpy.distutils.system_info import get_info, NotFoundError
from numpy.distutils.misc_util import Configuration
from scipy._build_utils import get_g77_abi_wrappers
config = Configuration('isolve',parent_package,top_path)
lapack_opt = get_info('lapack_opt')
if not lapack_opt:
raise NotFoundError('no lapack/blas resources found')
# iterative methods
methods = ['BiCGREVCOM.f.src',
'BiCGSTABREVCOM.f.src',
'CGREVCOM.f.src',
'CGSREVCOM.f.src',
# 'ChebyREVCOM.f.src',
'GMRESREVCOM.f.src',
# 'JacobiREVCOM.f.src',
'QMRREVCOM.f.src',
# 'SORREVCOM.f.src'
]
Util = ['STOPTEST2.f.src','getbreak.f.src']
sources = Util + methods + ['_iterative.pyf.src']
sources = [join('iterative', x) for x in sources]
sources += get_g77_abi_wrappers(lapack_opt)
config.add_extension('_iterative',
sources=sources,
extra_info=lapack_opt)
config.add_data_dir('tests')
return config
示例6: configuration
# 需要導入模塊: from numpy.distutils import system_info [as 別名]
# 或者: from numpy.distutils.system_info import get_info [as 別名]
def configuration(parent_package='',top_path=None):
from numpy.distutils.system_info import get_info, NotFoundError
from numpy.distutils.misc_util import Configuration
from scipy._build_utils import get_g77_abi_wrappers, get_sgemv_fix
lapack_opt = get_info('lapack_opt')
if not lapack_opt:
raise NotFoundError('no lapack/blas resources found')
config = Configuration('arpack', parent_package, top_path)
arpack_sources = [join('ARPACK','SRC', '*.f')]
arpack_sources.extend([join('ARPACK','UTIL', '*.f')])
arpack_sources += get_g77_abi_wrappers(lapack_opt)
config.add_library('arpack_scipy', sources=arpack_sources,
include_dirs=[join('ARPACK', 'SRC')])
ext_sources = ['arpack.pyf.src']
ext_sources += get_sgemv_fix(lapack_opt)
config.add_extension('_arpack',
sources=ext_sources,
libraries=['arpack_scipy'],
extra_info=lapack_opt,
depends=arpack_sources,
)
config.add_data_dir('tests')
# Add license files
config.add_data_files('ARPACK/COPYING')
return config
示例7: configuration
# 需要導入模塊: from numpy.distutils import system_info [as 別名]
# 或者: from numpy.distutils.system_info import get_info [as 別名]
def configuration(parent_package='', top_path=None):
import warnings
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, BlasNotFoundError
config = Configuration('odr', parent_package, top_path)
libodr_files = ['d_odr.f',
'd_mprec.f',
'dlunoc.f']
blas_info = get_info('blas_opt')
if blas_info:
libodr_files.append('d_lpk.f')
else:
warnings.warn(BlasNotFoundError.__doc__)
libodr_files.append('d_lpkbls.f')
odrpack_src = [join('odrpack', x) for x in libodr_files]
config.add_library('odrpack', sources=odrpack_src)
sources = ['__odrpack.c']
libraries = ['odrpack'] + blas_info.pop('libraries', [])
include_dirs = ['.'] + blas_info.pop('include_dirs', [])
config.add_extension('__odrpack',
sources=sources,
libraries=libraries,
include_dirs=include_dirs,
depends=(['odrpack.h'] + odrpack_src),
**blas_info
)
config.add_data_dir('tests')
return config
示例8: configuration
# 需要導入模塊: from numpy.distutils import system_info [as 別名]
# 或者: from numpy.distutils.system_info import get_info [as 別名]
def configuration(parent_package='',top_path=None):
import numpy
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, dict_append
config = Configuration('umfpack', parent_package, top_path)
config.add_data_dir('tests')
umf_info = get_info('umfpack', notfound_action=1)
umfpack_i_file = config.paths('umfpack.i')[0]
def umfpack_i(ext, build_dir):
if umf_info:
return umfpack_i_file
blas_info = get_info('blas_opt')
build_info = {}
dict_append(build_info, **umf_info)
dict_append(build_info, **blas_info)
config.add_extension('__umfpack',
sources=[umfpack_i],
depends=['umfpack.i'],
**build_info)
return config
示例9: configuration
# 需要導入模塊: from numpy.distutils import system_info [as 別名]
# 或者: from numpy.distutils.system_info import get_info [as 別名]
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
config = Configuration('dsolve',parent_package,top_path)
config.add_data_dir('tests')
lapack_opt = get_info('lapack_opt',notfound_action=2)
if sys.platform == 'win32':
superlu_defs = [('NO_TIMER',1)]
else:
superlu_defs = []
superlu_defs.append(('USE_VENDOR_BLAS',1))
superlu_src = join(dirname(__file__), 'SuperLU', 'SRC')
sources = list(glob.glob(join(superlu_src, '*.c')))
headers = list(glob.glob(join(superlu_src, '*.h')))
if os.name == 'nt' and ('FPATH' in os.environ or 'MKLROOT' in os.environ):
# when using MSVC + MKL, lsame is already in MKL
sources.remove(join(superlu_src, 'lsame.c'))
config.add_library('superlu_src',
sources=sources,
macros=superlu_defs,
include_dirs=[superlu_src],
)
# Extension
config.add_extension('_superlu',
sources=['_superlumodule.c',
'_superlu_utils.c',
'_superluobject.c'],
libraries=['superlu_src'],
depends=(sources + headers),
extra_info=lapack_opt,
)
config.add_subpackage('umfpack')
return config
示例10: configuration
# 需要導入模塊: from numpy.distutils import system_info [as 別名]
# 或者: from numpy.distutils.system_info import get_info [as 別名]
def configuration(parent_package='',top_path=None):
from numpy.distutils.system_info import get_info, NotFoundError
from numpy.distutils.misc_util import Configuration
from scipy._build_utils import get_g77_abi_wrappers
config = Configuration('arpack',parent_package,top_path)
lapack_opt = get_info('lapack_opt')
if not lapack_opt:
raise NotFoundError('no lapack/blas resources found')
config = Configuration('arpack', parent_package, top_path)
arpack_sources = [join('ARPACK','SRC', '*.f')]
arpack_sources.extend([join('ARPACK','UTIL', '*.f')])
arpack_sources.extend([join('ARPACK','LAPACK', '*.f')])
arpack_sources += get_g77_abi_wrappers(lapack_opt)
config.add_library('arpack_scipy', sources=arpack_sources,
include_dirs=[join('ARPACK', 'SRC')])
config.add_extension('_arpack',
sources='arpack.pyf.src',
libraries=['arpack_scipy'],
extra_info=lapack_opt,
depends=arpack_sources,
)
config.add_data_dir('tests')
return config
示例11: configuration
# 需要導入模塊: from numpy.distutils import system_info [as 別名]
# 或者: from numpy.distutils.system_info import get_info [as 別名]
def configuration(parent_package='',top_path=None):
from numpy.distutils.system_info import get_info, NotFoundError
from numpy.distutils.misc_util import Configuration
from scipy._build_utils import get_g77_abi_wrappers
config = Configuration('isolve',parent_package,top_path)
lapack_opt = get_info('lapack_opt')
if not lapack_opt:
raise NotFoundError('no lapack/blas resources found')
# iterative methods
methods = ['BiCGREVCOM.f.src',
'BiCGSTABREVCOM.f.src',
'CGREVCOM.f.src',
'CGSREVCOM.f.src',
# 'ChebyREVCOM.f.src',
'GMRESREVCOM.f.src',
# 'JacobiREVCOM.f.src',
'QMRREVCOM.f.src',
# 'SORREVCOM.f.src'
]
Util = ['getbreak.f.src']
sources = Util + methods + ['_iterative.pyf.src']
sources = [join('iterative', x) for x in sources]
sources += get_g77_abi_wrappers(lapack_opt)
config.add_extension('_iterative',
sources=sources,
extra_info=lapack_opt)
config.add_data_dir('tests')
return config
示例12: configuration
# 需要導入模塊: from numpy.distutils import system_info [as 別名]
# 或者: from numpy.distutils.system_info import get_info [as 別名]
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, dict_append
config = Configuration('umfpack', parent_package, top_path)
config.add_data_dir('tests')
umf_info = get_info('umfpack', notfound_action=1)
## The following addition is needed when linking against a umfpack built
## from the latest SparseSuite. Not (strictly) needed when linking against
## the version in the ubuntu repositories.
if not sys.platform in ('darwin', 'win32'):
umf_info['libraries'].insert(0, 'rt')
umfpack_i_file = config.paths('umfpack.i')[0]
def umfpack_i(ext, build_dir):
if umf_info:
return umfpack_i_file
blas_info = get_info('blas_opt')
build_info = {}
dict_append(build_info, **umf_info)
dict_append(build_info, **blas_info)
config.add_extension('__umfpack',
sources=[umfpack_i],
depends=['umfpack.i'],
**build_info)
return config
示例13: configuration
# 需要導入模塊: from numpy.distutils import system_info [as 別名]
# 或者: from numpy.distutils.system_info import get_info [as 別名]
def configuration(parent_package='',top_path=None):
from numpy.distutils.system_info import get_info, NotFoundError
from numpy.distutils.misc_util import Configuration
from scipy._build_utils import get_g77_abi_wrappers, get_sgemv_fix
config = Configuration('arpack',parent_package,top_path)
lapack_opt = get_info('lapack_opt')
if not lapack_opt:
raise NotFoundError('no lapack/blas resources found')
config = Configuration('arpack', parent_package, top_path)
arpack_sources = [join('ARPACK','SRC', '*.f')]
arpack_sources.extend([join('ARPACK','UTIL', '*.f')])
arpack_sources += get_g77_abi_wrappers(lapack_opt)
config.add_library('arpack_scipy', sources=arpack_sources,
include_dirs=[join('ARPACK', 'SRC')])
ext_sources = ['arpack.pyf.src']
ext_sources += get_sgemv_fix(lapack_opt)
config.add_extension('_arpack',
sources=ext_sources,
libraries=['arpack_scipy'],
extra_info=lapack_opt,
depends=arpack_sources,
)
config.add_data_dir('tests')
return config
示例14: checkimports
# 需要導入模塊: from numpy.distutils import system_info [as 別名]
# 或者: from numpy.distutils.system_info import get_info [as 別名]
def checkimports(optiondict):
from numpy.distutils.system_info import get_info
optiondict['blas_opt'] = get_info('blas_opt')
optiondict['lapack_opt'] = get_info('lapack_opt')
if pyfftwexists:
print('monkey patched scipy.fftpack to use pyfftw')
else:
print('using standard scipy.fftpack')
optiondict['pyfftwexists'] = pyfftwexists
if numbaexists:
print('numba exists')
else:
print('numba does not exist')
optiondict['numbaexists'] = numbaexists
if memprofilerexists:
print('memprofiler exists')
else:
print('memprofiler does not exist')
optiondict['memprofilerexists'] = memprofilerexists
if nibabelexists:
print('nibabel exists')
else:
print('nibabel does not exist')
optiondict['nibabelexists'] = nibabelexists
if donotbeaggressive:
print('no aggressive optimization')
else:
print('aggressive optimization')
optiondict['donotbeaggressive'] = donotbeaggressive
global donotusenumba
if donotusenumba:
print('will not use numba even if present')
else:
print('using numba if present')
optiondict['donotusenumba'] = donotusenumba
示例15: configuration
# 需要導入模塊: from numpy.distutils import system_info [as 別名]
# 或者: from numpy.distutils.system_info import get_info [as 別名]
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
config = Configuration('linalg', parent_package, top_path)
config.add_data_dir('tests')
# Configure lapack_lite
src_dir = 'lapack_lite'
lapack_lite_src = [
os.path.join(src_dir, 'python_xerbla.c'),
os.path.join(src_dir, 'f2c_z_lapack.c'),
os.path.join(src_dir, 'f2c_c_lapack.c'),
os.path.join(src_dir, 'f2c_d_lapack.c'),
os.path.join(src_dir, 'f2c_s_lapack.c'),
os.path.join(src_dir, 'f2c_lapack.c'),
os.path.join(src_dir, 'f2c_blas.c'),
os.path.join(src_dir, 'f2c_config.c'),
os.path.join(src_dir, 'f2c.c'),
]
all_sources = config.paths(lapack_lite_src)
lapack_info = get_info('lapack_opt', 0) # and {}
def get_lapack_lite_sources(ext, build_dir):
if not lapack_info:
print("### Warning: Using unoptimized lapack ###")
return all_sources
else:
if sys.platform == 'win32':
print("### Warning: python_xerbla.c is disabled ###")
return []
return [all_sources[0]]
config.add_extension(
'lapack_lite',
sources=['lapack_litemodule.c', get_lapack_lite_sources],
depends=['lapack_lite/f2c.h'],
extra_info=lapack_info,
)
# umath_linalg module
config.add_extension(
'_umath_linalg',
sources=['umath_linalg.c.src', get_lapack_lite_sources],
depends=['lapack_lite/f2c.h'],
extra_info=lapack_info,
libraries=['npymath'],
)
return config