openpilot icon indicating copy to clipboard operation
openpilot copied to clipboard

MacOS: rpath and library issues

Open pd0wm opened this issue 3 years ago • 3 comments

When trying to run python services all kinds of library path issues pop up.

  1. All paths seem to be relative against the basedir. Running something from within a folder doesn't work, and you get errors like:
ImportError: dlopen(/Users/willem/openpilot/opendbc/can/parser_pyx.so, 0x0002): Library not loaded: opendbc/can/libdbc.dylib
  Referenced from: /Users/willem/openpilot/opendbc/can/parser_pyx.so
  Reason: tried: 'opendbc/can/libdbc.dylib' (no such file), '/usr/local/lib/libdbc.dylib' (no such file), '/usr/lib/libdbc.dylib' (no such file)
  1. Can't load acados
ImportError: dlopen(/Users/willem/openpilot/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_ocp_solver_pyx.so, 0x0002): Library not loaded: @rpath/libacados.dylib
  Referenced from: /Users/willem/openpilot/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/libacados_ocp_solver_long.dylib
  Reason: tried: '/usr/local/lib/libacados.dylib' (no such file), '/usr/lib/libacados.dylib' (no such file)

pd0wm avatar Feb 23 '22 12:02 pd0wm

Any update on the issue? I am seeing the same errors while running the tests on macOS Monterey 12.2.1. @pd0wm do you have any workarounds to resolve this issue?

havvagulay avatar Mar 08 '22 07:03 havvagulay

Same after submitting the build fixes

  Reason: tried: 'opendbc/can/libdbc.dylib' (no such file), '/usr/local/lib/libdbc.dylib' (no such file), '/usr/lib/libdbc.dylib' (no such file)```

zorrobyte avatar May 12 '22 22:05 zorrobyte

As a workaround: things work if you run them from the openpilot root folder. E.g. selfdrive/test/process_replay/test_processes.py --whitelist_procs controlsd

pd0wm avatar May 13 '22 08:05 pd0wm