Table of contents
installation steps
- Check the current cmake version:
cmake -version
- Uninstall the current cmake: (skip this step if ROS is installed)
sudo apt remove cmake
- Download cmake: You can download the new version
directly from the cmake official website , or you can execute the following statement: (just change the version number for which version you want)
wget http://www.cmake.org/files/v3.16/cmake-3.22.0.tar.gz
- Unzip and enter the directory
tar xf cmake-3.22.0.tar.gz
cd cmake-3.22.0
- Execute after entering the folder
Linux uses bootstrap.sh to produce the compilation tool b2. At the same time, you can configure the installation path. The default installation path is /usr/local. If you need to change the path, you can check the information yourself
./bootstrap
- Install
- Note:
Make can use make -j4 or make -j8 to increase the speed. Generally speaking, dual-core can use j4 and j8 to have high configuration requirements.
make && make install
Install the pit
- I forgot to record one of the error reports, but the solution is to download gcc, gcc-c++ first (the author updated this first, I don’t know if the lower version downloaded with yum is easy to use)
yum -y install gcc
yum -y install gcc-c++
- Error using ./bootstrap
-- Looking for gethostname
-- Looking for gethostname - found
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
CMake Error at Utilities/cmcurl/CMakeLists.txt:454 (message):
Could not find OpenSSL. Install an OpenSSL development package or
configure CMake with -DCMAKE_USE_OPENSSL=OFF to build without OpenSSL.
-- Configuring incomplete, errors occurred!
See also "/home/whlg/cmake-3.16.6/CMakeFiles/CMakeOutput.log".
See also "/home/whlg/cmake-3.16.6/CMakeFiles/CMakeError.log".
---------------------------------------------
Error when bootstrapping CMake:
Problem while running initial CMake
---------------------------------------------
Solution, download OpenSSL ,
CentOS commandyum install openssl-devel
ubuntu command:yum install libssl-dev