Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get build times under 1s #1528

Open
adeebshihadeh opened this issue Nov 26, 2024 · 8 comments · May be fixed by #1529
Open

Get build times under 1s #1528

adeebshihadeh opened this issue Nov 26, 2024 · 8 comments · May be fixed by #1529

Comments

@adeebshihadeh
Copy link
Contributor

adeebshihadeh commented Nov 26, 2024

I have a modern Threadripper with tons of cores - why is building not instant? Is it the Cython? Is it all the C++ regex?

opendbc is a small project, so working in it should feel very snappy and instant. We're open to any changes necessary to get to <1s fresh builds.

It's possible there's one silly thing taking all that time or it's a few things we have to fix. Some notes in #1180.

(opendbc) batman@workstation-adeeb:~/src/opendbc$ echo "int main(void) {return 0;}" > test.c; time g++ test.c

real    0m0.041s
user    0m0.016s
sys     0m0.025s

The goal is to get scons -c && time scons -j40 to report <1s (on my workstation, though it shouldn't be too different on other machines). Here's where we are now:

(opendbc) batman@workstation-adeeb:~/src/opendbc$ scons -j40
Cannot read termcap database;
using dumb terminal settings.
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o opendbc/can/common.os -c -std=c++1z -DDBC_FILE_PATH='"/home/batman/src/opendbc/opendbc/dbc"' -g -fPIC -O2 -Wunused -Werror -Wshadow -Wno-vla-cxx-extension -Wno-unknown-warning-option -fPIC -I. -I/usr/lib/include -I/home/batman/.local/share/uv/python/cpython-3.11.4-linux-x86_64-gnu/include/python3.11 opendbc/can/common.cc
g++ -o opendbc/can/dbc.os -c -std=c++1z -DDBC_FILE_PATH='"/home/batman/src/opendbc/opendbc/dbc"' -g -fPIC -O2 -Wunused -Werror -Wshadow -Wno-vla-cxx-extension -Wno-unknown-warning-option -fPIC -I. -I/usr/lib/include -I/home/batman/.local/share/uv/python/cpython-3.11.4-linux-x86_64-gnu/include/python3.11 opendbc/can/dbc.cc
g++ -o opendbc/can/parser.os -c -std=c++1z -DDBC_FILE_PATH='"/home/batman/src/opendbc/opendbc/dbc"' -g -fPIC -O2 -Wunused -Werror -Wshadow -Wno-vla-cxx-extension -Wno-unknown-warning-option -fPIC -I. -I/usr/lib/include -I/home/batman/.local/share/uv/python/cpython-3.11.4-linux-x86_64-gnu/include/python3.11 opendbc/can/parser.cc
g++ -o opendbc/can/packer.os -c -std=c++1z -DDBC_FILE_PATH='"/home/batman/src/opendbc/opendbc/dbc"' -g -fPIC -O2 -Wunused -Werror -Wshadow -Wno-vla-cxx-extension -Wno-unknown-warning-option -fPIC -I. -I/usr/lib/include -I/home/batman/.local/share/uv/python/cpython-3.11.4-linux-x86_64-gnu/include/python3.11 opendbc/can/packer.cc
cythonize opendbc/can/packer_pyx.pyx
cythonize opendbc/can/parser_pyx.pyx
python3 opendbc/dbc/generator/generator.py
Compiling /home/batman/src/opendbc/opendbc/can/packer_pyx.pyx because it changed.
[1/1] Cythonizing /home/batman/src/opendbc/opendbc/can/packer_pyx.pyx
Compiling /home/batman/src/opendbc/opendbc/can/parser_pyx.pyx because it changed.
[1/1] Cythonizing /home/batman/src/opendbc/opendbc/can/parser_pyx.pyx
g++ -o opendbc/can/packer_pyx.o -c -std=c++1z -g -fPIC -O2 -Wunused -Wshadow -Wno-vla-cxx-extension -Wno-unknown-warning-option -Wno-#warnings -Wno-shadow -Wno-deprecated-declarations -I. -I/usr/lib/include -I/home/batman/.local/share/uv/python/cpython-3.11.4-linux-x86_64-gnu/include/python3.11 -I.venv/lib/python3.11/site-packages/numpy/_core/include opendbc/can/packer_pyx.cpp
g++ -o opendbc/can/parser_pyx.o -c -std=c++1z -g -fPIC -O2 -Wunused -Wshadow -Wno-vla-cxx-extension -Wno-unknown-warning-option -Wno-#warnings -Wno-shadow -Wno-deprecated-declarations -I. -I/usr/lib/include -I/home/batman/.local/share/uv/python/cpython-3.11.4-linux-x86_64-gnu/include/python3.11 -I.venv/lib/python3.11/site-packages/numpy/_core/include opendbc/can/parser_pyx.cpp
g++ -o opendbc/can/libdbc.so -shared opendbc/can/dbc.os opendbc/can/parser.os opendbc/can/packer.os opendbc/can/common.os -Lopendbc/can
g++ -o opendbc/can/parser_pyx.so -pthread -shared -Wl,-rpath=/home/batman/src/opendbc/opendbc/can opendbc/can/parser_pyx.o -Lopendbc/can -Lopendbc/can -ldbc
g++ -o opendbc/can/packer_pyx.so -pthread -shared -Wl,-rpath=/home/batman/src/opendbc/opendbc/can opendbc/can/packer_pyx.o -Lopendbc/can -Lopendbc/can -ldbc
scons: done building targets.
@LouisVelez
Copy link
Contributor

It seems most of the delay is on the build. I would suggest looking into pre-compiling if possible. Hopefully this helps anyone else looking into the issue.

Output of scons -u -j$(nproc) --debug=time on an M2 mac

Total SConsign sync time: 0.002967 seconds
Total build time: 2.888204 seconds
Total SConscript file execution time: 0.216717 seconds
Total SCons execution time: 0.050112 seconds
Total command execution time: 2.621375 seconds

@BBBmau BBBmau linked a pull request Nov 26, 2024 that will close this issue
@andrewchambers
Copy link

andrewchambers commented Nov 30, 2024

@adeebshihadeh it looks like you intended to post the output of time scons or maybe better yet scons --debug=time -j40 but forgot to include the time in your copy paste.

@qedjdev
Copy link

qedjdev commented Dec 5, 2024

It seems most of the delay is on the build. I would suggest looking into pre-compiling if possible

target: a clean build (scons -c && ...) being <1s
precompiled headers still need to be compiled on a clean build. this doesn't save time for this target but it should still (maybe?) be looked into.

for anyone willing to dig through profiling data...

scons -Q --profile build_profile.pstats

import pstats
p = pstats.Stats('build_profile.pstats')
p.sort_stats('cumulative').print_stats()

@Riley-livingston
Copy link

@adeebshihadeh What is your current build time benchmark in seconds on your machine when running scons -c && scons -u -j40 --debug=time ?

I replaced the C++ regex with RE2 and it sped up the build times from clean build quite significantly on my low-end Mac.

@Arjun31415
Copy link

I used ClangBuildAnalyzer and this is what I get -

Analyzing build trace from 'clang_build_analysis.txt'...
**** Time summary:
Compilation (12 times):
  Parsing (frontend):            5.9 s
  Codegen & opts (backend):      8.3 s

**** Files that took longest to parse (compiler frontend):
  1571 ms: opendbc//can/dbc.json
   952 ms: opendbc//can/parser_pyx.o
   756 ms: opendbc//can/packer_pyx.o
   659 ms: opendbc//can/packer.json
   657 ms: opendbc//can/parser.json
   463 ms: opendbc//can/dbc.json
   408 ms: opendbc//can/common.json
   170 ms: opendbc//can/parser_pyx.o
    85 ms: opendbc//can/packer_pyx.o
    82 ms: opendbc//can/parser.json

**** Files that took longest to codegen (compiler backend):
  3773 ms: opendbc//can/dbc.json
  2587 ms: opendbc//can/parser_pyx.o
   980 ms: opendbc//can/packer_pyx.o
   517 ms: opendbc//can/parser.json
   269 ms: opendbc//can/packer.json
   168 ms: opendbc//can/common.json

**** Templates that took longest to instantiate:
   338 ms: std::basic_regex<char>::basic_regex (1 times, avg 338 ms)
   338 ms: std::basic_regex<char>::_M_compile (1 times, avg 338 ms)
   327 ms: std::__detail::_Compiler<std::regex_traits<char>>::_Compiler (1 times, avg 327 ms)
   283 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_disjunction (1 times, avg 283 ms)
   281 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_alternative (1 times, avg 281 ms)
   277 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_term (1 times, avg 277 ms)
   236 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_atom (1 times, avg 236 ms)
    84 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_insert_charact... (1 times, avg 84 ms)
    71 ms: std::regex_match<std::char_traits<char>, std::allocator<char>, std::... (1 times, avg 71 ms)
    71 ms: std::regex_match<__gnu_cxx::__normal_iterator<const char *, std::bas... (1 times, avg 71 ms)
    71 ms: std::__detail::__regex_algo_impl<__gnu_cxx::__normal_iterator<const ... (1 times, avg 71 ms)
    53 ms: std::unordered_map<int, int> (6 times, avg 8 ms)
    44 ms: std::unordered_map<unsigned int, const Msg *> (6 times, avg 7 ms)
    43 ms: std::unordered_map<std::basic_string<char>, const Msg *> (6 times, avg 7 ms)
    42 ms: std::_Hashtable<int, std::pair<const int, int>, std::allocator<std::... (6 times, avg 7 ms)
    39 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_quantifier (1 times, avg 39 ms)
    37 ms: std::_Hashtable<std::basic_string<char>, std::pair<const std::basic_... (6 times, avg 6 ms)
    36 ms: std::__detail::_Executor<__gnu_cxx::__normal_iterator<const char *, ... (1 times, avg 36 ms)
    36 ms: std::__detail::_Executor<__gnu_cxx::__normal_iterator<const char *, ... (1 times, avg 36 ms)
    36 ms: std::__detail::_Executor<__gnu_cxx::__normal_iterator<const char *, ... (1 times, avg 36 ms)
    35 ms: std::unordered_map<unsigned int, MessageState> (6 times, avg 5 ms)
    35 ms: std::_Hashtable<unsigned int, std::pair<const unsigned int, const Ms... (6 times, avg 5 ms)
    31 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_bracket_expres... (1 times, avg 31 ms)
    30 ms: std::_Hashtable<unsigned int, std::pair<const unsigned int, MessageS... (6 times, avg 5 ms)
    28 ms: std::__detail::_StateSeq<std::regex_traits<char>>::_M_clone (1 times, avg 28 ms)
    27 ms: std::vector<Signal>::operator= (3 times, avg 9 ms)
    27 ms: std::__detail::_BracketMatcher<std::regex_traits<char>, false, false... (1 times, avg 27 ms)
    25 ms: std::unordered_map<unsigned int, MessageState>::at (6 times, avg 4 ms)
    25 ms: std::__detail::_Map_base<unsigned int, std::pair<const unsigned int,... (6 times, avg 4 ms)
    24 ms: std::map<std::pair<unsigned int, std::basic_string<char>>, Signal>::... (1 times, avg 24 ms)

**** Template sets that took longest to instantiate:
   338 ms: std::basic_regex<$>::basic_regex (1 times, avg 338 ms)
   338 ms: std::basic_regex<$>::_M_compile (1 times, avg 338 ms)
   327 ms: std::__detail::_Compiler<$>::_Compiler (1 times, avg 327 ms)
   283 ms: std::__detail::_Compiler<$>::_M_disjunction (1 times, avg 283 ms)
   281 ms: std::__detail::_Compiler<$>::_M_alternative (1 times, avg 281 ms)
   277 ms: std::__detail::_Compiler<$>::_M_term (1 times, avg 277 ms)
   236 ms: std::__detail::_Compiler<$>::_M_atom (1 times, avg 236 ms)
   182 ms: std::unordered_map<$> (25 times, avg 7 ms)
   164 ms: std::_Hashtable<$> (31 times, avg 5 ms)
   123 ms: std::__detail::_Compiler<$>::_M_insert_character_class_matcher<$> (4 times, avg 30 ms)
   102 ms: std::__and_<$> (108 times, avg 0 ms)
    95 ms: std::vector<$> (59 times, avg 1 ms)
    94 ms: std::pair<$> (53 times, avg 1 ms)
    77 ms: std::function<$>::function<$> (16 times, avg 4 ms)
    71 ms: std::regex_match<$> (1 times, avg 71 ms)
    71 ms: std::__detail::__regex_algo_impl<$> (1 times, avg 71 ms)
    67 ms: std::basic_string<$> (24 times, avg 2 ms)
    66 ms: std::vector<$>::_M_realloc_append<$> (22 times, avg 3 ms)
    65 ms: std::_Rb_tree<$>::_M_emplace_hint_unique<$> (5 times, avg 13 ms)
    63 ms: std::vector<$>::emplace_back<$> (15 times, avg 4 ms)
    62 ms: std::vector<$>::push_back (16 times, avg 3 ms)
    59 ms: std::map<$> (16 times, avg 3 ms)
    55 ms: std::_Rb_tree<$>::~_Rb_tree (12 times, avg 4 ms)
    54 ms: std::_Rb_tree<$>::_M_erase (12 times, avg 4 ms)
    48 ms: std::_Vector_base<$> (57 times, avg 0 ms)
    44 ms: std::unordered_map<$>::at (10 times, avg 4 ms)
    44 ms: std::__detail::_Executor<$>::_M_match (2 times, avg 22 ms)
    44 ms: std::__detail::_Executor<$>::_M_main (2 times, avg 22 ms)
    44 ms: std::__detail::_Executor<$>::_M_main_dispatch (2 times, avg 22 ms)
    44 ms: std::__detail::_Map_base<$>::at (10 times, avg 4 ms)

**** Functions that took longest to compile:
   359 ms: __pyx_pymod_exec_parser_pyx(_object*) (opendbc/can/parser_pyx.cpp)
   233 ms: dbc_parse_from_stream(std::__cxx11::basic_string<char, std::char_tra... (opendbc/can/dbc.cc)
   203 ms: __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser___init__(__pyx_obj_7o... (opendbc/can/parser_pyx.cpp)
   193 ms: __pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_5update_strings(_obje... (opendbc/can/parser_pyx.cpp)
   132 ms: __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_1__init__(_object*, _... (opendbc/can/parser_pyx.cpp)
    50 ms: __pyx_f_7opendbc_3can_10packer_pyx_9CANPacker_pack(__pyx_obj_7opendb... (opendbc/can/packer_pyx.cpp)
    38 ms: __pyx_pymod_exec_packer_pyx(_object*) (opendbc/can/packer_pyx.cpp)
    38 ms: __pyx_f_7opendbc_3can_10packer_pyx_9CANPacker_make_can_msg(__pyx_obj... (opendbc/can/packer_pyx.cpp)
    31 ms: std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_M_quan... (opendbc/can/dbc.cc)
    28 ms: CANPacker::pack(unsigned int, std::vector<SignalPackValue, std::allo... (opendbc/can/packer.cc)
    23 ms: set_signal_type(Signal&, ChecksumState*, std::__cxx11::basic_string<... (opendbc/can/dbc.cc)
    21 ms: std::__detail::_StateSeq<std::__cxx11::regex_traits<char> >::_M_clon... (opendbc/can/dbc.cc)
    20 ms: bool std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_M... (opendbc/can/dbc.cc)
    20 ms: bool std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_M... (opendbc/can/dbc.cc)
    19 ms: __Pyx_modinit_type_init_code() (opendbc/can/packer_pyx.cpp)
    19 ms: CANParser::CANParser(int, std::__cxx11::basic_string<char, std::char... (opendbc/can/parser.cc)
    17 ms: dbc_lookup(std::__cxx11::basic_string<char, std::char_traits<char>, ... (opendbc/can/dbc.cc)
    17 ms: __Pyx_AddTraceback(char const*, int, int, char const*) (opendbc/can/parser_pyx.cpp)
    17 ms: __Pyx_AddTraceback(char const*, int, int, char const*) (opendbc/can/packer_pyx.cpp)
    15 ms: std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_M_atom() (opendbc/can/dbc.cc)
    15 ms: __pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_1__init__(_object*, _... (opendbc/can/packer_pyx.cpp)
    14 ms: CANParser::CANParser(int, std::__cxx11::basic_string<char, std::char... (opendbc/can/parser.cc)
    13 ms: bool std::__detail::__regex_algo_impl<__gnu_cxx::__normal_iterator<c... (opendbc/can/dbc.cc)
    12 ms: get_dbc_names[abi:cxx11]() (opendbc/can/dbc.cc)
    11 ms: std::__detail::_BracketMatcher<std::__cxx11::regex_traits<char>, fal... (opendbc/can/dbc.cc)
    11 ms: MessageState::parse(unsigned long, std::vector<unsigned char, std::a... (opendbc/can/parser.cc)
    11 ms: std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_Compil... (opendbc/can/dbc.cc)
    11 ms: bool std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_M... (opendbc/can/dbc.cc)
    11 ms: bool std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_M... (opendbc/can/dbc.cc)
    11 ms: __Pyx_ParseOptionalKeywords(_object*, _object* const*, _object***, _... (opendbc/can/parser_pyx.cpp)

**** Function sets that took longest to compile / optimize:
   233 ms: dbc_parse_from_stream(std::__cxx11::basic_string<$> const&, std::ist... (1 times, avg 233 ms)
    62 ms: bool std::__detail::_Compiler<$>::_M_expression_term<$>(std::__detai... (4 times, avg 15 ms)
    36 ms: std::__detail::_BracketMatcher<$>::_BracketMatcher(std::__detail::_B... (4 times, avg 9 ms)
    34 ms: void std::__detail::_Compiler<$>::_M_insert_bracket_matcher<$>(bool) (4 times, avg 8 ms)
    31 ms: std::__detail::_Compiler<$>::_M_quantifier() (1 times, avg 31 ms)
    28 ms: CANPacker::pack(unsigned int, std::vector<$> const&) (1 times, avg 28 ms)
    26 ms: std::__detail::_BracketMatcher<$>::_M_make_range(char, char) (4 times, avg 6 ms)
    26 ms: void std::__detail::_Compiler<$>::_M_insert_character_class_matcher<... (4 times, avg 6 ms)
    25 ms: std::__detail::_BracketMatcher<$>::_M_add_equivalence_class(std::__c... (4 times, avg 6 ms)
    23 ms: set_signal_type(Signal&, ChecksumState*, std::__cxx11::basic_string<... (1 times, avg 23 ms)
    22 ms: void std::vector<$>::_M_realloc_append<$>() (5 times, avg 4 ms)
    21 ms: std::__detail::_BracketMatcher<$>::_M_add_character_class(std::__cxx... (4 times, avg 5 ms)
    21 ms: std::__detail::_StateSeq<$>::_M_clone() (1 times, avg 21 ms)
    21 ms: std::_Rb_tree<$>::_M_erase(std::_Rb_tree_node<$>*) (12 times, avg 1 ms)
    20 ms: std::vector<Signal, std::allocator<Signal> >::operator=(std::vector<... (3 times, avg 6 ms)
    20 ms: std::__detail::_Executor<$>::_M_dfs(std::__detail::_Executor<$>::_Ma... (2 times, avg 10 ms)
    19 ms: std::_Rb_tree_iterator<$> std::_Rb_tree<$>::_M_emplace_hint_unique<$... (5 times, avg 3 ms)
    19 ms: std::_Function_handler<$>::_M_manager(std::_Any_data&, std::_Any_dat... (16 times, avg 1 ms)
    19 ms: std::__detail::_BracketMatcher<$>::_M_ready() (4 times, avg 4 ms)
    19 ms: CANParser::CANParser(int, std::__cxx11::basic_string<$> const&, bool... (1 times, avg 19 ms)
    17 ms: std::__detail::_Executor<$>::_M_lookahead(long) (2 times, avg 8 ms)
    17 ms: dbc_lookup(std::__cxx11::basic_string<$> const&) (1 times, avg 17 ms)
    17 ms: std::_Rb_tree<$>::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_... (3 times, avg 5 ms)
    16 ms: std::_Function_handler<$>::_M_invoke(std::_Any_data const&, char&&) (16 times, avg 1 ms)
    16 ms: std::__detail::_BracketMatcher<$>::_M_add_collate_element(std::__cxx... (4 times, avg 4 ms)
    15 ms: std::__detail::_Compiler<$>::_M_atom() (1 times, avg 15 ms)
    14 ms: Signal* std::__do_uninit_copy<$>(__gnu_cxx::__normal_iterator<$>, __... (3 times, avg 4 ms)
    14 ms: Signal* std::__do_uninit_copy<$>(Signal*, Signal*, Signal*) (3 times, avg 4 ms)
    14 ms: CANParser::CANParser(int, std::__cxx11::basic_string<$> const&, std:... (1 times, avg 14 ms)
    13 ms: bool std::__detail::__regex_algo_impl<$>(__gnu_cxx::__normal_iterato... (1 times, avg 13 ms)

**** Expensive headers:
505 ms: opendbc/can/common.h (included 6 times, avg 84 ms), included via:
  3x: <direct include>
  2x: common_dbc.h 
  1x: cstring 

453 ms: /home/arjun/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/include/python3.12/Python.h (included 2 times, avg 226 ms), included via:
  2x: <direct include>

387 ms: /usr/include/c++/14.2.1/filesystem (included 1 times, avg 387 ms), included via:
  1x: <direct include>

363 ms: /usr/include/c++/14.2.1/exception (included 5 times, avg 72 ms), included via:
  2x: stdexcept 
  2x: <direct include>
  1x: filesystem fs_fwd.h system_error stdexcept 

362 ms: /usr/include/c++/14.2.1/unordered_map (included 6 times, avg 60 ms), included via:
  3x: <direct include>
  2x: common.h 
  1x: cstring 

328 ms: /usr/include/c++/14.2.1/stdexcept (included 5 times, avg 65 ms), included via:
  2x: <direct include>
  2x: ios_base.h system_error 
  1x: filesystem fs_fwd.h system_error 

296 ms: /usr/include/c++/14.2.1/algorithm (included 3 times, avg 98 ms), included via:
  3x: <direct include>

273 ms: /usr/include/c++/14.2.1/bits/ios_base.h (included 4 times, avg 68 ms), included via:
  2x: <direct include>
  1x: sstream istream ios 
  1x: filesystem fs_path.h locale locale_facets.h 

192 ms: opendbc/can/common_dbc.h (included 6 times, avg 32 ms), included via:
  3x: common.h 
  2x: <direct include>
  1x: cstring 

160 ms: /usr/include/c++/14.2.1/cassert (included 2 times, avg 80 ms), included via:
  2x: <direct include>

  done in 0.0s.

The .json files can be ignored because they are file generated by -ftime-trace

Regex takes the longest to instantiate.
opendbc/can.common.h is being included multiple(6 times) causing significant slowdown (500ms)

@Riley-livingston
Copy link

I used ClangBuildAnalyzer and this is what I get -


Analyzing build trace from 'clang_build_analysis.txt'...

**** Time summary:

Compilation (12 times):

  Parsing (frontend):            5.9 s

  Codegen & opts (backend):      8.3 s



**** Files that took longest to parse (compiler frontend):

  1571 ms: opendbc//can/dbc.json

   952 ms: opendbc//can/parser_pyx.o

   756 ms: opendbc//can/packer_pyx.o

   659 ms: opendbc//can/packer.json

   657 ms: opendbc//can/parser.json

   463 ms: opendbc//can/dbc.json

   408 ms: opendbc//can/common.json

   170 ms: opendbc//can/parser_pyx.o

    85 ms: opendbc//can/packer_pyx.o

    82 ms: opendbc//can/parser.json



**** Files that took longest to codegen (compiler backend):

  3773 ms: opendbc//can/dbc.json

  2587 ms: opendbc//can/parser_pyx.o

   980 ms: opendbc//can/packer_pyx.o

   517 ms: opendbc//can/parser.json

   269 ms: opendbc//can/packer.json

   168 ms: opendbc//can/common.json



**** Templates that took longest to instantiate:

   338 ms: std::basic_regex<char>::basic_regex (1 times, avg 338 ms)

   338 ms: std::basic_regex<char>::_M_compile (1 times, avg 338 ms)

   327 ms: std::__detail::_Compiler<std::regex_traits<char>>::_Compiler (1 times, avg 327 ms)

   283 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_disjunction (1 times, avg 283 ms)

   281 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_alternative (1 times, avg 281 ms)

   277 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_term (1 times, avg 277 ms)

   236 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_atom (1 times, avg 236 ms)

    84 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_insert_charact... (1 times, avg 84 ms)

    71 ms: std::regex_match<std::char_traits<char>, std::allocator<char>, std::... (1 times, avg 71 ms)

    71 ms: std::regex_match<__gnu_cxx::__normal_iterator<const char *, std::bas... (1 times, avg 71 ms)

    71 ms: std::__detail::__regex_algo_impl<__gnu_cxx::__normal_iterator<const ... (1 times, avg 71 ms)

    53 ms: std::unordered_map<int, int> (6 times, avg 8 ms)

    44 ms: std::unordered_map<unsigned int, const Msg *> (6 times, avg 7 ms)

    43 ms: std::unordered_map<std::basic_string<char>, const Msg *> (6 times, avg 7 ms)

    42 ms: std::_Hashtable<int, std::pair<const int, int>, std::allocator<std::... (6 times, avg 7 ms)

    39 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_quantifier (1 times, avg 39 ms)

    37 ms: std::_Hashtable<std::basic_string<char>, std::pair<const std::basic_... (6 times, avg 6 ms)

    36 ms: std::__detail::_Executor<__gnu_cxx::__normal_iterator<const char *, ... (1 times, avg 36 ms)

    36 ms: std::__detail::_Executor<__gnu_cxx::__normal_iterator<const char *, ... (1 times, avg 36 ms)

    36 ms: std::__detail::_Executor<__gnu_cxx::__normal_iterator<const char *, ... (1 times, avg 36 ms)

    35 ms: std::unordered_map<unsigned int, MessageState> (6 times, avg 5 ms)

    35 ms: std::_Hashtable<unsigned int, std::pair<const unsigned int, const Ms... (6 times, avg 5 ms)

    31 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_bracket_expres... (1 times, avg 31 ms)

    30 ms: std::_Hashtable<unsigned int, std::pair<const unsigned int, MessageS... (6 times, avg 5 ms)

    28 ms: std::__detail::_StateSeq<std::regex_traits<char>>::_M_clone (1 times, avg 28 ms)

    27 ms: std::vector<Signal>::operator= (3 times, avg 9 ms)

    27 ms: std::__detail::_BracketMatcher<std::regex_traits<char>, false, false... (1 times, avg 27 ms)

    25 ms: std::unordered_map<unsigned int, MessageState>::at (6 times, avg 4 ms)

    25 ms: std::__detail::_Map_base<unsigned int, std::pair<const unsigned int,... (6 times, avg 4 ms)

    24 ms: std::map<std::pair<unsigned int, std::basic_string<char>>, Signal>::... (1 times, avg 24 ms)



**** Template sets that took longest to instantiate:

   338 ms: std::basic_regex<$>::basic_regex (1 times, avg 338 ms)

   338 ms: std::basic_regex<$>::_M_compile (1 times, avg 338 ms)

   327 ms: std::__detail::_Compiler<$>::_Compiler (1 times, avg 327 ms)

   283 ms: std::__detail::_Compiler<$>::_M_disjunction (1 times, avg 283 ms)

   281 ms: std::__detail::_Compiler<$>::_M_alternative (1 times, avg 281 ms)

   277 ms: std::__detail::_Compiler<$>::_M_term (1 times, avg 277 ms)

   236 ms: std::__detail::_Compiler<$>::_M_atom (1 times, avg 236 ms)

   182 ms: std::unordered_map<$> (25 times, avg 7 ms)

   164 ms: std::_Hashtable<$> (31 times, avg 5 ms)

   123 ms: std::__detail::_Compiler<$>::_M_insert_character_class_matcher<$> (4 times, avg 30 ms)

   102 ms: std::__and_<$> (108 times, avg 0 ms)

    95 ms: std::vector<$> (59 times, avg 1 ms)

    94 ms: std::pair<$> (53 times, avg 1 ms)

    77 ms: std::function<$>::function<$> (16 times, avg 4 ms)

    71 ms: std::regex_match<$> (1 times, avg 71 ms)

    71 ms: std::__detail::__regex_algo_impl<$> (1 times, avg 71 ms)

    67 ms: std::basic_string<$> (24 times, avg 2 ms)

    66 ms: std::vector<$>::_M_realloc_append<$> (22 times, avg 3 ms)

    65 ms: std::_Rb_tree<$>::_M_emplace_hint_unique<$> (5 times, avg 13 ms)

    63 ms: std::vector<$>::emplace_back<$> (15 times, avg 4 ms)

    62 ms: std::vector<$>::push_back (16 times, avg 3 ms)

    59 ms: std::map<$> (16 times, avg 3 ms)

    55 ms: std::_Rb_tree<$>::~_Rb_tree (12 times, avg 4 ms)

    54 ms: std::_Rb_tree<$>::_M_erase (12 times, avg 4 ms)

    48 ms: std::_Vector_base<$> (57 times, avg 0 ms)

    44 ms: std::unordered_map<$>::at (10 times, avg 4 ms)

    44 ms: std::__detail::_Executor<$>::_M_match (2 times, avg 22 ms)

    44 ms: std::__detail::_Executor<$>::_M_main (2 times, avg 22 ms)

    44 ms: std::__detail::_Executor<$>::_M_main_dispatch (2 times, avg 22 ms)

    44 ms: std::__detail::_Map_base<$>::at (10 times, avg 4 ms)



**** Functions that took longest to compile:

   359 ms: __pyx_pymod_exec_parser_pyx(_object*) (opendbc/can/parser_pyx.cpp)

   233 ms: dbc_parse_from_stream(std::__cxx11::basic_string<char, std::char_tra... (opendbc/can/dbc.cc)

   203 ms: __pyx_pf_7opendbc_3can_10parser_pyx_9CANParser___init__(__pyx_obj_7o... (opendbc/can/parser_pyx.cpp)

   193 ms: __pyx_pw_7opendbc_3can_10parser_pyx_9CANParser_5update_strings(_obje... (opendbc/can/parser_pyx.cpp)

   132 ms: __pyx_pw_7opendbc_3can_10parser_pyx_9CANDefine_1__init__(_object*, _... (opendbc/can/parser_pyx.cpp)

    50 ms: __pyx_f_7opendbc_3can_10packer_pyx_9CANPacker_pack(__pyx_obj_7opendb... (opendbc/can/packer_pyx.cpp)

    38 ms: __pyx_pymod_exec_packer_pyx(_object*) (opendbc/can/packer_pyx.cpp)

    38 ms: __pyx_f_7opendbc_3can_10packer_pyx_9CANPacker_make_can_msg(__pyx_obj... (opendbc/can/packer_pyx.cpp)

    31 ms: std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_M_quan... (opendbc/can/dbc.cc)

    28 ms: CANPacker::pack(unsigned int, std::vector<SignalPackValue, std::allo... (opendbc/can/packer.cc)

    23 ms: set_signal_type(Signal&, ChecksumState*, std::__cxx11::basic_string<... (opendbc/can/dbc.cc)

    21 ms: std::__detail::_StateSeq<std::__cxx11::regex_traits<char> >::_M_clon... (opendbc/can/dbc.cc)

    20 ms: bool std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_M... (opendbc/can/dbc.cc)

    20 ms: bool std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_M... (opendbc/can/dbc.cc)

    19 ms: __Pyx_modinit_type_init_code() (opendbc/can/packer_pyx.cpp)

    19 ms: CANParser::CANParser(int, std::__cxx11::basic_string<char, std::char... (opendbc/can/parser.cc)

    17 ms: dbc_lookup(std::__cxx11::basic_string<char, std::char_traits<char>, ... (opendbc/can/dbc.cc)

    17 ms: __Pyx_AddTraceback(char const*, int, int, char const*) (opendbc/can/parser_pyx.cpp)

    17 ms: __Pyx_AddTraceback(char const*, int, int, char const*) (opendbc/can/packer_pyx.cpp)

    15 ms: std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_M_atom() (opendbc/can/dbc.cc)

    15 ms: __pyx_pw_7opendbc_3can_10packer_pyx_9CANPacker_1__init__(_object*, _... (opendbc/can/packer_pyx.cpp)

    14 ms: CANParser::CANParser(int, std::__cxx11::basic_string<char, std::char... (opendbc/can/parser.cc)

    13 ms: bool std::__detail::__regex_algo_impl<__gnu_cxx::__normal_iterator<c... (opendbc/can/dbc.cc)

    12 ms: get_dbc_names[abi:cxx11]() (opendbc/can/dbc.cc)

    11 ms: std::__detail::_BracketMatcher<std::__cxx11::regex_traits<char>, fal... (opendbc/can/dbc.cc)

    11 ms: MessageState::parse(unsigned long, std::vector<unsigned char, std::a... (opendbc/can/parser.cc)

    11 ms: std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_Compil... (opendbc/can/dbc.cc)

    11 ms: bool std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_M... (opendbc/can/dbc.cc)

    11 ms: bool std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_M... (opendbc/can/dbc.cc)

    11 ms: __Pyx_ParseOptionalKeywords(_object*, _object* const*, _object***, _... (opendbc/can/parser_pyx.cpp)



**** Function sets that took longest to compile / optimize:

   233 ms: dbc_parse_from_stream(std::__cxx11::basic_string<$> const&, std::ist... (1 times, avg 233 ms)

    62 ms: bool std::__detail::_Compiler<$>::_M_expression_term<$>(std::__detai... (4 times, avg 15 ms)

    36 ms: std::__detail::_BracketMatcher<$>::_BracketMatcher(std::__detail::_B... (4 times, avg 9 ms)

    34 ms: void std::__detail::_Compiler<$>::_M_insert_bracket_matcher<$>(bool) (4 times, avg 8 ms)

    31 ms: std::__detail::_Compiler<$>::_M_quantifier() (1 times, avg 31 ms)

    28 ms: CANPacker::pack(unsigned int, std::vector<$> const&) (1 times, avg 28 ms)

    26 ms: std::__detail::_BracketMatcher<$>::_M_make_range(char, char) (4 times, avg 6 ms)

    26 ms: void std::__detail::_Compiler<$>::_M_insert_character_class_matcher<... (4 times, avg 6 ms)

    25 ms: std::__detail::_BracketMatcher<$>::_M_add_equivalence_class(std::__c... (4 times, avg 6 ms)

    23 ms: set_signal_type(Signal&, ChecksumState*, std::__cxx11::basic_string<... (1 times, avg 23 ms)

    22 ms: void std::vector<$>::_M_realloc_append<$>() (5 times, avg 4 ms)

    21 ms: std::__detail::_BracketMatcher<$>::_M_add_character_class(std::__cxx... (4 times, avg 5 ms)

    21 ms: std::__detail::_StateSeq<$>::_M_clone() (1 times, avg 21 ms)

    21 ms: std::_Rb_tree<$>::_M_erase(std::_Rb_tree_node<$>*) (12 times, avg 1 ms)

    20 ms: std::vector<Signal, std::allocator<Signal> >::operator=(std::vector<... (3 times, avg 6 ms)

    20 ms: std::__detail::_Executor<$>::_M_dfs(std::__detail::_Executor<$>::_Ma... (2 times, avg 10 ms)

    19 ms: std::_Rb_tree_iterator<$> std::_Rb_tree<$>::_M_emplace_hint_unique<$... (5 times, avg 3 ms)

    19 ms: std::_Function_handler<$>::_M_manager(std::_Any_data&, std::_Any_dat... (16 times, avg 1 ms)

    19 ms: std::__detail::_BracketMatcher<$>::_M_ready() (4 times, avg 4 ms)

    19 ms: CANParser::CANParser(int, std::__cxx11::basic_string<$> const&, bool... (1 times, avg 19 ms)

    17 ms: std::__detail::_Executor<$>::_M_lookahead(long) (2 times, avg 8 ms)

    17 ms: dbc_lookup(std::__cxx11::basic_string<$> const&) (1 times, avg 17 ms)

    17 ms: std::_Rb_tree<$>::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_... (3 times, avg 5 ms)

    16 ms: std::_Function_handler<$>::_M_invoke(std::_Any_data const&, char&&) (16 times, avg 1 ms)

    16 ms: std::__detail::_BracketMatcher<$>::_M_add_collate_element(std::__cxx... (4 times, avg 4 ms)

    15 ms: std::__detail::_Compiler<$>::_M_atom() (1 times, avg 15 ms)

    14 ms: Signal* std::__do_uninit_copy<$>(__gnu_cxx::__normal_iterator<$>, __... (3 times, avg 4 ms)

    14 ms: Signal* std::__do_uninit_copy<$>(Signal*, Signal*, Signal*) (3 times, avg 4 ms)

    14 ms: CANParser::CANParser(int, std::__cxx11::basic_string<$> const&, std:... (1 times, avg 14 ms)

    13 ms: bool std::__detail::__regex_algo_impl<$>(__gnu_cxx::__normal_iterato... (1 times, avg 13 ms)



**** Expensive headers:

505 ms: opendbc/can/common.h (included 6 times, avg 84 ms), included via:

  3x: <direct include>

  2x: common_dbc.h 

  1x: cstring 



453 ms: /home/arjun/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/include/python3.12/Python.h (included 2 times, avg 226 ms), included via:

  2x: <direct include>



387 ms: /usr/include/c++/14.2.1/filesystem (included 1 times, avg 387 ms), included via:

  1x: <direct include>



363 ms: /usr/include/c++/14.2.1/exception (included 5 times, avg 72 ms), included via:

  2x: stdexcept 

  2x: <direct include>

  1x: filesystem fs_fwd.h system_error stdexcept 



362 ms: /usr/include/c++/14.2.1/unordered_map (included 6 times, avg 60 ms), included via:

  3x: <direct include>

  2x: common.h 

  1x: cstring 



328 ms: /usr/include/c++/14.2.1/stdexcept (included 5 times, avg 65 ms), included via:

  2x: <direct include>

  2x: ios_base.h system_error 

  1x: filesystem fs_fwd.h system_error 



296 ms: /usr/include/c++/14.2.1/algorithm (included 3 times, avg 98 ms), included via:

  3x: <direct include>



273 ms: /usr/include/c++/14.2.1/bits/ios_base.h (included 4 times, avg 68 ms), included via:

  2x: <direct include>

  1x: sstream istream ios 

  1x: filesystem fs_path.h locale locale_facets.h 



192 ms: opendbc/can/common_dbc.h (included 6 times, avg 32 ms), included via:

  3x: common.h 

  2x: <direct include>

  1x: cstring 



160 ms: /usr/include/c++/14.2.1/cassert (included 2 times, avg 80 ms), included via:

  2x: <direct include>



  done in 0.0s.

The .json files can be ignored because they are file generated by -ftime-trace

Regex takes the longest to instantiate.

opendbc/can.common.h is being included multiple(6 times) causing significant slowdown (500ms)

So it looks like the most impactful change would be optimizing or replacing regex with a lighter implementation(~25% of the compilation bottleneck in clean builds).

Also, what if we split common.h into smaller, focused headers to reduce the compilation unit size? Might also be a good idea to review circular dependencies between common.h and common_dbc.h

@MikeBusuttil
Copy link

@adeebshihadeh I believe I've got this one solved: #1602

@MikeBusuttil
Copy link

MikeBusuttil commented Jan 13, 2025

I dug into this 1 over the past little bit and go back to work tomorrow so I wanted to share my findings in case anyone wants to move forward on this while I'm preoccupied.

Running scons -c && scons -j$(nproc) results in 12 commands (detailed below) being run after (and while) scons does some work to determine what those 12 commands will be. Here's a graphical representation of that:

graph TB;
    classDef bottleneck stroke:#f00
    Scons[Scons overhead - .1 s]:::bottleneck;
    A[g++ -o common.os<br>.3 s<br>];
    B[g++ -o dbc.os<br>1.0 s<br><br><br><br><br><br><br><br>];
    C[g++ -o parser.os<br>.6 s<br><br><br><br>];
    D[g++ -o packer.os<br>.5 s<br><br><br>];
    E[g++ -o libdbc.so - .1 s];
    F[cythonize packer_pyx.pyx<br>.5 s<br><br><br>];
    G[g++ -o packer_pyx.o<br>.7 s<br><br><br><br><br>];
    H[g++ -o packer_pyx.so - .1 s];
    I[cythonize parser_pyx.pyx<br>.6 s<br><br><br><br>]:::bottleneck;
    J[g++ -o parser_pyx.o<br>1.1 s<br><br><br><br><br><br><br><br><br>]:::bottleneck;
    K[g++ -o parser_pyx.so - .1 s]:::bottleneck;
    L[python3 generator.py - .1 s];
    A-->E;
    B-->E;
    B-->H;
    B-->K;
    C-->E;
    D-->E;
    F-->G;
    G-->H;
    I-->J;
    J-->K;
    Scons-->A;
    Scons-->B;
    Scons-->C;
    Scons-->D;
    Scons-->F;
    Scons-->I;
    Scons-->L;
    Start-->Scons;
Loading
  • The size of the job is related to the duration of the job. Times (on my machine) are listed inside each job.
  • The jobs highlighted with red are the bottleneck. Improving the speed on any of those should improve the resulting build time.
  • Jobs are not run until all parent jobs complete (parent->child)

Increasing speed of g++ -o dbc.os

On master, compiling dbc.cc is the bottleneck. It uses the c++ standard regex library which has very poor build-time performance. Replacing this with RE2 (done in #1602) yields a 5-10x performance increase for that job at the cost of adding an additional dependency.

Increasing the speed of g++ -o parser_pyx.o

compiling without optimization

This is another significant bottleneck on master that was addressed in #1602 by compiling without optimization (using -O0 instead of -O2). Making this change yields a 5-10x performance increase for that job at the cost of a less-optimized run-time during development.

splitting into multiple steps

To further increase the speed of this step it can be broken into 2 files that can be cythonize'ed and compiled in parallel for modest performance gains (~10% for that job). The gains are minimal and it comes at the cost of a little complexity and resource inefficiency. This work was done here and can be merged if the trade-off's are deemed worth it.

Increasing the speed of cythonize parser_pyx.pyx + g++ -o parser_pyx.o steps

There's not much that can be done here without moving away from cython. Using cython means having about 0.8s of overhead (see "Cython overhead" below) before you can do anything useful. To improve these step any further would require a big refactor like an architecture change or rewriting these in C++ since Python is likely out of the question for runtime performance.

Increasing the speed of the scons overhead

Preventing the initialization of unused scons tools (done in #1602 ) trimmed over .7s from the build time (10x improvement on this step and 25% time reduction overall) with no real trade-offs. There's very little room for further improvement on this front.

I have not exhausted all the options here and believe there is still some fat yet to be trimmed on this front. For example, saving the path which numpy stores its header files on your local machine will save you 15% on overall build performance but this comes at the cost of code complexity (see here for what that could look like). To see what kind of a dent you're making, run scons with the --debug=time flag. I have not yet dug deep into site_scons/site_tools/cython.py and feel like some improvements there could yield more time saved.

Another option is to cache all the build steps and bypass scons entirely. This gets the build times well under 1s (see here for a node script that does that) but is pretty hacky and presumably not the direction we want to go in.

Good luck!

If you made it this far and are motivated to proceed I'd be down to pair on it - book some time with me here and let's get 'er done. Otherwise I may return to it when I get some availability or something comes to me while my mind wanders 🛌🚽🚿

Addendum

Cython overhead

A simple cython file that imports nothing and does nothing takes about .5s

echo "# distutils: language = c++
# cython: c_string_encoding=ascii, language_level=3
a=5" > opendbc/can/parser_pyx.pyx && rm -f opendbc/can/parser_pyx.cpp && time cythonize opendbc/can/parser_pyx.pyx && time g++ -o opendbc/can/parser_pyx.o -c -std=c++1z -g -fPIC -O0 -Wunused -Wshadow -Wno-vla-cxx-extension -Wno-unknown-warning-option -Wno-#warnings -Wno-shadow -Wno-deprecated-declarations -I. -I/usr/lib/include -I/opt/homebrew/include -I/usr/include/python3.12 -I.venv/lib/python3.12/site-packages/numpy/_core/include opendbc/can/parser_pyx.cpp
Compiling /root/opendbc/opendbc/can/parser_pyx.pyx because it changed.
[1/1] Cythonizing /root/opendbc/opendbc/can/parser_pyx.pyx

real    0m0.329s
user    0m0.303s
sys     0m0.010s

real    0m0.192s
user    0m0.156s
sys     0m0.027s

Once you import the standard libraries that balloons to 0.8s

echo "# distutils: language = c++
> # cython: c_string_encoding=ascii, language_level=3
 cimport> from libc.stdint cimport uint8_t, uint32_t, uint64_t
cpp cimp> from libcpp cimport bool
t pair
f> from libcpp.pair cimport pair
> from libcpp.set cimport set
libcpp.s> from libcpp.string cimport string
> from libcpp.vector cimport vector
> from libcpp.unordered_map cimport unordered_map" > opendbc/can/parser_pyx.pyx && rm -f opendbc/can/parser_pyx.cpp && time cythonize opendbc/can/parser_pyx.pyx && time g++ -o opendbc/can/parser_pyx.o -c -std=c++1z -g -fPIC -O0 -Wunused -Wshadow -Wno-vla-cxx-extension -Wno-unknown-warning-option -Wno-#warnings -Wno-shadow -Wno-deprecated-declarations -I. -I/usr/lib/include -I/opt/homebrew/include -I/usr/include/python3.12 -I.venv/lib/python3.12/site-packages/numpy/_core/include opendbc/can/parser_pyx.cpp
Compiling /root/opendbc/opendbc/can/parser_pyx.pyx because it changed.
[1/1] Cythonizing /root/opendbc/opendbc/can/parser_pyx.pyx

real    0m0.428s
user    0m0.368s
sys     0m0.038s

real    0m0.366s
user    0m0.320s
sys     0m0.027s

Commands resulting from scons

  1. g++ -o opendbc/can/common.os -c -std=c++1z -DDBC_FILE_PATH='"/root/opendbc/opendbc/dbc"' -g -fPIC -O0 -Wunused -Werror -Wshadow -Wno-vla-cxx-extension -Wno-unknown-warning-option -fPIC -I. -I/usr/lib/include -I/opt/homebrew/include -I/usr/include/python3.12 opendbc/can/common.cc
  2. g++ -o opendbc/can/dbc.os -c -std=c++1z -DDBC_FILE_PATH='"/root/opendbc/opendbc/dbc"' -g -fPIC -O0 -Wunused -Werror -Wshadow -Wno-vla-cxx-extension -Wno-unknown-warning-option -fPIC -I. -I/usr/lib/include -I/opt/homebrew/include -I/usr/include/python3.12 opendbc/can/dbc.cc
  3. g++ -o opendbc/can/parser.os -c -std=c++1z -DDBC_FILE_PATH='"/root/opendbc/opendbc/dbc"' -g -fPIC -O0 -Wunused -Werror -Wshadow -Wno-vla-cxx-extension -Wno-unknown-warning-option -fPIC -I. -I/usr/lib/include -I/opt/homebrew/include -I/usr/include/python3.12 opendbc/can/parser.cc
  4. g++ -o opendbc/can/packer.os -c -std=c++1z -DDBC_FILE_PATH='"/root/opendbc/opendbc/dbc"' -g -fPIC -O0 -Wunused -Werror -Wshadow -Wno-vla-cxx-extension -Wno-unknown-warning-option -fPIC -I. -I/usr/lib/include -I/opt/homebrew/include -I/usr/include/python3.12 opendbc/can/packer.cc
  5. cythonize opendbc/can/packer_pyx.pyx
  6. cythonize opendbc/can/parser_pyx.pyx
  7. python3 opendbc/dbc/generator/generator.py
  8. g++ -o opendbc/can/packer_pyx.o -c -std=c++1z -g -fPIC -O0 -Wunused -Wshadow -Wno-vla-cxx-extension -Wno-unknown-warning-option -Wno-#warnings -Wno-shadow -Wno-deprecated-declarations -I. -I/usr/lib/include -I/opt/homebrew/include -I/usr/include/python3.12 -I.venv/lib/python3.12/site-packages/numpy/_core/include opendbc/can/packer_pyx.cpp
  9. g++ -o opendbc/can/parser_pyx.o -c -std=c++1z -g -fPIC -O0 -Wunused -Wshadow -Wno-vla-cxx-extension -Wno-unknown-warning-option -Wno-#warnings -Wno-shadow -Wno-deprecated-declarations -I. -I/usr/lib/include -I/opt/homebrew/include -I/usr/include/python3.12 -I.venv/lib/python3.12/site-packages/numpy/_core/include opendbc/can/parser_pyx.cpp
  10. g++ -o opendbc/can/libdbc.so -shared opendbc/can/dbc.os opendbc/can/parser.os opendbc/can/packer.os opendbc/can/common.os -Lopendbc/can -L/opt/homebrew/lib
  11. g++ -o opendbc/can/packer_pyx.so -pthread -shared -Wl,-rpath=/root/opendbc/opendbc/can opendbc/can/packer_pyx.o -Lopendbc/can -L/opt/homebrew/lib -Lopendbc/can -ldbc
  12. g++ -o opendbc/can/parser_pyx.so -pthread -shared -Wl,-rpath=/root/opendbc/opendbc/can opendbc/can/parser_pyx.o -Lopendbc/can -L/opt/homebrew/lib -Lopendbc/can -ldbc -lre2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Open
Development

Successfully merging a pull request may close this issue.

7 participants