MATLAB cannot find CMake on Ubuntu 20.04

22 views (last 30 days)
Phil Pesce
Phil Pesce on 25 Mar 2022
Commented: Phil Pesce on 28 Mar 2022
Hello! I've installed MATLAB 2021a into /usr/local/MATLAB/R2021a on my Ubuntu machine. I've also installed gcc, g++, and CMake (3.16.3). I am trying to use the RTI Connext DDS block set, which for some reason requires CMake even to only generate code. I've also installed RTI's toolchain, which provides the necessary commands/tools.
In a terminal, cmake -version returns the expected value, which seems to suggest the PATH was setup correctly (maybe?). cmake is installed in /usr/bin//cmake. In MATLAB, when I generate the Simulink model with the DDS blocks, I get an error that CMake is not found. Searching the web, it was suggested using the following command in MATLAB:
>> system('cmake --version')
cmake: /usr/local/MATLAB/R2021a/bin/glnxa64/libcurl.so.4: version `CURL_OPENSSL_4' not found (required by cmake)
cmake: /usr/local/MATLAB/R2021a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by cmake)
cmake: /usr/local/MATLAB/R2021a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /lib/x86_64-linux-gnu/libjsoncpp.so.1)
Doesn't look good. I'm not sure what the next step is, and everything else I've seen says to break symbolic links. I'm not thrilled with that idea, as eventually I'm going to have to rebuild my setup in a Docker container.
Help?
Thanks!

Answers (1)

Mark McBroom
Mark McBroom on 28 Mar 2022
Is R2021b or R2022a an option? We began shipping cmake with MATLAB in those releases so there is no need to install cmake separately.
If you are stuck on 21a, best guess is that the cmake version you installed is too old. Can you try installing the latest version of cmake using apt?
  1 Comment
Phil Pesce
Phil Pesce on 28 Mar 2022
Thanks, Mark!
Currently stuck on 21a, but your recommendation worked. Ubuntu apt package manager was installing CMake 3.16, which was the root cause.
I uninstalled CMake 3.16 and installed 3.22 and everything works now.
https://graspingtech.com/upgrade-cmake/

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!