MCPcopy Create free account
hub / github.com/numpy/numpy / check_math_capabilities

Function check_math_capabilities

numpy/core/setup.py:141–243  ·  view source on GitHub ↗
(config, ext, moredefs, mathlibs)

Source from the content-addressed store, hash-verified

139 deflist.append('FORCE_NO_LONG_DOUBLE_FORMATTING')
140
141def check_math_capabilities(config, ext, moredefs, mathlibs):
142 def check_func(
143 func_name,
144 decl=False,
145 headers=["feature_detection_math.h", "feature_detection_cmath.h"],
146 ):
147 return config.check_func(
148 func_name,
149 libraries=mathlibs,
150 decl=decl,
151 call=True,
152 call_args=FUNC_CALL_ARGS[func_name],
153 headers=headers,
154 )
155
156 def check_funcs_once(
157 funcs_name,
158 headers=["feature_detection_math.h", "feature_detection_cmath.h"],
159 add_to_moredefs=True):
160 call = dict([(f, True) for f in funcs_name])
161 call_args = dict([(f, FUNC_CALL_ARGS[f]) for f in funcs_name])
162 st = config.check_funcs_once(
163 funcs_name,
164 libraries=mathlibs,
165 decl=False,
166 call=call,
167 call_args=call_args,
168 headers=headers,
169 )
170 if st and add_to_moredefs:
171 moredefs.extend([(fname2def(f), 1) for f in funcs_name])
172 return st
173
174 def check_funcs(
175 funcs_name,
176 headers=["feature_detection_math.h", "feature_detection_cmath.h"]):
177 # Use check_funcs_once first, and if it does not work, test func per
178 # func. Return success only if all the functions are available
179 if not check_funcs_once(funcs_name, headers=headers):
180 # Global check failed, check func per func
181 for f in funcs_name:
182 if check_func(f, headers=headers):
183 moredefs.append((fname2def(f), 1))
184 return 0
185 else:
186 return 1
187
188 #use_msvc = config.check_decl("_MSC_VER")
189 if not check_funcs_once(MANDATORY_FUNCS, add_to_moredefs=False):
190 raise SystemError("One of the required function to build numpy is not"
191 " available (the list is %s)." % str(MANDATORY_FUNCS))
192
193 # Standard functions which may not be available and for which we have a
194 # replacement implementation. Note that some of these are C99 functions.
195
196 # XXX: hack to circumvent cpp pollution from python: python put its
197 # config.h in the public namespace, so we have a clash for the common
198 # functions we test. We remove every function tested by python's

Callers 1

generate_config_hFunction · 0.85

Calls 8

check_funcs_onceFunction · 0.85
fname2defFunction · 0.85
check_funcsFunction · 0.85
check_declMethod · 0.80
check_funcMethod · 0.80
replaceMethod · 0.80

Tested by

no test coverage detected