错误1
- Running cmake version 2.8.11 -- Could NOT find Git (missing: GIT_EXECUTABLE) -- Configuring with MAX_INDEXES = 64U -- The C compiler identification is unknown -- The CXX compiler identification is unknown CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name. CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name. CMake Error at cmake/os/Linux.cmake:41 (MESSAGE): Unsupported compiler! Call Stack (most recent call first): CMakeLists.txt:162 (INCLUDE)
解决办法:yum install gcc gcc-c++
错误二:
- Could not find (the correct version of) boost. -- MySQL currently requires boost_1_59_0 CMake Error at cmake/boost.cmake:81 (MESSAGE): You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory> This CMake script will look for boost in <directory>. If it is not there, it will download and unpack it (in that directory) for you. If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://example.com:80 Call Stack (most recent call first): cmake/boost.cmake:238 (COULD_NOT_FIND_BOOST) CMakeLists.txt:451 (INCLUDE)
解决办法:从MySQL 5.7.5开始Boost库是必需的
下载 mysql-boost-5.7.12.tar.g 在 cmake 指定参数 -DWITH_BOOST=boost/boost_1_59_0/
或直接cmake指定参数 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory> 系统会下载 boost
错误三:
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH) CMake Error at cmake/readline.cmake:64 (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:107 (FIND_CURSES) cmake/readline.cmake:181 (MYSQL_USE_BUNDLED_EDITLINE) CMakeLists.txt:479 (MYSQL_CHECK_EDITLINE)
解决办法:yum install ncurses-devel
安装了ncurses-devel包后,删除CMakeCache.txt,然后重新编译,编译成功
原文:http://blog.51cto.com/molujiang/2139062