| 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 |