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

Function have_compiler

numpy/distutils/tests/test_system_info.py:75–95  ·  view source on GitHub ↗

Return True if there appears to be an executable compiler

()

Source from the content-addressed store, hash-verified

73"""
74
75def have_compiler():
76 """ Return True if there appears to be an executable compiler
77 """
78 compiler = customized_ccompiler()
79 try:
80 cmd = compiler.compiler # Unix compilers
81 except AttributeError:
82 try:
83 if not compiler.initialized:
84 compiler.initialize() # MSVC is different
85 except (DistutilsError, ValueError):
86 return False
87 cmd = [compiler.cc]
88 try:
89 p = Popen(cmd, stdout=PIPE, stderr=PIPE)
90 p.stdout.close()
91 p.stderr.close()
92 p.wait()
93 except OSError:
94 return False
95 return True
96
97
98HAVE_COMPILER = have_compiler()

Callers 1

Calls 3

customized_ccompilerFunction · 0.90
initializeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected