MATLAB cannot find CMake on Ubuntu 20.04
39 views (last 30 days)
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.
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?