scons: fix multithreaded builds (#29716)

* common_python export

* Single scons call

* transformations_python
old-commit-hash: d138a358eb
beeps
Kacper Rączy 2 years ago committed by GitHub
parent aa247b65aa
commit b580f19448
  1. 3
      SConstruct
  2. 14
      common/SConscript
  3. 4
      common/kalman/SConscript
  4. 5
      common/transformations/SConscript
  5. 4
      selfdrive/controls/lib/longitudinal_mpc_lib/SConscript

@ -417,9 +417,6 @@ SConscript([
SConscript(['third_party/SConscript'])
SConscript(['common/kalman/SConscript'])
SConscript(['common/transformations/SConscript'])
SConscript(['selfdrive/boardd/SConscript'])
SConscript(['selfdrive/controls/lib/lateral_mpc_lib/SConscript'])
SConscript(['selfdrive/controls/lib/longitudinal_mpc_lib/SConscript'])

@ -32,5 +32,15 @@ if GetOption('extras'):
['tests/test_runner.cc', 'tests/test_util.cc', 'tests/test_swaglog.cc', 'tests/test_ratekeeper.cc'],
LIBS=[_common, 'json11', 'zmq', 'pthread'])
# Cython
envCython.Program('params_pyx.so', 'params_pyx.pyx', LIBS=envCython['LIBS'] + [_common, 'zmq', 'json11'])
# Cython bindings
params_python = envCython.Program('params_pyx.so', 'params_pyx.pyx', LIBS=envCython['LIBS'] + [_common, 'zmq', 'json11'])
SConscript([
'kalman/SConscript',
'transformations/SConscript'
])
Import('simple_kalman_python', 'transformations_python')
common_python = [params_python, simple_kalman_python, transformations_python]
Export('common_python')

@ -1,3 +1,5 @@
Import('envCython')
envCython.Program('simple_kalman_impl.so', 'simple_kalman_impl.pyx')
simple_kalman_python = envCython.Program('simple_kalman_impl.so', 'simple_kalman_impl.pyx')
Export('simple_kalman_python')

@ -1,6 +1,5 @@
Import('env', 'envCython')
transformations = env.Library('transformations', ['orientation.cc', 'coordinates.cc'])
Export('transformations')
envCython.Program('transformations.so', 'transformations.pyx')
transformations_python = envCython.Program('transformations.so', 'transformations.pyx')
Export('transformations', 'transformations_python')

@ -1,4 +1,4 @@
Import('env', 'envCython', 'arch', 'messaging_python')
Import('env', 'envCython', 'arch', 'messaging_python', 'common_python')
gen = "c_generated_code"
@ -66,7 +66,7 @@ lenv.Clean(generated_files, Dir(gen))
generated_long = lenv.Command(generated_files,
source_list,
f"cd {Dir('.').abspath} && python3 long_mpc.py")
lenv.Depends(generated_long, messaging_python)
lenv.Depends(generated_long, [messaging_python, common_python])
lenv["CFLAGS"].append("-DACADOS_WITH_QPOASES")
lenv["CXXFLAGS"].append("-DACADOS_WITH_QPOASES")

Loading…
Cancel
Save