forked from dbekaert/RAiDER
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·47 lines (41 loc) · 1.38 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
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Author: David Bekaert, Jeremy Maurer, and Piyush Agram
# Copyright 2019, by the California Institute of Technology. ALL RIGHTS
# RESERVED. United States Government Sponsorship acknowledged.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import re
from pathlib import Path
import numpy as np
from pybind11.setup_helpers import Pybind11Extension, build_ext
from setuptools import Extension, setup
# Cythonize should be imported after setuptools. See:
# https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html#configuring-the-c-build
from Cython.Build import cythonize # isort:skip
# Parameter defs
UTIL_DIR = Path('tools') / 'bindings' / 'utils'
pybind_extensions = [
Pybind11Extension(
'RAiDER.interpolate',
[
'tools/bindings/interpolate/src/module.cpp',
'tools/bindings/interpolate/src/interpolate.cpp'
],
),
]
cython_extensions = cythonize(
[
Extension(
name="RAiDER.makePoints",
sources=[str(f) for f in UTIL_DIR.glob("*.pyx")],
include_dirs=[np.get_include()]
),
],
quiet=True,
compiler_directives={'language_level': 3}
)
setup(
ext_modules=cython_extensions + pybind_extensions,
cmdclass={"build_ext": build_ext},
)