How to solve errors from ros2genmsg about libcurl and libpython3.7m.a in R2021b?
3 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2022 年 1 月 24 日
編集済み: MathWorks Support Team
2023 年 5 月 29 日
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
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!