1. 程式人生 > >remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.

remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.

如果cmake提示下列錯誤:
......
CMake Error at cmake/readline.cmake:85 (MESSAGE):
  Curses library not found.  Please install appropriate package,
      remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
  cmake/readline.cmake:128 (FIND_CURSES)
  cmake/readline.cmake:202 (MYSQL_USE_BUNDLED_EDITLINE)
  CMakeLists.txt:409 (MYSQL_CHECK_EDITLINE)
-- Configuring incomplete, errors occurred!


Debian/Ubuntu下需要安裝libncurses5-dev;Redhat下需要安裝ncurses-devel ,檢查是否安裝了ncurses包,如下所示,
缺少ncurses-devel包。檢查和安裝該包:
rpm -qa | grep ncurses
rpm -ivh ncurses-devel

安裝方法、

下載地址:

http://mirror.centos.org/centos/6/os/x86_64/Packages/ncurses-devel-5.7-4.20090207.el6.x86_64.rpm

http://mirror.centos.org/centos/6/os/x86_64/Packages/ncurses-libs-5.7-4.20090207.el6.x86_64.rpm

devel安裝需要依賴libs,執行以下命令:

rpm -ivh ncurses-libs-5.7-4.20090207.el6.x86_64.rpm

rpm -ivh ncurses-devel-5.7-4.20090207.el6.x86_64.rpm

安裝了ncurses-devel包後,rm刪除/soft/mysql-5.6.26/CMakeCache.txt,然後上述cmake重新編譯,編譯成功。
             
注意:
如果沒有編譯成功,需要重新編譯,需要清除舊的物件檔案和快取資訊。
# make clean
# rm -f CMakeCache.txt
# rm -rf /etc/my.cnf