一、背景
需要编译一个代码,使用cmake, 然后发现cmake版本低于要求,重新装后,发现运行不起。
二、环境说明$cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
cmake --version
cmake version 2.8.12.2
三、源码编译升级$ tar xf cmake-3.18.0-rc3.tar.gz
$ cd cmake-3.18.0-rc3/
$ ./configure
$ make
$sudo make install
$ cmake --version
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/local/bin
段错误(吐核)
使用hash命令解决hash -r
cmake --version
cmake version 3.18.0-rc3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
四、原因
因上网查询直接使用hash解决了,实际具体问题未知,后续再出现后再记录下。