diff --git a/SConstruct b/SConstruct index 14450cec9f8925..6b45d60f2e9110 100644 --- a/SConstruct +++ b/SConstruct @@ -127,6 +127,7 @@ else: "/opt/homebrew/lib", "/usr/local/opt/openssl/lib", "/opt/homebrew/opt/openssl/lib", + f"#third_party/acados/{arch}/lib", "/System/Library/Frameworks/OpenGL.framework/Libraries", ] cflags += ["-DGL_SILENCE_DEPRECATION"] diff --git a/selfdrive/controls/lib/lateral_mpc_lib/SConscript b/selfdrive/controls/lib/lateral_mpc_lib/SConscript index 148e4e123d320a..f402e6e15e72c0 100644 --- a/selfdrive/controls/lib/lateral_mpc_lib/SConscript +++ b/selfdrive/controls/lib/lateral_mpc_lib/SConscript @@ -48,12 +48,13 @@ lenv.Clean(generated_files, Dir(gen)) lenv.Command(generated_files, ["lat_mpc.py"], - f"cd {Dir('.').abspath} && python lat_mpc.py") + f"cd {Dir('.').abspath} && python3 lat_mpc.py") lenv["CFLAGS"].append("-DACADOS_WITH_QPOASES") lenv["CXXFLAGS"].append("-DACADOS_WITH_QPOASES") lenv["CCFLAGS"].append("-Wno-unused") -lenv["LINKFLAGS"].append("-Wl,--disable-new-dtags") +if arch != "Darwin": + lenv["LINKFLAGS"].append("-Wl,--disable-new-dtags") lib_solver = lenv.SharedLibrary(f"{gen}/acados_ocp_solver_lat", build_files, LIBS=['m', 'acados', 'hpipm', 'blasfeo', 'qpOASES_e']) diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/SConscript b/selfdrive/controls/lib/longitudinal_mpc_lib/SConscript index 4abe90f8f892b0..4c43985d1fdb35 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/SConscript +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/SConscript @@ -58,12 +58,13 @@ lenv.Clean(generated_files, Dir(gen)) lenv.Command(generated_files, ["long_mpc.py"], - f"cd {Dir('.').abspath} && python long_mpc.py") + f"cd {Dir('.').abspath} && python3 long_mpc.py") lenv["CFLAGS"].append("-DACADOS_WITH_QPOASES") lenv["CXXFLAGS"].append("-DACADOS_WITH_QPOASES") lenv["CCFLAGS"].append("-Wno-unused") -lenv["LINKFLAGS"].append("-Wl,--disable-new-dtags") +if arch != "Darwin": + lenv["LINKFLAGS"].append("-Wl,--disable-new-dtags") lib_solver = lenv.SharedLibrary(f"{gen}/acados_ocp_solver_long", build_files, LIBS=['m', 'acados', 'hpipm', 'blasfeo', 'qpOASES_e']) diff --git a/selfdrive/ui/qt/widgets/cameraview.cc b/selfdrive/ui/qt/widgets/cameraview.cc index ff9f7754d16b31..289f61afe0cf76 100644 --- a/selfdrive/ui/qt/widgets/cameraview.cc +++ b/selfdrive/ui/qt/widgets/cameraview.cc @@ -31,8 +31,8 @@ const char frame_fragment_shader[] = "#version 150 core\n" #else "#version 300 es\n" -#endif "precision mediump float;\n" +#endif "uniform sampler2D uTexture;\n" "in vec4 vTexCoord;\n" "out vec4 colorOut;\n" diff --git a/selfdrive/ui/replay/framereader.cc b/selfdrive/ui/replay/framereader.cc index 5955d1bfcb05a3..59e43cb58f89ff 100644 --- a/selfdrive/ui/replay/framereader.cc +++ b/selfdrive/ui/replay/framereader.cc @@ -15,7 +15,8 @@ struct buffer_data { int readPacket(void *opaque, uint8_t *buf, int buf_size) { struct buffer_data *bd = (struct buffer_data *)opaque; - buf_size = std::min((size_t)buf_size, bd->size - bd->offset); + assert(bd->offset <= bd->size); + buf_size = std::min((size_t)buf_size, (size_t)(bd->size - bd->offset)); if (!buf_size) return AVERROR_EOF; memcpy(buf, bd->data + bd->offset, buf_size); diff --git a/third_party/acados/Darwin/lib/libacados.dylib b/third_party/acados/Darwin/lib/libacados.dylib new file mode 100755 index 00000000000000..36dc230f71a42c Binary files /dev/null and b/third_party/acados/Darwin/lib/libacados.dylib differ diff --git a/third_party/acados/Darwin/lib/libblasfeo.dylib b/third_party/acados/Darwin/lib/libblasfeo.dylib new file mode 100755 index 00000000000000..cefef889408948 Binary files /dev/null and b/third_party/acados/Darwin/lib/libblasfeo.dylib differ diff --git a/third_party/acados/Darwin/lib/libhpipm.dylib b/third_party/acados/Darwin/lib/libhpipm.dylib new file mode 100755 index 00000000000000..5c05838618facd Binary files /dev/null and b/third_party/acados/Darwin/lib/libhpipm.dylib differ diff --git a/third_party/acados/Darwin/lib/libqpOASES_e.3.1.dylib b/third_party/acados/Darwin/lib/libqpOASES_e.3.1.dylib new file mode 100755 index 00000000000000..2ea5465beb848f Binary files /dev/null and b/third_party/acados/Darwin/lib/libqpOASES_e.3.1.dylib differ diff --git a/third_party/acados/Darwin/lib/libqpOASES_e.dylib b/third_party/acados/Darwin/lib/libqpOASES_e.dylib new file mode 120000 index 00000000000000..e3d94c4bc2d648 --- /dev/null +++ b/third_party/acados/Darwin/lib/libqpOASES_e.dylib @@ -0,0 +1 @@ +libqpOASES_e.3.1.dylib \ No newline at end of file diff --git a/third_party/acados/Darwin/t_renderer b/third_party/acados/Darwin/t_renderer new file mode 100755 index 00000000000000..7ee3eda293deb3 Binary files /dev/null and b/third_party/acados/Darwin/t_renderer differ