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

Method _universal_flags

numpy/distutils/fcompiler/gnu.py:316–330  ·  view source on GitHub ↗

Return a list of -arch flags for every supported architecture.

(self, cmd)

Source from the content-addressed store, hash-verified

314 g2c = 'gfortran'
315
316 def _universal_flags(self, cmd):
317 """Return a list of -arch flags for every supported architecture."""
318 if not sys.platform == 'darwin':
319 return []
320 arch_flags = []
321 # get arches the C compiler gets.
322 c_archs = self._c_arch_flags()
323 if "i386" in c_archs:
324 c_archs[c_archs.index("i386")] = "i686"
325 # check the arches the Fortran compiler supports, and compare with
326 # arch flags from C compiler
327 for arch in ["ppc", "i686", "x86_64", "ppc64", "s390x"]:
328 if _can_target(cmd, arch) and arch in c_archs:
329 arch_flags.extend(["-arch", arch])
330 return arch_flags
331
332 def get_flags(self):
333 flags = GnuFCompiler.get_flags(self)

Callers 2

get_flagsMethod · 0.95
get_flags_linker_soMethod · 0.95

Calls 3

_can_targetFunction · 0.85
_c_arch_flagsMethod · 0.80
indexMethod · 0.45

Tested by

no test coverage detected