-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
68 lines (61 loc) · 1.7 KB
/
setup.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import glob
import os
from setuptools import setup, Extension
from Cython.Build import cythonize
import numpy as np
EXTRA_COMPILE_ARGS = []
if os.name == "posix":
EXTRA_COMPILE_ARGS += "-std=c++14".split(" ")
def is_cpp(fname):
return fname.strip()[-4:] == ".cpp"
def walk_all_cpps(root):
cpps = []
for (dirpath, dirname, files) in os.walk(root):
for file_name in files:
if is_cpp(file_name):
cpps.append(os.path.join(dirpath, file_name))
return cpps
def define_extensions(**kwargs):
client_ext = [
Extension(
name="src.env.curling_env",
sources=walk_all_cpps("third_party/Box2D/Box2D") + [
"src/env/curling_env.pyx",
"src/env/CurlingSimulator.cpp"
],
extra_compile_args=EXTRA_COMPILE_ARGS,
libraries=[],
extra_link_args=[],
include_dirs=[
"third_party/Box2D",
],
language="c++"
),
Extension(
name="src.kr_dl_uct.player",
sources=[
"src/kr_dl_uct/player.pyx",
"src/kr_dl_uct/node.cpp",
"src/kr_dl_uct/kde.cpp"
],
extra_compile_args=[],
libraries=[],
extra_link_args=[],
include_dirs=[],
language="c++"
),
]
return cythonize(client_ext)
setup(
# name=NAME,
# version=VERSION,
description="KR-DL-UCT for the game of simulated curling",
author="SAIL",
author_email="leekwoon@unist.ac.kr",
#license="",
install_requires=[
"cython",
],
# keywords="",
ext_modules=define_extensions(),
)