-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathsetup.py
65 lines (52 loc) · 1.77 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
from setuptools import Distribution
import setuptools.command.build_ext as _build_ext
from distutils.core import setup, Extension
import sys
import os
import subprocess
# For running external build
class build_ext(_build_ext.build_ext):
def run(self):
command = ["./build.sh", "-p", sys.executable]
subprocess.check_call(command)
class BinaryDistribution(Distribution):
def has_ext_modules(self):
return True
def main():
os.environ['CC'] = 'g++'
os.environ['CXX'] = 'g++'
pwd = os.path.dirname(os.path.realpath(__file__))
# Path to Eigen might differ, replace path if necessary
CFLAGS = [
'-std=c++11', '-fPIC', '-shared', '-I', '-O3', '-pthread', '-Wall',
'-I/usr/include/eigen3'
]
LDFLAGS = []
LDFLAGS += ['-Xlinker', '-export-dynamic']
LDFLAGS += ['-W','-Wno-undef', '-lstdc++', '-static-libstdc++']
# Link static library libPackageFrenetOptimalTrajectory.a
LDFLAGS += [
'-L' + os.path.join(pwd, 'build'), '-lPackageFrenetOptimalTrajectory'
]
LDFLAGS += [
'-I', '/usr/include/x86_64-linux-gnu/qt5/QtCore', '-l', 'Qt5Core'
]
print("Linker Flag:", LDFLAGS)
module = Extension(
'fot_planner',
sources=['src/FrenetOptimalTrajectory/planner_package.cpp'],
language='C++',
include_dirs=[
'src', 'src/CubicSpline', 'src/Polynomials',
'src/FrenetOptimalTrajectory', 'src/Obstacle', 'src/Car'
],
extra_compile_args=CFLAGS,
extra_link_args=LDFLAGS)
setup(name="fot_planner",
version="1.0.0",
description="FOT Planner",
author="ERDOS Project",
url="https://github.com/erdos-project/",
ext_modules=[module])
if __name__ == "__main__":
main()