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

make lcm-1.4.0 has strange error #511

Open
KailinTong opened this issue Apr 30, 2024 · 6 comments
Open

make lcm-1.4.0 has strange error #511

KailinTong opened this issue Apr 30, 2024 · 6 comments

Comments

@KailinTong
Copy link

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
Copy link
Contributor

nosracd commented Apr 30, 2024

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
Copy link
Author

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
Copy link
Contributor

nosracd commented Apr 30, 2024

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.

@gaoboyi
Copy link

gaoboyi commented Aug 30, 2024

/home/gaoboyi/lcm/lcm-python/module.c:1:10: fatal error: Python.h: 没有那个文件或目录
1 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
make[2]: *** [lcm-python/CMakeFiles/lcm-python.dir/build.make:63:lcm-python/CMakeFiles/lcm-python.dir/module.c.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:977:lcm-python/CMakeFiles/lcm-python.dir/all] 错误 2
make: *** [Makefile:163:all] 错误 2
I have the similar issue

@Revivelj
Copy link

Revivelj commented Sep 3, 2024

/home/gaoboyi/lcm/lcm-python/module.c:1:10: fatal error: Python.h: 没有那个文件或目录 1 | #include <Python.h> | ^~~~~~~~~~ compilation terminated. make[2]: *** [lcm-python/CMakeFiles/lcm-python.dir/build.make:63:lcm-python/CMakeFiles/lcm-python.dir/module.c.o] 错误 1 make[1]: *** [CMakeFiles/Makefile2:977:lcm-python/CMakeFiles/lcm-python.dir/all] 错误 2 make: *** [Makefile:163:all] 错误 2 I have the similar issue

I have the same issue.Have you solved it yet?

@pinkkmin
Copy link

/home/gaoboyi/lcm/lcm-python/module.c:1:10: fatal error: Python.h: 没有那个文件或目录 1 | #include <Python.h> | ^~~~~~~~~~ compilation terminated. make[2]: *** [lcm-python/CMakeFiles/lcm-python.dir/build.make:63:lcm-python/CMakeFiles/lcm-python.dir/module.c.o] 错误 1 make[1]: *** [CMakeFiles/Makefile2:977:lcm-python/CMakeFiles/lcm-python.dir/all] 错误 2 make: *** [Makefile:163:all] 错误 2 I have the similar issue

I have the same issue.Have you solved it yet?

Install Python Dev Package: sudo apt install python3-dev

Add find_package(Python3 3.8 REQUIRED COMPONENTS Interpreter Development) to the CMakeLists.txt file.

Replace 3.8 with your Python version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants