1. 问题描述
Downloads$ wget https://cmake.org/files/v3.18/cmake-3.18.0.tar.gz
Downloads$ tar xf cmake-3.18.0.tar.gz
Downloads$ cd cmake-3.18.0/
cmake-3.18.0$ ./configure --prefix=$(pwd)/local
。。。。。
-- Looking for connect in socket;dl
-- Looking for connect in socket;dl - not found
-- Looking for gethostbyname in c
-- Looking for gethostbyname in c - found
-- Looking for recv in network;dl
-- Looking for recv in network;dl - not found
-- 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:485 (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/t31/Downloads/cmake-3.18.0/CMakeFiles/CMakeOutput.log".
See also "/home/t31/Downloads/cmake-3.18.0/CMakeFiles/CMakeError.log".
---------------------------------------------
Error when bootstrapping CMake:
Problem while running initial CMake
---------------------------------------------
2. 解决办法
就是报告没有安装openssl,但是我在命令行下执行openssl时找到了已经安装的openssl,而且重复安装会报错:
cmake-3.18.0$ openssl version
OpenSSL 1.1.1 11 Sep 2018
cmake-3.18.0$$ sudo apt-get install openssl
[sudo] password for t31:
Reading package lists... Done
Building dependency tree
Reading state information... Done
openssl is already the newest version (1.1.1-1ubuntu2.1~18.04.20).
The following packages were automatically installed and are no longer required:
linux-hwe-5.4-headers-5.4.0-109 linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-117 linux-hwe-5.4-headers-5.4.0-120 linux-hwe-5.4-headers-5.4.0-121
linux-hwe-5.4-headers-5.4.0-122 linux-hwe-5.4-headers-5.4.0-84
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 44 not upgraded.
最后发现是缺少openssl的开发版本,安装如下:
sudo apt-get install libssl-dev