准备工作
安装SSL,我没安装第一步就报错。
sudo apt-get install openssl
sudo apt-get install libssl-dev
sudo apt-get install gcc
sudo apt-get install g++
官网下载最新版本。
解压、进入、编译、安装
cd ./CMake-3.18.6
./bootstrap
make -j8
sudo make install
查看
cmake --version
日志记录
kobosp@KOBOSPP53:/media/kobosp/移动2/software-install/Ubuntu_install/CMake-3.18.
6$ sudo apt-get install openssl
[sudo] kobosp 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
openssl 已经是最新版 (1.0.2g-1ubuntu4.18)。
下列软件包是自动安装的并且现在不需要了:
snapd-login-service
使用'sudo apt autoremove'来卸载它(它们)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
kobosp@KOBOSPP53:/media/kobosp/移动2/software-install/Ubuntu_install/CMake-3.18.
6$ sudo apt-get install libssl-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
下列软件包是自动安装的并且现在不需要了:
snapd-login-service
使用'sudo apt autoremove'来卸载它(它们)。
将会同时安装下列软件:
libssl-doc zlib1g-dev
下列【新】软件包将被安装:
libssl-dev libssl-doc zlib1g-dev
升级了 0 个软件包,新安装了 3 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
需要下载 2,591 kB 的归档。
解压缩后会消耗 10.5 MB 的额外空间。
您希望继续执行吗? [Y/n] Y
获取:1 http://mirrors.ustc.edu.cn/ubuntu xenial-updates/main amd64 zlib1g-dev amd64 1:1.2.8.dfsg-2ubuntu4.3 [167 kB]
获取:2 http://mirrors.ustc.edu.cn/ubuntu xenial-updates/main amd64 libssl-dev amd64 1.0.2g-1ubuntu4.18 [1,347 kB]
获取:3 http://mirrors.ustc.edu.cn/ubuntu xenial-updates/main amd64 libssl-doc all 1.0.2g-1ubuntu4.18 [1,078 kB]
已下载 2,591 kB,耗时 1秒 (1,547 kB/s)
正在选中未选择的软件包 zlib1g-dev:amd64。
(正在读取数据库 ... 系统当前共安装有 230106 个文件和目录。)
正准备解包 .../zlib1g-dev_1%3a1.2.8.dfsg-2ubuntu4.3_amd64.deb ...
正在解包 zlib1g-dev:amd64 (1:1.2.8.dfsg-2ubuntu4.3) ...
正在选中未选择的软件包 libssl-dev:amd64。
正准备解包 .../libssl-dev_1.0.2g-1ubuntu4.18_amd64.deb ...
正在解包 libssl-dev:amd64 (1.0.2g-1ubuntu4.18) ...
正在选中未选择的软件包 libssl-doc。
正准备解包 .../libssl-doc_1.0.2g-1ubuntu4.18_all.deb ...
正在解包 libssl-doc (1.0.2g-1ubuntu4.18) ...
正在处理用于 man-db (2.7.5-1) 的触发器 ...
正在设置 zlib1g-dev:amd64 (1:1.2.8.dfsg-2ubuntu4.3) ...
正在设置 libssl-dev:amd64 (1.0.2g-1ubuntu4.18) ...
正在设置 libssl-doc (1.0.2g-1ubuntu4.18) ...
kobosp@KOBOSPP53:/media/kobosp/移动2/software-install/Ubuntu_install/CMake-3.18.
6$ sudo ./bootstrap
---------------------------------------------
CMake 3.18.6, Copyright 2000-2020 Kitware, Inc. and Contributors
Found GNU toolchain
C compiler on this system is: gcc
C++ compiler on this system is: g++ -std=gnu++17
Makefile processor on this system is: make
g++ has setenv
g++ has unsetenv
g++ does not have environ in stdlib.h
g++ has stl wstring
g++ has <ext/stdio_filebuf.h>
---------------------------------------------
make: 'cmake' is up to date.
loading initial cache file /media/kobosp/移动2/software-install/Ubuntu_install/CMake-3.18.6/Bootstrap.cmk/InitialCacheFlags.cmake
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.0.2g")
-- Looking for openssl/crypto.h
-- Looking for openssl/crypto.h - found
-- Looking for openssl/err.h
-- Looking for openssl/err.h - found
-- Looking for openssl/pem.h
-- Looking for openssl/pem.h - found
-- Looking for openssl/rsa.h
-- Looking for openssl/rsa.h - found
-- Looking for openssl/ssl.h
-- Looking for openssl/ssl.h - found
-- Looking for openssl/x509.h
-- Looking for openssl/x509.h - found
-- Looking for openssl/rand.h
-- Looking for openssl/rand.h - found
-- Looking for RAND_status
-- Looking for RAND_status - not found
-- Looking for RAND_screen
-- Looking for RAND_screen - not found
-- Looking for RAND_egd
-- Looking for RAND_egd - not found
-- Found NGHTTP2: cmnghttp2
-- Looking for idn2_lookup_ul in idn2;dl;/usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so;cmnghttp2
-- Looking for idn2_lookup_ul in idn2;dl;/usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so;cmnghttp2 - not found
-- Looking for dlopen in dl;/usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so;cmnghttp2
-- Looking for dlopen in dl;/usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so;cmnghttp2 - not found
-- Looking for include files stdio.h, inttypes.h
-- Looking for include files stdio.h, inttypes.h - found
。。。。。。
kobosp@KOBOSPP53:/media/kobosp/移动2/software-install/Ubuntu_install/CMake-3.18.6$ cmake --version
cmake version 3.18.6
CMake suite maintained and supported by Kitware (kitware.com/cmake).
kobosp@KOBOSPP53:/media/kobosp/移动2/software-install/Ubuntu_install/CMake-3.18.6$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
kobosp@KOBOSPP53:/media/kobosp/移动2/software-install/Ubuntu_install/CMake-3.18.6$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.