lcm-proj / lcm

Lightweight Communications and Marshalling
GNU Lesser General Public License v2.1
944 stars 385 forks source link

make lcm-1.4.0 has strange error #511

Open KailinTong opened 2 months ago

KailinTong commented 2 months ago

I am reproducing this repo, where lcm-1.4.0 is a dependency. https://github.com/katie-hughes/unitree_ros2

I am using Ubuntu 22.04 and Python 3.11.5 When I tried to make lcm-1.4.0, I met the following error:.

/home/tongadm/lcm-1.4.0/lcm-python/module.c: In function ‘PyInit__lcm’:
/home/tongadm/lcm-1.4.0/lcm-python/module.c:46:34: error: lvalue required as left operand of assignment
   46 |     Py_TYPE(&pylcmeventlog_type) = &PyType_Type;
      |                                  ^
/home/tongadm/lcm-1.4.0/lcm-python/module.c:47:26: error: lvalue required as left operand of assignment
   47 |     Py_TYPE(&pylcm_type) = &PyType_Type;
      |                          ^
/home/tongadm/lcm-1.4.0/lcm-python/module.c:48:39: error: lvalue required as left operand of assignment
   48 |     Py_TYPE(&pylcm_subscription_type) = &PyType_Type;
      |                                       ^
make[2]: *** [lcm-python/CMakeFiles/lcm-python.dir/build.make:63: lcm-python/CMakeFiles/lcm-python.dir/module.c.o] Error 1
make[2]: Leaving directory '/home/tongadm/lcm-1.4.0/build'
make[1]: *** [CMakeFiles/Makefile2:1107: lcm-python/CMakeFiles/lcm-python.dir/all] Error 2
make[1]: Leaving directory '/home/tongadm/lcm-1.4.0/build'
make: *** [Makefile:163: all] Error 2

Do you have any ideas? Thank you in advance!

nosracd commented 2 months ago

I'm not familiar with that error, but older releases of LCM have issues with newer versions of Python. Have you tried building with an older version of Python or a newer version of LCM?

KailinTong commented 2 months ago

thank you very much for your reply. I would like to build LCM 1.4 with some older versions of Python. But do you know how to find which version of python is compatible with LCM 1.4?

nosracd commented 2 months ago

Unfortunately, I think your best bet will be trial and error. That information doesn't appear to have been documented anywhere in the 1.4 release.

It does appear there was Python 3 support. Also, LCM 1.4 was released in August 2018. So at the time the newest version of Python when LCM 1.4 was released would have been Python 3.7, so that may be a good starting point.