CMake not found when using rosgenmsg on Windows

I ran into the similar problems desribed here with the difference of me having Matlab 2021b which is installed on Windows 10. I, too, use Ros1 (Noetic, running over WSL) and tried to run rosgenmsg with the path to the messages which results in the following error:
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.
I tried several different things:
  • Different versions of Cmake (3.15.5, 3.22), I added them to path while installing, added them to path via Matlab.
  • A different PC with same versions of software, but a more up to date windows version, same Problem.
  • Different Installation folders (C:/..., C/Programms/..., D/... and so on) With blank spaces in the path and without etc.
  • Most of the solutions in the post linked above sadly dont apply to my version of the problem and the others didnt work for me.
The following command (in Matlab) give the following results back:
  • "!cmake --version" gives me:
"cmake version 3.15.5
CMake suite maintained and supported by Kitware (kitware.com/cmake)."
In a windows terminal "cmake --version gives the same result as above, so verything seems to be normal

9 个评论

Hi Albert,
Sorry for the inconvenience.
Can you please let me know the output of the following command on your MATLAB to help you further ?
[status, result] = system('cmake --version')
Thanks,
Jagadeesh K.
Hi Jagadeesh,
status =
0
result =
'cmake version 3.15.5
CMake suite maintained and supported by Kitware (kitware.com/cmake).
'
is what i get.
Hi Albert,
The actual fix for this issue will be addressed in the next update release of R2021b. The update will be available soon.
For now, on your MATLAB installation, Can you replace code in the line number 22 of the file ros.internal.utilities.getCMakeBinaryPath with the following code. Let me know if this helps.
if ispc
[status, result] = system('cmake --version')
else
[status, result] = system('env LD_LIBRARY_PATH= cmake --version');
end
Hi,
it seems to work, now I get the next error.
"Error using ros.internal.ROSProjectBuilder (line 419)
Current compiler MinGW64 Compiler (C++) is not supported for ROS build. To choose a compiler, run 'mex -setup cpp'."
I did that and get: "MEX configured to use 'MinGW64 Compiler (C++)' for C++ language compilation."
But that results in the same error.
I need Visual Studio 2017 as a compiler, is that right? And what exactly do I need from it, the whole Programm or just a specific dependency? How do I set it up to use that, after I installed it?
Thanks in advance
Albert
Yes Albert. You need to install VS 2017 for custom message generation from ROS toolbox. Please follow the default instructions of Visual studios and let me know if you run into issues with rosgenmsg.
Thanks,
Jagadeesh K.
Hi again ...,
I've installed Visual Studio 2017 and set it as compiler. It does much more than before, so some things seem to be working now. Unfortunately this is the new error I recveive:
Identifying message files in folder 'C:/Users/Albert/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc/LocalState/rootfs/home/albert/fasttube/chabo-as/src'..Done.
Validating message files in folder 'C:/Users/Albert/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc/LocalState/rootfs/home/albert/fasttube/chabo-as/src'..Done.
[1/1] Generating MATLAB interfaces for custom message packages... Done.
Running catkin build in folder 'C:/Users/Albert/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc/LocalState/rootfs/home/albert/fasttube/chabo-as/src/matlab_msg_gen_ros1/win64'.
Build in progress. This may take several minutes...Error using ros.internal.ROSProjectBuilder/buildPackage (line 552)
Error building package: build log.
Error in rosgenmsg (line 483)
buildPackage(builder, [], 'install', catkinMakeArgs); %other messages might need to be present in the same directory.
I then can open build log (I copied the content into a txtfile and uploaded it here).
Thanks,
Albert
Hi Albert,
From the CMAKE error log, it looks issue with your Microsoft Visual Studio 2017 installation. The CMAKe is not able to compile simple C++ test program with Visual sudio compiler.
It would be good to compile simple hello world program in VS 2017 IDE to make sure that your installation is correct.
Please contact MathWorks Technical Support for further assistance.
Thanks,
Jagadeesh K.
Good Morning,
I have the same problem on a Windows 10 machine and Matlab 2021b. I also tried different versions of CMake but no difference. Perhaps, there was a solution on this issue? I already gave a message to the Matlab Support but wanted to give it a try here.
Thanks and best wishes
Stefan
Hi Stefan,
which problem exactly? Because as far as I can remember there were 2 parts to the solution. The more important part was to copy the custom msg folder onto windows (somewhere, doesnt really matter where exactly) and then run the command. Beforehand I tried to do it with the path to the WSL system which didn't work. This still requires a working visual studio compiler though, so you have to make that work as well. For me, visual studio 2017 worked.
Kind regards,
Albert

请先登录,再进行评论。

回答(1 个)

The fix for this issue is addressed in the update release of R2021b. Please use the latest update release of R2021b

类别

产品

版本

R2021b

标签

Community Treasure Hunt

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

Start Hunting!

Translated by