aarch64: ubuntu build support (#29171)

* Add support for aarch64 pc linux

* Add new libyuv path to release files

* Add libyuv's x86_64 lib dir

* Move left-over platform specific dirs from files_common

* Remove libyuv/lib directory (duplicate)

* Fix mpc Sconscripts

* Remove acados lib path from mpc sources

* Fix typo

* Add watch3 exec on aarch64
old-commit-hash: c640429406c8925b3cce9d979cee880a90fd79c3
This commit is contained in:
Kacper Rączy
2023-08-02 01:18:46 +02:00
committed by GitHub
parent 2c5cbd6fc0
commit edc31db6df
15 changed files with 34 additions and 30 deletions

View File

@@ -64,13 +64,18 @@ AddOption('--no-test',
default=os.path.islink(Dir('#laika/').abspath),
help='skip building test files')
## Architecture name breakdown (arch)
## - larch64: linux tici aarch64
## - aarch64: linux pc aarch64
## - x86_64: linux pc x64
## - Darwin: mac x64 or arm64
real_arch = arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
if platform.system() == "Darwin":
arch = "Darwin"
brew_prefix = subprocess.check_output(['brew', '--prefix'], encoding='utf8').strip()
if arch == "aarch64" and AGNOS:
elif arch == "aarch64" and AGNOS:
arch = "larch64"
assert arch in ["larch64", "aarch64", "x86_64", "Darwin"]
lenv = {
"PATH": os.environ['PATH'],
@@ -132,21 +137,25 @@ else:
f"{brew_prefix}/opt/openssl@3.0/include",
]
lenv["DYLD_LIBRARY_PATH"] = lenv["LD_LIBRARY_PATH"]
# Linux 86_64
# Linux
else:
libpath = [
"#third_party/acados/x86_64/lib",
"#third_party/snpe/x86_64-linux-clang",
"#third_party/libyuv/x64/lib",
"#third_party/mapbox-gl-native-qt/x86_64",
f"#third_party/acados/{arch}/lib",
f"#third_party/libyuv/{arch}/lib",
f"#third_party/mapbox-gl-native-qt/{arch}",
"#cereal",
"#common",
"/usr/lib",
"/usr/local/lib",
]
rpath += [
Dir("#third_party/snpe/x86_64-linux-clang").abspath,
]
if arch == "x86_64":
libpath += [
f"#third_party/snpe/{arch}"
]
rpath += [
Dir(f"#third_party/snpe/{arch}").abspath,
]
if GetOption('asan'):
ccflags = ["-fsanitize=address", "-fno-omit-frame-pointer"]
@@ -267,9 +276,6 @@ envCython["CCFLAGS"].remove("-Werror")
envCython["LIBS"] = []
if arch == "Darwin":
envCython["LINKFLAGS"] = ["-bundle", "-undefined", "dynamic_lookup"] + darwin_rpath_link_flags
elif arch == "aarch64":
envCython["LINKFLAGS"] = ["-shared"]
envCython["LIBS"] = [os.path.basename(py_include)]
else:
envCython["LINKFLAGS"] = ["-pthread", "-shared"]

View File

@@ -432,15 +432,11 @@ third_party/kaitai/*.h
third_party/kaitai/*.cpp
third_party/libyuv/include/**
third_party/libyuv/lib/**
third_party/libyuv/larch64/**
third_party/snpe/include/**
third_party/snpe/dsp**
third_party/acados/.gitignore
third_party/acados/x86_64/**
third_party/acados/larch64/**
third_party/acados/include/**
third_party/acados/acados_template/**

View File

@@ -2,6 +2,7 @@ selfdrive/modeld/runners/onnx*
third_party/mapbox-gl-native-qt/x86_64/*.so
third_party/libyuv/x64/**
third_party/libyuv/x86_64/**
third_party/snpe/x86_64/**
third_party/snpe/x86_64-linux-clang/**
third_party/acados/x86_64/**

View File

@@ -1,6 +1,8 @@
third_party/libyuv/larch64/**
third_party/snpe/larch64**
third_party/snpe/aarch64-ubuntu-gcc7.5/*
third_party/mapbox-gl-native-qt/include/*
third_party/acados/larch64/**
system/timezoned.py

View File

@@ -49,8 +49,6 @@ acados_templates_dir = '#third_party/acados/acados_template/c_templates_tera'
source_list = ['lat_mpc.py',
'#/selfdrive/modeld/constants.py',
f'{acados_dir}/include/acados_c/ocp_nlp_interface.h',
f'{acados_dir}/x86_64/lib/libacados.so',
f'{acados_dir}/larch64/lib/libacados.so',
f'{acados_templates_dir}/acados_solver.in.c',
]

View File

@@ -56,8 +56,6 @@ acados_templates_dir = '#third_party/acados/acados_template/c_templates_tera'
source_list = ['long_mpc.py',
'#/selfdrive/modeld/constants.py',
f'{acados_dir}/include/acados_c/ocp_nlp_interface.h',
f'{acados_dir}/x86_64/lib/libacados.so',
f'{acados_dir}/larch64/lib/libacados.so',
f'{acados_templates_dir}/acados_solver.in.c',
]

View File

@@ -55,7 +55,8 @@ else:
del libs[libs.index('OpenCL')]
lenv['FRAMEWORKS'] = ['OpenCL']
# no SNPE on Mac
if arch == "Darwin" or arch == "aarch64":
# no SNPE on Mac and ARM Linux
del libs[libs.index('SNPE')]
del common_src[common_src.index('runners/snpemodel.cc')]

View File

@@ -6,7 +6,7 @@ libs = ['qt_widgets', 'qt_util', 'qmapboxgl', common, messaging, cereal, visioni
if arch == 'larch64':
libs.append('EGL')
if arch in ['larch64', 'x86_64']:
if arch in ['larch64', 'aarch64', 'x86_64']:
if arch == 'x86_64':
rpath = Dir(f"#third_party/mapbox-gl-native-qt/{arch}").srcnode().abspath
map_env["RPATH"] += [rpath, ]

View File

@@ -9,9 +9,9 @@ base_libs = [common, messaging, cereal, visionipc, transformations, 'zmq',
if arch == 'larch64':
base_libs.append('EGL')
maps = arch in ['larch64', 'x86_64']
maps = arch in ['larch64', 'aarch64', 'x86_64']
if maps and arch == 'x86_64':
if maps and arch != 'larch64':
rpath = [Dir(f"#third_party/mapbox-gl-native-qt/{arch}").srcnode().abspath]
qt_env["RPATH"] += rpath
@@ -131,5 +131,5 @@ if GetOption('extras'):
assert f[0].get_size() < 300*1e3
# build watch3
if arch in ['x86_64', 'Darwin'] or GetOption('extras'):
if arch in ['x86_64', 'aarch64', 'Darwin'] or GetOption('extras'):
qt_env.Program("watch3", ["watch3.cc"], LIBS=qt_libs + ['common', 'json11', 'zmq', 'visionipc', 'messaging'])

1
third_party/acados/aarch64 vendored Symbolic link
View File

@@ -0,0 +1 @@
larch64/

1
third_party/libyuv/aarch64 vendored Symbolic link
View File

@@ -0,0 +1 @@
larch64/

Binary file not shown.

Binary file not shown.