-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
29 lines (24 loc) · 847 Bytes
/
Copy pathsetup.py
File metadata and controls
29 lines (24 loc) · 847 Bytes
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
import os
import subprocess
from setuptools import setup
from setuptools.command.install import install
class CMakeBuild(install):
def run(self):
build_dir = os.path.abspath("build")
os.makedirs(build_dir, exist_ok=True)
# Run CMake EXACTLY as you do manually
subprocess.check_call(["cmake", "-S", "cmake", "-B", build_dir])
subprocess.check_call(["cmake", "--build", build_dir])
# Ensure tensor.so exists
so_path = os.path.join(build_dir, "tensor.so")
if not os.path.exists(so_path):
raise RuntimeError("ERROR: tensor.so was NOT built! Check CMake output.")
# Proceed with installation
install.run(self)
setup(
name="lumine",
version="0.1",
packages=["lumine"],
include_package_data=True,
cmdclass={"install": CMakeBuild},
)