matlab 2020b rosgenmsg can't find CMake?
이전 댓글 표시
Hello,
I used rosgenmsg for ROS1 with Matlab 2020a on Ubuntu 18.04 and it worked fine. Now I'm trying the same command on Matlab 2020b on Ubuntu 20.04. It seems there's a whole new build system using Python and a C++ compiler in the backend instead of Java. I now get an error about CMake not found:
Validating message files in folder '/home/anton/catkin_ws/src/crtk'..Done.
[0/1] Generating MATLAB interfaces for custom message packages... 0%Error using ros.internal.utilities.getCMakeBinaryPath (line 24)
Could not find CMake in your system. Please install CMake version 3.15.5 or higher and rerun the command.
Error in ros.internal.CatkinBuilder.getCMakePath (line 82)
[aPath, aVersion] =
ros.internal.utilities.getCMakeBinaryPath(ros.internal.CatkinBuilder.CMAKEMINVERSION);
Meawhile, CMake is installed (using apt):
~$ cmake --version
cmake version 3.16.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
~$ which cmake
/usr/bin/cmake
Any advice on how to proceed to fix this issue? Also, I'm interested in ROS 1 messages (Noetic), not ROS 2.
채택된 답변
추가 답변 (2개)
Jakobus Louw
2021년 6월 12일
편집: Stefanie Schwarz
2021년 9월 27일
I had to use a different solution since the above solution did not solve the problem for me. I am using Matlab R2021a and Ubuntu 18.
Running:
!cmake --version
in MATLAB command window produced the follwing error:
cmake: /usr/local/MATLAB/R2021a/bin/glnxa64/libcurl.so.4: version `CURL_OPENSSL_4' not found (required by cmake)
This is what worked for me:
It seems that the installed cmake version for Ubuntu 18 is v3.10, but Matlab needs version v3.15+ for ROS Toolbox.
Therefore I downloaded version 3.20 from https://cmake.org/download/ and installed it using this answer (NB: without removing the previous cmake).
Remember to add the export lines to your .bashrc
I could then succesfully run:
folderpath = fullfile('~/catkin_ws/src/mavros')
rosgenmsg(folderpath)
to build mavros_msg
댓글 수: 2
Vincenzo Petrone
2021년 7월 22일
편집: Vincenzo Petrone
2021년 7월 22일
I'm sorry, this didn't work for me. I followed the same procedure you mentioned, but when I run
!which cmake
I still get
/usr/bin/cmake
Then, if I run
!cmake --version
I obtain the same output as before:
cmake: /usr/local/MATLAB/R2021a/bin/glnxa64/libcurl.so.4: version `CURL_OPENSSL_4' not found (required by cmake)
Instead, when I run the same commands on the Linux terminal, I get the right path:
/home/<user>/cmake-install/bin/cmake
and the right version I installed:
cmake version 3.21.0
I also added the "export" lines in ".bashrc".
Anyone got the same error and solved?
Maxfield Canto
2021년 12월 10일
Hello Vincenzo,
I am having the same exact issue as you. Have you found a solution?
Neel Bhatt
2021년 7월 24일
편집: Neel Bhatt
2021년 7월 24일
Jakobus Louw's answer worked for me.
Note:
- There should be a correction to the cmake version: all the 1.xx versions listed in the answer mean 3.xx - i.e. Matlab 2021a needs cmake version 3.15+ (not 1.15+), but overall the steps outlined in this answer are correct.
To summarize: you can follow the following steps:
- Download cmake 3.20.5 from https://cmake.org/download/
- Open a terminal and run the following
- cd ~/Downloads/cmake-3.20.5/ # or wherever you downloaded cmake
- ./bootstrap --prefix=$HOME/cmake-install
- make
- make install
- export PATH=$HOME/cmake-install/bin:$PATH
- export CMAKE_PREFIX_PATH=$HOME/cmake-install:$CMAKE_PREFIX_PATH
- matlab
- !cmake --version # Check cmake version: it should be 3.20.5
You can now generate custom messages. You may need to generate custom messages using:
folderpath = 'PATH_TO_YOUR_MESSAGE_PACKAGE'
rosgenmsg(folderpath)
% Follow the next steps that appear in the command window
% For instance, if you are using ROS1:
% Note you may not have permissions to run the following two commands
% which will lead to a warning. In this case, close MATLAB and in the
% same terminal (where you ran exports), run MATLAB with sudo access: sudo matlab
addpath('PATH_TO_YOUR_MESSAGE_PACKAGE/matlab_msg_gen_ros1/glnxa64/install/m')
savepath
clear classes
rehash toolboxcache
rosmsg list % Confirm you have your custom message show up
댓글 수: 1
Stefanie Schwarz
2021년 9월 27일
Thank you, I fixed this in Jacobus' answer to avoid confusion.
카테고리
도움말 센터 및 File Exchange에서 Network Connection and Exploration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!