How to solve errors from ros2genmsg about libcurl and libpython3.7m.a in R2021b?

I'm using ROS2 and MATLAB R2021b on Ubuntu 20.04.
When I try to build a message(tf2_msgs) by ros2genmsg, I failed with an error and got error logs like below.
/usr/bin/cmake: /usr/local/MATLAB/R2021b/bin/glnxa64/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /usr/local/MATLAB/R2021b/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/bin/cmake)
/usr/bin/cmake: /usr/local/MATLAB/R2021b/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /lib/x86_64-linux-gnu/libjsoncpp.so.1)
I found some solutions for the error about libcurl.so.
https://jp.mathworks.com/matlabcentral/answers/623103-matlab-2020b-rosgenmsg-can-t-find-cmake#comment_1088683
https://jp.mathworks.com/matlabcentral/answers/623103-matlab-2020b-rosgenmsg-can-t-find-cmake#answer_753184
These solution could overcome the above error about libcurl.so.
However, I met a new error about python after that.
/usr/bin/ld: /home/<username>/.matlab/R2021b/ros2/glnxa64/venv/lib/libpython3.7m.a(abstract.o): relocation R_X86_64_PC32 against symbol `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
How can I escape this error and use ros2genmsg?

 채택된 답변

MathWorks Support Team
MathWorks Support Team 2023년 5월 29일
편집: MathWorks Support Team 2023년 5월 29일
Generally, the error about `_Py_NotImplementedStruct' often resolves by re-installing python with setting '--enable-shared' option.
https://stackoverflow.com/questions/42582712/relocation-r-x86-64-32s-against-py-notimplementedstruct-can-not-be-used-when
You can check whether your python is installed with 'enable-shared' option or not by $ ./python3 -m sysconfig command in the directory which python is installed (like "~/.pyenv/versions/3.7.**").
If the python isn't installed with the option, setting PYTHON_CONFIGURE_OPTS variable like below and re-installing python might be a solution.
$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.7.12

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Publishers and Subscribers에 대해 자세히 알아보기

제품

릴리스

R2021b

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by