本文整理汇总了Python中numpy.distutils.misc_util.dot_join函数的典型用法代码示例。如果您正苦于以下问题:Python dot_join函数的具体用法?Python dot_join怎么用?Python dot_join使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dot_join函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: configuration
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration, dot_join
config = Configuration('cg',parent_package,top_path)
config.add_data_dir('tests')
ext = build_extension('extension', config.local_path)
ext.name = dot_join(config.name,ext.name)
config.ext_modules.append(ext)
return config
开发者ID:hksonngan,项目名称:mytesgnikrow,代码行数:11,代码来源:setup.py
示例2: configuration
def configuration(parent_package="", top_path=None):
from numpy.distutils.misc_util import Configuration, dot_join
from numpy.distutils.system_info import get_info, default_lib_dirs
config = Configuration("core", parent_package, top_path)
local_dir = config.local_path
codegen_dir = join(local_dir, "code_generators")
if is_released(config):
warnings.simplefilter("error", MismatchCAPIWarning)
# Check whether we have a mismatch between the set C API VERSION and the
# actual C API VERSION
check_api_version(C_API_VERSION, codegen_dir)
generate_umath_py = join(codegen_dir, "generate_umath.py")
n = dot_join(config.name, "generate_umath")
generate_umath = imp.load_module(
"_".join(n.split(".")), open(generate_umath_py, "U"), generate_umath_py, (".py", "U", 1)
)
header_dir = "include/numpy" # this is relative to config.path_in_package
cocache = CallOnceOnly()
def generate_config_h(ext, build_dir):
target = join(build_dir, header_dir, "config.h")
d = os.path.dirname(target)
if not os.path.exists(d):
os.makedirs(d)
if newer(__file__, target):
config_cmd = config.get_config_cmd()
log.info("Generating %s", target)
# Check sizeof
moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
# Check math library and C99 math funcs availability
mathlibs = check_mathlib(config_cmd)
moredefs.append(("MATHLIB", ",".join(mathlibs)))
check_math_capabilities(config_cmd, moredefs, mathlibs)
moredefs.extend(cocache.check_ieee_macros(config_cmd)[0])
moredefs.extend(cocache.check_complex(config_cmd, mathlibs)[0])
# Signal check
if is_npy_no_signal():
moredefs.append("__NPY_PRIVATE_NO_SIGNAL")
# Windows checks
if sys.platform == "win32" or os.name == "nt":
win32_checks(moredefs)
# Inline check
inline = config_cmd.check_inline()
# Check whether we need our own wide character support
if not config_cmd.check_decl("Py_UNICODE_WIDE", headers=["Python.h"]):
PYTHON_HAS_UNICODE_WIDE = True
else:
PYTHON_HAS_UNICODE_WIDE = False
if ENABLE_SEPARATE_COMPILATION:
moredefs.append(("ENABLE_SEPARATE_COMPILATION", 1))
if NPY_RELAXED_STRIDES_CHECKING:
moredefs.append(("NPY_RELAXED_STRIDES_CHECKING", 1))
# Get long double representation
if sys.platform != "darwin":
rep = check_long_double_representation(config_cmd)
if rep in [
"INTEL_EXTENDED_12_BYTES_LE",
"INTEL_EXTENDED_16_BYTES_LE",
"MOTOROLA_EXTENDED_12_BYTES_BE",
"IEEE_QUAD_LE",
"IEEE_QUAD_BE",
"IEEE_DOUBLE_LE",
"IEEE_DOUBLE_BE",
"DOUBLE_DOUBLE_BE",
"DOUBLE_DOUBLE_LE",
]:
moredefs.append(("HAVE_LDOUBLE_%s" % rep, 1))
else:
raise ValueError("Unrecognized long double format: %s" % rep)
# Py3K check
if sys.version_info[0] == 3:
moredefs.append(("NPY_PY3K", 1))
# Generate the config.h file from moredefs
target_f = open(target, "w")
for d in moredefs:
if isinstance(d, str):
target_f.write("#define %s\n" % (d))
else:
target_f.write("#define %s %s\n" % (d[0], d[1]))
# define inline to our keyword, or nothing
#.........这里部分代码省略.........
开发者ID:noclew,项目名称:numpy,代码行数:101,代码来源:setup.py
示例3: configuration
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration,dot_join
from numpy.distutils.system_info import get_info, default_lib_dirs
config = Configuration('core',parent_package,top_path)
local_dir = config.local_path
codegen_dir = join(local_dir,'code_generators')
if is_released(config):
warnings.simplefilter('error', MismatchCAPIWarning)
# Check whether we have a mismatch between the set C API VERSION and the
# actual C API VERSION
check_api_version(C_API_VERSION, codegen_dir)
generate_umath_py = join(codegen_dir,'generate_umath.py')
n = dot_join(config.name,'generate_umath')
generate_umath = imp.load_module('_'.join(n.split('.')),
open(generate_umath_py,'U'),generate_umath_py,
('.py','U',1))
header_dir = 'include/numpy' # this is relative to config.path_in_package
cocache = CallOnceOnly()
def generate_config_h(ext, build_dir):
target = join(build_dir,header_dir,'config.h')
d = os.path.dirname(target)
if not os.path.exists(d):
os.makedirs(d)
if newer(__file__,target):
config_cmd = config.get_config_cmd()
log.info('Generating %s',target)
# Check sizeof
moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
# Check math library and C99 math funcs availability
mathlibs = check_mathlib(config_cmd)
moredefs.append(('MATHLIB',','.join(mathlibs)))
check_math_capabilities(config_cmd, moredefs, mathlibs)
moredefs.extend(cocache.check_ieee_macros(config_cmd)[0])
moredefs.extend(cocache.check_complex(config_cmd, mathlibs)[0])
# Signal check
if is_npy_no_signal():
moredefs.append('__NPY_PRIVATE_NO_SIGNAL')
# Windows checks
if sys.platform=='win32' or os.name=='nt':
win32_checks(moredefs)
# Inline check
inline = config_cmd.check_inline()
# Check whether we need our own wide character support
if not config_cmd.check_decl('Py_UNICODE_WIDE', headers=['Python.h']):
PYTHON_HAS_UNICODE_WIDE = True
else:
PYTHON_HAS_UNICODE_WIDE = False
if ENABLE_SEPARATE_COMPILATION:
moredefs.append(('ENABLE_SEPARATE_COMPILATION', 1))
# Get long double representation
if sys.platform != 'darwin':
rep = check_long_double_representation(config_cmd)
if rep in ['INTEL_EXTENDED_12_BYTES_LE',
'INTEL_EXTENDED_16_BYTES_LE',
'MOTOROLA_EXTENDED_12_BYTES_BE',
'IEEE_QUAD_LE', 'IEEE_QUAD_BE',
'IEEE_DOUBLE_LE', 'IEEE_DOUBLE_BE',
'DOUBLE_DOUBLE_BE']:
moredefs.append(('HAVE_LDOUBLE_%s' % rep, 1))
else:
raise ValueError("Unrecognized long double format: %s" % rep)
# Py3K check
if sys.version_info[0] == 3:
moredefs.append(('NPY_PY3K', 1))
# Generate the config.h file from moredefs
target_f = open(target, 'w')
for d in moredefs:
if isinstance(d,str):
target_f.write('#define %s\n' % (d))
else:
target_f.write('#define %s %s\n' % (d[0],d[1]))
# define inline to our keyword, or nothing
target_f.write('#ifndef __cplusplus\n')
if inline == 'inline':
target_f.write('/* #undef inline */\n')
else:
target_f.write('#define inline %s\n' % inline)
target_f.write('#endif\n')
# add the guard to make sure config.h is never included directly,
#.........这里部分代码省略.........
开发者ID:sorcerer-com,项目名称:MyHome,代码行数:101,代码来源:setup.py
示例4: configuration
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration, dot_join
from numpy.distutils.system_info import get_info
config = Configuration('core', parent_package, top_path)
local_dir = config.local_path
codegen_dir = join(local_dir, 'code_generators')
if is_released(config):
warnings.simplefilter('error', MismatchCAPIWarning)
# Check whether we have a mismatch between the set C API VERSION and the
# actual C API VERSION
check_api_version(C_API_VERSION, codegen_dir)
generate_umath_py = join(codegen_dir, 'generate_umath.py')
n = dot_join(config.name, 'generate_umath')
generate_umath = npy_load_module('_'.join(n.split('.')),
generate_umath_py, ('.py', 'U', 1))
header_dir = 'include/numpy' # this is relative to config.path_in_package
cocache = CallOnceOnly()
def generate_config_h(ext, build_dir):
target = join(build_dir, header_dir, 'config.h')
d = os.path.dirname(target)
if not os.path.exists(d):
os.makedirs(d)
if newer(__file__, target):
config_cmd = config.get_config_cmd()
log.info('Generating %s', target)
# Check sizeof
moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
# Check math library and C99 math funcs availability
mathlibs = check_mathlib(config_cmd)
moredefs.append(('MATHLIB', ','.join(mathlibs)))
check_math_capabilities(config_cmd, moredefs, mathlibs)
moredefs.extend(cocache.check_ieee_macros(config_cmd)[0])
moredefs.extend(cocache.check_complex(config_cmd, mathlibs)[0])
# Signal check
if is_npy_no_signal():
moredefs.append('__NPY_PRIVATE_NO_SIGNAL')
# Windows checks
if sys.platform == 'win32' or os.name == 'nt':
win32_checks(moredefs)
# C99 restrict keyword
moredefs.append(('NPY_RESTRICT', config_cmd.check_restrict()))
# Inline check
inline = config_cmd.check_inline()
# Use relaxed stride checking
if NPY_RELAXED_STRIDES_CHECKING:
moredefs.append(('NPY_RELAXED_STRIDES_CHECKING', 1))
# Use bogus stride debug aid when relaxed strides are enabled
if NPY_RELAXED_STRIDES_DEBUG:
moredefs.append(('NPY_RELAXED_STRIDES_DEBUG', 1))
# Get long double representation
if sys.platform != 'darwin':
rep = check_long_double_representation(config_cmd)
if rep in ['INTEL_EXTENDED_12_BYTES_LE',
'INTEL_EXTENDED_16_BYTES_LE',
'MOTOROLA_EXTENDED_12_BYTES_BE',
'IEEE_QUAD_LE', 'IEEE_QUAD_BE',
'IEEE_DOUBLE_LE', 'IEEE_DOUBLE_BE',
'DOUBLE_DOUBLE_BE', 'DOUBLE_DOUBLE_LE']:
moredefs.append(('HAVE_LDOUBLE_%s' % rep, 1))
else:
raise ValueError("Unrecognized long double format: %s" % rep)
# Py3K check
if sys.version_info[0] == 3:
moredefs.append(('NPY_PY3K', 1))
# Generate the config.h file from moredefs
target_f = open(target, 'w')
for d in moredefs:
if isinstance(d, str):
target_f.write('#define %s\n' % (d))
else:
target_f.write('#define %s %s\n' % (d[0], d[1]))
# define inline to our keyword, or nothing
target_f.write('#ifndef __cplusplus\n')
if inline == 'inline':
target_f.write('/* #undef inline */\n')
else:
target_f.write('#define inline %s\n' % inline)
target_f.write('#endif\n')
#.........这里部分代码省略.........
开发者ID:AlerzDev,项目名称:Brazo-Proyecto-Final,代码行数:101,代码来源:setup.py
示例5: configuration
def configuration(parent_package="", top_path=None):
from numpy.distutils.misc_util import Configuration, dot_join
from numpy.distutils.system_info import get_info, default_lib_dirs
config = Configuration("core", parent_package, top_path)
local_dir = config.local_path
codegen_dir = join(local_dir, "code_generators")
if is_released(config):
warnings.simplefilter("error", MismatchCAPIWarning)
# Check whether we have a mismatch between the set C API VERSION and the
# actual C API VERSION
check_api_version(C_API_VERSION, codegen_dir)
generate_umath_py = join(codegen_dir, "generate_umath.py")
n = dot_join(config.name, "generate_umath")
generate_umath = imp.load_module(
"_".join(n.split(".")), open(generate_umath_py, "U"), generate_umath_py, (".py", "U", 1)
)
header_dir = "include/numpy" # this is relative to config.path_in_package
cocache = CallOnceOnly()
def generate_config_h(ext, build_dir):
target = join(build_dir, header_dir, "config.h")
d = os.path.dirname(target)
if not os.path.exists(d):
os.makedirs(d)
if newer(__file__, target):
config_cmd = config.get_config_cmd()
log.info("Generating %s", target)
# Check that the toolchain works, to fail early if it doesn't
# (avoid late errors with MATHLIB which are confusing if the
# compiler does not work).
config_cmd.try_link("int main(void) { return 0;}")
# Check sizeof
moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
# Check math library and C99 math funcs availability
mathlibs = check_mathlib(config_cmd)
moredefs.append(("MATHLIB", ",".join(mathlibs)))
check_math_capabilities(config_cmd, moredefs, mathlibs)
moredefs.extend(cocache.check_ieee_macros(config_cmd)[0])
# Signal check
if is_npy_no_signal():
moredefs.append("__NPY_PRIVATE_NO_SIGNAL")
# Windows checks
if sys.platform == "win32" or os.name == "nt":
win32_checks(moredefs)
# Inline check
inline = config_cmd.check_inline()
# Check whether we need our own wide character support
if not config_cmd.check_decl("Py_UNICODE_WIDE", headers=["Python.h"]):
PYTHON_HAS_UNICODE_WIDE = True
else:
PYTHON_HAS_UNICODE_WIDE = False
if ENABLE_SEPARATE_COMPILATION:
moredefs.append(("ENABLE_SEPARATE_COMPILATION", 1))
# Generate the config.h file from moredefs
target_f = open(target, "w")
for d in moredefs:
if isinstance(d, str):
target_f.write("#define %s\n" % (d))
else:
target_f.write("#define %s %s\n" % (d[0], d[1]))
# define inline to our keyword, or nothing
target_f.write("#ifndef __cplusplus\n")
if inline == "inline":
target_f.write("/* #undef inline */\n")
else:
target_f.write("#define inline %s\n" % inline)
target_f.write("#endif\n")
target_f.close()
print "File:", target
target_f = open(target)
print target_f.read()
target_f.close()
print "EOF"
else:
mathlibs = []
target_f = open(target)
for line in target_f.readlines():
s = "#define MATHLIB"
if line.startswith(s):
value = line[len(s) :].strip()
if value:
#.........这里部分代码省略.........
开发者ID:chadnetzer,项目名称:numpy-gaurdro,代码行数:101,代码来源:setup.py
示例6: configuration
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration,dot_join
from numpy.distutils.system_info import get_info, default_lib_dirs
config = Configuration('core',parent_package,top_path)
local_dir = config.local_path
codegen_dir = join(local_dir,'code_generators')
generate_umath_py = join(codegen_dir,'generate_umath.py')
n = dot_join(config.name,'generate_umath')
generate_umath = imp.load_module('_'.join(n.split('.')),
open(generate_umath_py,'U'),generate_umath_py,
('.py','U',1))
header_dir = 'include/numpy' # this is relative to config.path_in_package
def generate_config_h(ext, build_dir):
target = join(build_dir,header_dir,'config.h')
dir = os.path.dirname(target)
if not os.path.exists(dir):
os.makedirs(dir)
if newer(__file__,target):
config_cmd = config.get_config_cmd()
log.info('Generating %s',target)
tc = generate_testcode(target)
from distutils import sysconfig
python_include = sysconfig.get_python_inc()
python_h = join(python_include, 'Python.h')
if not os.path.isfile(python_h):
raise SystemError,\
"Non-existing %s. Perhaps you need to install"\
" python-dev|python-devel." % (python_h)
result = config_cmd.try_run(tc,include_dirs=[python_include],
library_dirs = default_lib_dirs)
if not result:
raise SystemError,"Failed to test configuration. "\
"See previous error messages for more information."
moredefs = []
#
mathlibs = []
tc = testcode_mathlib()
mathlibs_choices = [[],['m'],['cpml']]
mathlib = os.environ.get('MATHLIB')
if mathlib:
mathlibs_choices.insert(0,mathlib.split(','))
for libs in mathlibs_choices:
if config_cmd.try_run(tc,libraries=libs):
mathlibs = libs
break
else:
raise EnvironmentError("math library missing; rerun "
"setup.py after setting the "
"MATHLIB env variable")
ext.libraries.extend(mathlibs)
moredefs.append(('MATHLIB',','.join(mathlibs)))
def check_func(func_name):
return config_cmd.check_func(func_name,
libraries=mathlibs, decl=False,
headers=['math.h'])
for func_name, defsymbol in FUNCTIONS_TO_CHECK:
if check_func(func_name):
moredefs.append(defsymbol)
if is_npy_no_signal():
moredefs.append('__NPY_PRIVATE_NO_SIGNAL')
if sys.platform=='win32' or os.name=='nt':
from numpy.distutils.misc_util import get_build_architecture
a = get_build_architecture()
print 'BUILD_ARCHITECTURE: %r, os.name=%r, sys.platform=%r' % (a, os.name, sys.platform)
if a == 'AMD64':
moredefs.append('DISTUTILS_USE_SDK')
if sys.version[:3] < '2.4':
if config_cmd.check_func('strtod', decl=False,
headers=['stdlib.h']):
moredefs.append(('PyOS_ascii_strtod', 'strtod'))
target_f = open(target,'a')
for d in moredefs:
if isinstance(d,str):
target_f.write('#define %s\n' % (d))
else:
target_f.write('#define %s %s\n' % (d[0],d[1]))
target_f.close()
cmd_ = 'ed - %s < /SourceCache/python_modules/python_modules-21/numpy/config.h.ed' % target
print cmd_
os.system(cmd_)
print 'File:',target
target_f = open(target)
print target_f.read()
target_f.close()
print 'EOF'
else:
mathlibs = []
target_f = open(target)
for line in target_f.readlines():
#.........这里部分代码省略.........
开发者ID:The-Franklin-Institute,项目名称:ARIEL_Builder,代码行数:101,代码来源:setup.py
示例7: configuration
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration,dot_join
from numpy.distutils.system_info import get_info, default_lib_dirs
config = Configuration('core',parent_package,top_path)
local_dir = config.local_path
codegen_dir = join(local_dir,'code_generators')
generate_umath_py = join(codegen_dir,'generate_umath.py')
n = dot_join(config.name,'generate_umath')
generate_umath = imp.load_module('_'.join(n.split('.')),
open(generate_umath_py,'U'),generate_umath_py,
('.py','U',1))
header_dir = 'include/numpy' # this is relative to config.path_in_package
cocache = CallOnceOnly()
def generate_config_h(ext, build_dir):
target = join(build_dir,header_dir,'config.h')
d = os.path.dirname(target)
if not os.path.exists(d):
os.makedirs(d)
if newer(__file__,target):
config_cmd = config.get_config_cmd()
log.info('Generating %s',target)
# Check sizeof
moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
# Check math library and C99 math funcs availability
mathlibs = check_mathlib(config_cmd)
moredefs.append(('MATHLIB',','.join(mathlibs)))
check_math_capabilities(config_cmd, moredefs, mathlibs)
moredefs.extend(cocache.check_ieee_macros(config_cmd)[0])
# Signal check
if is_npy_no_signal():
moredefs.append('__NPY_PRIVATE_NO_SIGNAL')
# Windows checks
if sys.platform=='win32' or os.name=='nt':
win32_checks(moredefs)
# Inline check
inline = config_cmd.check_inline()
# Generate the config.h file from moredefs
target_f = open(target,'a')
for d in moredefs:
if isinstance(d,str):
target_f.write('#define %s\n' % (d))
else:
target_f.write('#define %s %s\n' % (d[0],d[1]))
# define inline to our keyword, or nothing
target_f.write('#ifndef __cplusplus\n')
if inline == 'inline':
target_f.write('/* #undef inline */\n')
else:
target_f.write('#define inline %s\n' % inline)
target_f.write('#endif\n')
target_f.close()
print 'File:',target
target_f = open(target)
print target_f.read()
target_f.close()
print 'EOF'
else:
mathlibs = []
target_f = open(target)
for line in target_f.readlines():
s = '#define MATHLIB'
if line.startswith(s):
value = line[len(s):].strip()
if value:
mathlibs.extend(value.split(','))
target_f.close()
# Ugly: this can be called within a library and not an extension,
# in which case there is no libraries attributes (and none is
# needed).
if hasattr(ext, 'libraries'):
ext.libraries.extend(mathlibs)
incl_dir = os.path.dirname(target)
if incl_dir not in config.numpy_include_dirs:
config.numpy_include_dirs.append(incl_dir)
return target
def generate_numpyconfig_h(ext, build_dir):
"""Depends on config.h: generate_config_h has to be called before !"""
target = join(build_dir,header_dir,'numpyconfig.h')
d = os.path.dirname(target)
if not os.path.exists(d):
os.makedirs(d)
if newer(__file__,target):
#.........这里部分代码省略.........
开发者ID:greenday0925,项目名称:distnumpy,代码行数:101,代码来源:setup.py
示例8: configuration
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration,dot_join
from numpy.distutils.system_info import get_info, default_lib_dirs
config = Configuration('core',parent_package,top_path)
local_dir = config.local_path
codegen_dir = join(local_dir,'code_generators')
generate_umath_py = join(codegen_dir,'generate_umath.py')
n = dot_join(config.name,'generate_umath')
generate_umath = imp.load_module('_'.join(n.split('.')),
open(generate_umath_py,'U'),generate_umath_py,
('.py','U',1))
header_dir = 'include/numpy' # this is relative to config.path_in_package
def generate_config_h(ext, build_dir):
target = join(build_dir,'config.h')
if newer(__file__,target):
config_cmd = config.get_config_cmd()
print 'Generating',target
#
tc = generate_testcode(target)
from distutils import sysconfig
python_include = sysconfig.get_python_inc()
python_h = join(python_include, 'Python.h')
if not os.path.isfile(python_h):
raise SystemError,\
"Non-existing %s. Perhaps you need to install"\
" python-dev|python-devel." % (python_h)
result = config_cmd.try_run(tc,include_dirs=[python_include],
library_dirs = default_lib_dirs)
if not result:
raise SystemError,"Failed to test configuration. "\
"See previous error messages for more information."
# Python 2.3 causes a segfault when
# trying to re-acquire the thread-state
# which is done in error-handling
# ufunc code. NPY_ALLOW_C_API and friends
# cause the segfault. So, we disable threading
# for now.
if sys.version[:5] < '2.4.2':
nosmp = 1
else:
# Perhaps a fancier check is in order here.
# so that threads are only enabled if there
# are actually multiple CPUS? -- but
# threaded code can be nice even on a single
# CPU so that long-calculating code doesn't
# block.
try:
nosmp = os.environ['NPY_NOSMP']
nosmp = 1
except KeyError:
nosmp = 0
if nosmp: moredefs = [('NPY_ALLOW_THREADS', '0')]
else: moredefs = []
#
mathlibs = []
tc = testcode_mathlib()
mathlibs_choices = [[],['m'],['cpml']]
mathlib = os.environ.get('MATHLIB')
if mathlib:
mathlibs_choices.insert(0,mathlib.split(','))
for libs in mathlibs_choices:
if config_cmd.try_run(tc,libraries=libs):
mathlibs = libs
break
else:
raise EnvironmentError("math library missing; rerun "
"setup.py after setting the "
"MATHLIB env variable")
ext.libraries.extend(mathlibs)
moredefs.append(('MATHLIB',','.join(mathlibs)))
def check_func(func_name):
return config_cmd.check_func(func_name,
libraries=mathlibs, decl=False,
headers=['math.h'])
for func_name, defsymbol in FUNCTIONS_TO_CHECK:
if check_func(func_name):
moredefs.append(defsymbol)
if sys.platform == 'win32':
moredefs.append('NPY_NO_SIGNAL')
if sys.version[:3] < '2.4':
if config_cmd.check_func('strtod', decl=False,
headers=['stdlib.h']):
moredefs.append(('PyOS_ascii_strtod', 'strtod'))
target_f = open(target,'a')
for d in moredefs:
if isinstance(d,str):
target_f.write('#define %s\n' % (d))
else:
target_f.write('#define %s %s\n' % (d[0],d[1]))
if not nosmp: # default is to use WITH_THREAD
#.........这里部分代码省略.........
开发者ID:radical-software,项目名称:radicalspam,代码行数:101,代码来源:setup.py
示例9: configuration
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration,dot_join
from numpy.distutils.system_info import get_info, default_lib_dirs
config = Configuration('core', parent_package, top_path)
local_dir = config.local_path
codegen_dir = join(local_dir, 'code_generators')
if is_released(config):
warnings.simplefilter('error', MismatchCAPIWarning)
generate_umath_py = join(codegen_dir, 'generate_umath.py')
n = dot_join(config.name, 'generate_umath')
generate_umath = imp.load_module('_'.join(n.split('.')),
open(generate_umath_py,'U'),
generate_umath_py,
('.py','U',1))
header_dir = 'include/numpy' # this is relative to config.path_in_package
def generate_config_h(ext, build_dir):
target = join(build_dir,header_dir,'config.h')
d = dirname(target)
if not exists(d):
os.makedirs(d)
if newer(__file__,target):
config_cmd = config.get_config_cmd()
log.info('Generating %s',target)
moredefs = []
# Check math library and C99 math funcs availability
mathlibs = check_mathlib(config_cmd)
moredefs.append(('MATHLIB',','.join(mathlibs)))
# Signal check
if is_npy_no_signal():
moredefs.append('__NPY_PRIVATE_NO_SIGNAL')
# Windows checks
if sys.platform=='win32' or os.name=='nt':
win32_checks(moredefs)
# Inline check
inline = config_cmd.check_inline()
# Check whether we need our own wide character support
if not config_cmd.check_decl('Py_UNICODE_WIDE',
headers=['Python.h']):
PYTHON_HAS_UNICODE_WIDE = True
else:
PYTHON_HAS_UNICODE_WIDE = False
# Py3K check
if sys.version_info[0] == 3:
moredefs.append(('NPY_PY3K', 1))
# Generate the config.h file from moredefs
target_f = open(target, 'w')
for d in moredefs:
if isinstance(d,str):
target_f.write('#define %s\n' % (d))
else:
target_f.write('#define %s %s\n' % (d[0],d[1]))
# define inline to our keyword, or nothing
target_f.write('#ifndef __cplusplus\n')
if inline == 'inline':
target_f.write('/* #undef inline */\n')
else:
target_f.write('#define inline %s\n' % inline)
target_f.write('#endif\n')
# add the guard to make sure config.h is never included directly,
# but always through numpy_config.h
target_f.write("""
#ifndef _NUMPY_CONFIG_H_
#error config.h should never be included directly, include numpy_config.h instead
#endif
""")
target_f.close()
print('File:',target)
target_f = open(target)
print(target_f.read())
target_f.close()
print('EOF')
else:
mathlibs = []
target_f = open(target)
for line in target_f.readlines():
s = '#define MATHLIB'
if line.startswith(s):
value = line[len(s):].strip()
if value:
mathlibs.extend(value.split(','))
target_f.close()
# Ugly: this can be called within a library and not an extension,
# in which case there is no libraries attributes (and none is
#.........这里部分代码省略.........
开发者ID:258073127,项目名称:MissionPlanner,代码行数:101,代码来源:setup.py
注:本文中的numpy.distutils.misc_util.dot_join函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论