-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
30 lines (26 loc) · 790 Bytes
/
setup.py
File metadata and controls
30 lines (26 loc) · 790 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
30
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
import os
import pybind11
# Set EIGEN_INCLUDE_DIR if your system doesn't have it in a default path.
# e.g., export EIGEN_INCLUDE_DIR=/usr/include/eigen3 (Linux)
# set EIGEN_INCLUDE_DIR=C:\path\to\eigen-3.4.0 (Windows)
eigen_dir = os.environ.get("EIGEN_INCLUDE_DIR", "")
include_dirs = [pybind11.get_include()]
if eigen_dir:
include_dirs.append(eigen_dir)
ext_modules = [
Extension(
"admm_core",
sources=["admm_bindings.cpp"],
include_dirs=include_dirs,
extra_compile_args=["-O3", "-std=c++17"],
language="c++",
)
]
setup(
name="admm_core",
version="0.1.0",
ext_modules=ext_modules,
cmdclass={"build_ext": build_ext},
)