mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-21 01:02:48 +08:00
openpilot v0.8.2 release
This commit is contained in:
+35
-12
@@ -3,6 +3,15 @@ lenv = env.Clone()
|
||||
|
||||
libs = [cereal, messaging, common, 'OpenCL', 'SNPE', 'symphony-cpu', 'capnp', 'zmq', 'kj', 'yuv', gpucommon, visionipc]
|
||||
|
||||
def get_dlsym_offset():
|
||||
"""Returns the offset between dlopen and dlsym in libdl.so"""
|
||||
import ctypes
|
||||
libdl = ctypes.PyDLL('libdl.so')
|
||||
dlopen = ctypes.cast(libdl.dlopen, ctypes.c_void_p).value
|
||||
dlsym = ctypes.cast(libdl.dlsym, ctypes.c_void_p).value
|
||||
return dlsym - dlopen
|
||||
|
||||
|
||||
common_src = [
|
||||
"models/commonmodel.cc",
|
||||
"runners/snpemodel.cc",
|
||||
@@ -10,16 +19,20 @@ common_src = [
|
||||
"transforms/transform.cc"
|
||||
]
|
||||
|
||||
if arch == "aarch64":
|
||||
libs += ['gsl', 'CB', 'gnustl_shared']
|
||||
common_src += ["thneed/thneed.cc"]
|
||||
lenv['CFLAGS'].append("-DUSE_THNEED")
|
||||
lenv['CXXFLAGS'].append("-DUSE_THNEED")
|
||||
elif arch == "larch64":
|
||||
libs += ['gsl', 'CB', 'pthread', 'dl']
|
||||
common_src += ["thneed/thneed.cc"]
|
||||
lenv['CFLAGS'].append("-DUSE_THNEED")
|
||||
thneed_src = [
|
||||
"thneed/thneed.cc",
|
||||
"thneed/serialize.cc",
|
||||
"runners/thneedmodel.cc",
|
||||
]
|
||||
|
||||
if arch == "aarch64" or arch == "larch64":
|
||||
libs += ['gsl', 'CB']
|
||||
libs += ['gnustl_shared'] if arch == "aarch64" else ['pthread', 'dl']
|
||||
|
||||
common_src += thneed_src
|
||||
dlsym_offset = get_dlsym_offset()
|
||||
lenv['CXXFLAGS'].append("-DUSE_THNEED")
|
||||
lenv['CXXFLAGS'].append(f"-DDLSYM_OFFSET={dlsym_offset}")
|
||||
else:
|
||||
libs += ['pthread']
|
||||
|
||||
@@ -40,15 +53,25 @@ else:
|
||||
del libs[libs.index('symphony-cpu')]
|
||||
del common_src[common_src.index('runners/snpemodel.cc')]
|
||||
|
||||
common = lenv.Object(common_src)
|
||||
common_model = lenv.Object(common_src)
|
||||
|
||||
|
||||
# build thneed model
|
||||
if arch == "aarch64" or arch == "larch64":
|
||||
compiler = lenv.Program('thneed/compile', ["thneed/compile.cc" ]+common_model, LIBS=libs)
|
||||
cmd = f"cd {Dir('.').abspath} && {compiler[0].abspath} ../../models/supercombo.dlc ../../models/supercombo.thneed --binary"
|
||||
|
||||
lib_paths = ':'.join([Dir(p).abspath for p in lenv["LIBPATH"]])
|
||||
cenv = Environment(ENV={'LD_LIBRARY_PATH': f"{lib_paths}:{lenv['ENV']['LD_LIBRARY_PATH']}"})
|
||||
cenv.Command("../../models/supercombo.thneed", ["../../models/supercombo.dlc", compiler], cmd)
|
||||
|
||||
lenv.Program('_dmonitoringmodeld', [
|
||||
"dmonitoringmodeld.cc",
|
||||
"models/dmonitoring.cc",
|
||||
]+common, LIBS=libs)
|
||||
]+common_model, LIBS=libs)
|
||||
|
||||
lenv.Program('_modeld', [
|
||||
"modeld.cc",
|
||||
"models/driving.cc",
|
||||
]+common, LIBS=libs)
|
||||
]+common_model, LIBS=libs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user