forked from syegulalp/conway-2022
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile.py
34 lines (27 loc) · 801 Bytes
/
compile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import sys, os
sys.argv = ["compile.py", "build_ext", "--inplace"]
from setuptools import setup
from setuptools import Extension
from Cython.Build import cythonize
import glob, os
for ff in ("*.c", "*.html"):
for f in glob.glob(ff):
try:
os.remove(f)
except FileNotFoundError:
pass
ext_modules = [
Extension(
"life",
["life.py"],
# Use this line only if you're compiling with MSVC.
extra_compile_args=["/arch:AVX512", "/O2"]
# extra_compile_args=["/O2"]
# arch:AVX2
# arch:AVX512
# Omit /arch:AVX512 line if the module crashes.
# Use /MD for multithread DLL (not implemented yet)
)
]
os.chdir("src")
setup(name="life", ext_modules=cythonize(ext_modules, annotate=True))