Solemnly declare: This article is written by the author based on my personal understanding. errors are inevitable. Please be prepared!
You can reprint, modify, and indicate the source when reprinting!
Download the latest cmakescripts from cmakeofficial network, the pen download is cmake-2.8.10.2.tar.gz, address http://www.cmake.org/cmake/resources/software.html
1、decompress cmake-2.8.10.2.tar.gz
tar -xvf cmake-2.8.10.2.tar.gz
2. Create a new compilation directory under the same directory of the cmake-2.8.10.2
mkdir cmake-bulidcd cmake-build
3. Compile cmake
.././bootstrap
Note: The following error may occur:
/Usr/lib/libstdc ++. so.6: Version 'glibcxx _ 3.4.15 'not found
This is because I updated the Ubuntu GCC compiler.
Solution:
A. Check that libstdc ++. so.6 supports glibc.
strings /usr/lib/libstdc++.so.6 | grep GLIBC
Output:
GLIBCXX_3.4GLIBCXX_3.4.1GLIBCXX_3.4.2GLIBCXX_3.4.3GLIBCXX_3.4.4GLIBCXX_3.4.5GLIBCXX_3.4.6GLIBCXX_3.4.7GLIBCXX_3.4.8GLIBCXX_3.4.9GLIBCXX_3.4.10GLIBCXX_3.4.11GLIBCXX_3.4.12GLIBCXX_3.4.13GLIBC_2.0GLIBC_2.3GLIBC_2.1GLIBC_2.1.3GLIBC_2.3.2GLIBC_2.2GLIBCXX_FORCE_NEWGLIBCXX_DEBUG_MESSAGE_LENGTH
Glibcxx_3.4.15 is not supported. Here, the GCC 4.7 installed in Ubuntu
ls /usr/local/gcc-4.7.2/
Output:
bin include lib libexec share
Copy libstdc ++. so.6 and libstdc ++. so.6.0.17 under the/usr/local/gcc-4.7.2/lib/directory to the/usr/lib/directory:
sudo cp /usr/local/gcc-4.7.2/lib/libstdc++.so.6 /usr/lib/sudo cp /usr/local/gcc-4.7.2/lib/libstdc++.so.6.0.17 /usr/lib/sudo rm -f /usr/lib/libstdc++.so.6.0.13
Delete the old libstdc ++. so.6 link, create a new link, and delete libstdc ++. so.6.0.13:
sudo ln -sf /usr/lib/libstdc++.so.6.0.17 /usr/lib/libstdc++.so.6sudo rm -f /usr/lib/libstdc++.so.6.0.13
Now, let's go back to compiling cmake. Repeat the preceding command:
.././bootstrap
Note: At this time, we are still under the cmake-bulid directory.
After the preceding command is successful, run the following two commands:
makesudo make install
Check whether cmake is successfully installed:
cmake --version
Output:
cmake version 2.8.10.2
Congratulations! The installation is successful.