Skip to content

Commit 19ee0e4

Browse files
authored
Merge pull request #1 from shawntan/main
setup.py modifications
2 parents 7df2aae + 43ca537 commit 19ee0e4

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

setup.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,27 @@
22
from setuptools import setup, Extension
33
from pathlib import Path
44

5-
PATH_PREFIX = get_path("data")
5+
PATH_PREFIXES = [get_path(p) for p in ['data', 'platlib']]
6+
67
modules = []
8+
include_dirs = [
9+
path
10+
for prefix in PATH_PREFIXES
11+
for path in [
12+
f"{prefix}/include/",
13+
f"{prefix}/include/tbb",
14+
f"{prefix}/pybind11/include"
15+
]
16+
]
17+
718
for code in ["greedy_builder", "greedy_encoder", "pco_tokenizer"]:
819
modules.append(
920
Extension(
10-
code,
21+
f"pcatt.{code}",
1122
extra_compile_args=["-O3", "-std=c++23"],
1223
define_macros=[("MAJOR_VERSION", "0"), ("MINOR_VERSION", "14-beta")],
13-
include_dirs=[f"{PATH_PREFIX}/include/", f"{PATH_PREFIX}/include/tbb"],
14-
library_dirs=[f"{PATH_PREFIX}/lib/"],
24+
include_dirs=include_dirs,
25+
library_dirs=[f"{prefix}/lib/" for prefix in PATH_PREFIXES] ,
1526
libraries=["tbb"],
1627
sources=[f"pcatt/{code}.cpp"],
1728
)

0 commit comments

Comments
 (0)