但如果套件沒有安裝齊全,就會遇到下面一連串的錯誤.
MariaDB cmake
[root@benjr mariadb-10.1.16]# cmake . ...... -- Running cmake version 2.8.11 -- The CXX compiler identification is unknown CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name. -- MariaDB 10.1.16 -- Packaging as: mariadb-10.1.16-Linux-x86_64 -- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH) 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:196 (FIND_CURSES) CMakeLists.txt:334 (MYSQL_CHECK_READLINE) -- Configuring incomplete, errors occurred! [root@benjr mariadb-10.1.16]# yum install cmake ncurses-devel [root@benjr mariadb-10.1.16]# rm CMakeCache.txt
需要 Curses library (RedHat derivates it is ncurses-devel) ,並需要確認 cmake 版本不能太舊.移掉 CMakeCache.txt 再做一次.
[root@benjr mariadb-10.1.16]# cmake . ...... CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage CMake Error: Internal CMake error, TryCompile configure of cmake failed -- Performing Test HAVE_SOCKPEERCRED - Failed -- Performing Test HAVE_XUCRED CMake Error at /usr/share/cmake/Modules/CMakeCXXInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage CMake Error: Internal CMake error, TryCompile configure of cmake failed -- Performing Test HAVE_XUCRED - Failed -- Performing Test SUPPORTS_VERSION_IN_LINK_SCRIPT -- Performing Test SUPPORTS_VERSION_IN_LINK_SCRIPT - Success -- Looking for event.h -- Looking for event.h - not found Warning: Bison executable not found in PATH -- Configuring incomplete, errors occurred! [root@benjr mariadb-10.1.16]# yum install bison
缺少 bison 套件.
[root@benjr mariadb-10.1.16]# cmake . ...... -- The CXX compiler identification is unknown CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name. -- MariaDB 10.1.16 -- Packaging as: mariadb-10.1.16-Linux-x86_64 CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name. -- checking for one of the modules 'libsystemd;libsystemd-daemon' -- Systemd features not enabled 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: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_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. -- Could NOT find LibXml2 (missing: LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR) -- Could NOT find Java (missing: Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE) (Required is at least version "1.6") -- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) -- Configuring incomplete, errors occurred! CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage CMake Error: Internal CMake error, TryCompile configure of cmake failed -- Performing Test HAVE_SOCKPEERCRED - Failed -- Performing Test HAVE_XUCRED CMake Error at /usr/share/cmake/Modules/CMakeCXXInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage CMake Error: Internal CMake error, TryCompile configure of cmake failed -- Performing Test HAVE_XUCRED - Failed -- Performing Test SUPPORTS_VERSION_IN_LINK_SCRIPT -- Performing Test SUPPORTS_VERSION_IN_LINK_SCRIPT - Success -- Looking for event.h -- Looking for event.h - not found -- Configuring incomplete, errors occurred! [root@benjr mariadb-10.1.16]# yum install gcc gcc-c++
gcc gcc-c++ 套件需要更新
[root@benjr mariadb-5.5.51]# cmake -DWITH_WSREP=ON -DWITH_INNODB_DISALLOW_WRITES=ON ./ -- Running cmake version 2.8.11 -- MariaDB 5.5.51 -- Packaging as: mariadb-galera-5.5.51-Linux-x86_64 -- INNODB_DISALLOW_WRITES -- Could NOT find Boost CMake Warning at storage/tokudb/CMakeLists.txt:17 (MESSAGE): TokuDB is enabled, but jemalloc is not. This configuration is not supported -- Configuring done -- Generating done -- Build files have been written to: /root/mariadb-5.5.51 [root@benjr mariadb-10.1.16]# yum install boost
缺少 Boost 套件.
[root@benjr mariadb-10.1.16]# cmake . ...... -- Performing Test HAVE_STDCXX11 - Failed -- Performing Test HAVE_STDCXX0X -- Performing Test HAVE_STDCXX0X - Failed CMake Error at storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake:178 (message): /usr/bin/c++ doesn't support -std=c++11 or -std=c++0x, you need one that does. Call Stack (most recent call first): storage/tokudb/PerconaFT/CMakeLists.txt:38 (include) -- Configuring incomplete, errors occurred! [root@benjr mariadb-10.1.16]# cmake -DWITHOUT_TOKUDB=1 .
不知道為什麼要加入參數,取消對 TOKUDB 支援.才能編譯成功.
MariaDB , make , make instll
[root@benjr mariadb-10.1.16]# make ...... linking CXX share library libft.so /bin/ld: can't find -lz collect2: error: ld returned 1 exit status make[2]: *** [storage/tokudb/PerconaFT/ft/libft.so] Error 1 make[1]: *** [storage/tokudb/PerconaFT/ft/CMakeFiles/ft.dir/all] Error 2 make: *** [all] Error 2 [root@benjr mariadb-10.1.16]# yum install zlib-devel
缺少 zlib-devel 套件.
沒有解決問題,試試搜尋本站其他內容
4 thoughts on “編譯 MariaDB 常見問題”