MCPcopy Create free account
hub / github.com/PyTables/PyTables / compiler_has_flags

Function compiler_has_flags

setup.py:1172–1185  ·  view source on GitHub ↗
(compiler, flags)

Source from the content-addressed store, hash-verified

1170
1171 # Add extra flags for optimizing shuffle in include Blosc
1172 def compiler_has_flags(compiler, flags):
1173 with tempfile.NamedTemporaryFile(
1174 mode="w", suffix=".c", delete=False
1175 ) as fd:
1176 fd.write("int main() {return 0;}")
1177
1178 try:
1179 compiler.compile([fd.name], extra_preargs=flags)
1180 except Exception:
1181 return False
1182 else:
1183 return True
1184 finally:
1185 Path(fd.name).unlink()
1186
1187 # Set flags for SSE2 and AVX2 preventing false detection in case
1188 # of emulation

Callers 1

setup.pyFile · 0.85

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected