필터 지우기
필터 지우기

No rule to make target python3.9a when running ros2genmsg

조회 수: 10 (최근 30일)
Max Hochlenert
Max Hochlenert 2022년 9월 8일
이동: Remo Pillat 2023년 11월 10일
Hi,
I am trying to read a ros2 bag file into Matlab. Since this bag file contains custom msgs, I understand that I need to run ros2genmsg on the directories containing the packages with the definitions of theses msgs.
  1. Freshly installed Ubuntu 20.04
  2. Installed python3.9, python3.9-dev
  3. set pyenv to the python3.9 path
  4. run ros2genmsg on directory
  5. Matlab starts building the msg interfaces
  6. Make fails with make[2]: *** No rule to make target '/home/user/.matlab/R2022a/ros2/glnxa64/venv/lib/libpython3.9.a', needed by 'rosidl_generator_py/XXXXXXXXmsgs/libXXXXXXXXmsgs__python.so'. Stop.
What am I doing wrong?
Identifying message files in folder '/home/user/packages/my_msg'..Done.
Validating message files in folder '/home/user/packages/my_msg'..Done.
[2/2] Generating MATLAB interfaces for custom message packages... Done.
Running colcon build in folder '/home/user/packages/my_msg/matlab_msg_gen/glnxa64'.
Build in progress. This may take several minutes...Error using ros.internal.ROSProjectBuilder/buildPackage
Error building package: build log.
Error in ros2genmsg (line 279)
buildPackage(builder, [], ' --merge-install', colconMakeArgs); %other messages might need to be present in the same directory
Error in ground_non_ground (line 2)
ros2genmsg("/home/user/packages/my_msg")
  댓글 수: 1
Max Hochlenert
Max Hochlenert 2022년 9월 12일
편집: Max Hochlenert 2022년 9월 12일
Hi Hari,
your seconds suggestion did the trick. I had installed a pre-built version of python3.9 before, that had appearently not been compiled with the --enable-shared option.
I followed this manual: https://linuxize.com/post/how-to-install-python-3-9-on-ubuntu-20-04/ to compile my own python3.9 and set the configure option --enable-shared. Then I deleted the temporary matlab files in the package directory, and now it works.
Thank you.

댓글을 달려면 로그인하십시오.

답변 (1개)

Hari Krishna Kakarla
Hari Krishna Kakarla 2022년 9월 12일
이동: Remo Pillat 2023년 11월 10일
Hi Max,
It looks like, this is an issue with MATLAB Installation. I see that you have installed python3.9-dev. Please install python3.9-venv as well and re-create the python virtual environment.
  1. Install python 3.9-venv
  2. Point pyenv to installed python in MATLAB.
  3. ros.ros2.internal.createOrGetLocalPython(true)
Now ros2genmsg should work. If you are encountering the same error again, then you might need to re-install your python by setting "--enable-shared" flag:
  1. PYTHON_CONFIGURE_OPTS="--enable-shared"
  2. Now, re-install the required python.
  3. ros.ros2.internal.createOrGetLocalPython(true)
After doing above steps, ros2genmsg should work. I hope this solves the problem. Please let me know if you are still encountering the errors.
Thanks
Hari

카테고리

Help CenterFile Exchange에서 COM Component Integration에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by