Skip to content

Commit 0941840

Browse files
committed
res
1 parent 9a8a5ff commit 0941840

File tree

1 file changed

+0
-95
lines changed

1 file changed

+0
-95
lines changed

SConstruct

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ Decider('MD5-timestamp')
1515

1616
SetOption('num_jobs', max(1, int(os.cpu_count()/2)))
1717

18-
AddOption('--kaitai', action='store_true', help='Regenerate kaitai struct parsers')
19-
AddOption('--asan', action='store_true', help='turn on ASAN')
20-
AddOption('--ubsan', action='store_true', help='turn on UBSan')
21-
AddOption('--mutation', action='store_true', help='generate mutation-ready code')
22-
AddOption('--ccflags', action='store', type='string', default='', help='pass arbitrary flags over the command line')
2318
AddOption('--kaitai', action='store_true', help='Regenerate kaitai struct parsers')
2419
AddOption('--asan', action='store_true', help='turn on ASAN')
2520
AddOption('--ubsan', action='store_true', help='turn on UBSan')
@@ -31,14 +26,11 @@ AddOption('--minimal',
3126
default=os.path.exists(File('#.lfsconfig').abspath), # minimal by default on release branch (where there's no LFS)
3227
help='the minimum build to run openpilot. no tests, tools, etc.')
3328

34-
# Detect platform
35-
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
3629
# Detect platform
3730
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
3831
if platform.system() == "Darwin":
3932
arch = "Darwin"
4033
brew_prefix = subprocess.check_output(['brew', '--prefix'], encoding='utf8').strip()
41-
elif arch == "aarch64" and os.path.isfile('/TICI'):
4234
elif arch == "aarch64" and os.path.isfile('/TICI'):
4335
arch = "larch64"
4436
assert arch in [
@@ -47,23 +39,7 @@ assert arch in [
4739
"x86_64", # linux pc x64
4840
"Darwin", # macOS arm64 (x86 not supported)
4941
]
50-
assert arch in [
51-
"larch64", # linux tici arm64
52-
"aarch64", # linux pc arm64
53-
"x86_64", # linux pc x64
54-
"Darwin", # macOS arm64 (x86 not supported)
55-
]
5642

57-
env = Environment(
58-
ENV={
59-
"PATH": os.environ['PATH'],
60-
"PYTHONPATH": Dir("#").abspath + ':' + Dir(f"#third_party/acados").abspath,
61-
"ACADOS_SOURCE_DIR": Dir("#third_party/acados").abspath,
62-
"ACADOS_PYTHON_INTERFACE_PATH": Dir("#third_party/acados/acados_template").abspath,
63-
"TERA_PATH": Dir("#").abspath + f"/third_party/acados/{arch}/t_renderer"
64-
},
65-
CC='clang',
66-
CXX='clang++',
6743
env = Environment(
6844
ENV={
6945
"PATH": os.environ['PATH'],
@@ -89,20 +65,12 @@ env = Environment(
8965
],
9066
CFLAGS=["-std=gnu11"],
9167
CXXFLAGS=["-std=c++1z"],
92-
CPPPATH=[
93-
],
94-
CFLAGS=["-std=gnu11"],
95-
CXXFLAGS=["-std=c++1z"],
9668
CPPPATH=[
9769
"#",
9870
"#msgq",
9971
"#third_party",
10072
"#third_party/json11",
10173
"#third_party/linux/include",
102-
"#msgq",
103-
"#third_party",
104-
"#third_party/json11",
105-
"#third_party/linux/include",
10674
"#third_party/acados/include",
10775
"#third_party/acados/include/blasfeo/include",
10876
"#third_party/acados/include/hpipm/include",
@@ -120,65 +88,15 @@ env = Environment(
12088
"#rednose/helpers",
12189
f"#third_party/libyuv/{arch}/lib",
12290
f"#third_party/acados/{arch}/lib",
123-
f"#third_party/libyuv/{arch}/lib",
124-
f"#third_party/acados/{arch}/lib",
12591
],
12692
RPATH=[],
127-
RPATH=[],
12893
CYTHONCFILESUFFIX=".cpp",
12994
COMPILATIONDB_USE_ABSPATH=True,
13095
REDNOSE_ROOT="#",
13196
tools=["default", "cython", "compilation_db", "rednose_filter"],
13297
toolpath=["#site_scons/site_tools", "#rednose_repo/site_scons/site_tools"],
13398
)
13499

135-
# Arch-specific flags and paths
136-
if arch == "larch64":
137-
env.Append(CPPPATH=["#third_party/opencl/include"])
138-
env.Append(LIBPATH=[
139-
"/usr/local/lib",
140-
"/system/vendor/lib64",
141-
"/usr/lib/aarch64-linux-gnu",
142-
])
143-
arch_flags = ["-D__TICI__", "-mcpu=cortex-a57"]
144-
env.Append(CCFLAGS=arch_flags)
145-
env.Append(CXXFLAGS=arch_flags)
146-
elif arch == "Darwin":
147-
env.Append(LIBPATH=[
148-
f"{brew_prefix}/lib",
149-
f"{brew_prefix}/opt/[email protected]/lib",
150-
f"{brew_prefix}/opt/llvm/lib/c++",
151-
"/System/Library/Frameworks/OpenGL.framework/Libraries",
152-
])
153-
env.Append(CCFLAGS=["-DGL_SILENCE_DEPRECATION"])
154-
env.Append(CXXFLAGS=["-DGL_SILENCE_DEPRECATION"])
155-
env.Append(CPPPATH=[
156-
f"{brew_prefix}/include",
157-
f"{brew_prefix}/opt/[email protected]/include",
158-
])
159-
else:
160-
env.Append(LIBPATH=[
161-
"/usr/lib",
162-
"/usr/local/lib",
163-
])
164-
165-
# Sanitizers and extra CCFLAGS from CLI
166-
if GetOption('asan'):
167-
env.Append(CCFLAGS=["-fsanitize=address", "-fno-omit-frame-pointer"])
168-
env.Append(LINKFLAGS=["-fsanitize=address"])
169-
elif GetOption('ubsan'):
170-
env.Append(CCFLAGS=["-fsanitize=undefined"])
171-
env.Append(LINKFLAGS=["-fsanitize=undefined"])
172-
173-
_extra_cc = shlex.split(GetOption('ccflags') or '')
174-
if _extra_cc:
175-
env.Append(CCFLAGS=_extra_cc)
176-
177-
# no --as-needed on mac linker
178-
if arch != "Darwin":
179-
env.Append(LINKFLAGS=["-Wl,--as-needed", "-Wl,--no-undefined"])
180-
181-
# progress output
182100
env.AppendUnique(CPPPATH=[panda.INCLUDE_PATH])
183101

184102
# Arch-specific flags and paths
@@ -237,7 +155,6 @@ def progress_function(node):
237155
if os.environ.get('SCONS_PROGRESS'):
238156
Progress(progress_function, interval=node_interval)
239157

240-
# ********** Cython build environment **********
241158
# ********** Cython build environment **********
242159
py_include = sysconfig.get_paths()['include']
243160
envCython = env.Clone()
@@ -248,14 +165,12 @@ envCython["CCFLAGS"].remove("-Werror")
248165
envCython["LIBS"] = []
249166
if arch == "Darwin":
250167
envCython["LINKFLAGS"] = env["LINKFLAGS"] + ["-bundle", "-undefined", "dynamic_lookup"]
251-
envCython["LINKFLAGS"] = env["LINKFLAGS"] + ["-bundle", "-undefined", "dynamic_lookup"]
252168
else:
253169
envCython["LINKFLAGS"] = ["-pthread", "-shared"]
254170

255171
np_version = SCons.Script.Value(np.__version__)
256172
Export('envCython', 'np_version')
257173

258-
# ********** Qt build environment **********
259174
# ********** Qt build environment **********
260175
qt_env = env.Clone()
261176
qt_modules = ["Widgets", "Gui", "Core", "Network", "Concurrent", "DBus", "Xml"]
@@ -313,14 +228,6 @@ cache_dir = '/data/scons_cache' if arch == "larch64" else '/tmp/scons_cache'
313228
CacheDir(cache_dir)
314229
Clean(["."], cache_dir)
315230

316-
# ********** start building stuff **********
317-
Export('env', 'qt_env', 'arch')
318-
319-
# Setup cache dir
320-
cache_dir = '/data/scons_cache' if arch == "larch64" else '/tmp/scons_cache'
321-
CacheDir(cache_dir)
322-
Clean(["."], cache_dir)
323-
324231
# ********** start building stuff **********
325232

326233
# Build common module
@@ -368,5 +275,3 @@ if Dir('#tools/cabana/').exists() and GetOption('extras'):
368275

369276

370277
env.CompilationDatabase('compile_commands.json')
371-
372-
env.CompilationDatabase('compile_commands.json')

0 commit comments

Comments
 (0)