MySQL 5 6原始碼編譯碰到的乙個問題

2021-06-26 19:36:25 字數 2284 閱讀 8648

mysql 5.6使用cmake作為編譯配置工具,筆者在centos 6.5上進行mysql 5.6.21 community server原始碼編輯時,碰到了乙個初級問題,現在重新回顧一下整個過程。

首先,筆者使用以下命令執行編譯配置。

cmake -dcmake_install_prefix=/u01/mysql

因為gcc和gcc-c++編輯器沒有安裝,直接報錯。

-- 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.

接著,安裝gcc和gcc-c++編輯器。

yum install gcc gcc-c++

接著,報另外乙個錯誤。

-- running cmake version 2.8.12.2

-- the cxx compiler identification is gnu 4.4.7

-- check for working cxx compiler: /usr/bin/c++

-- check for working cxx compiler: /usr/bin/c++ -- works

-- detecting cxx compiler abi info

-- detecting cxx compiler abi info - done

-- mysql 5.6.21

-- packaging as: mysql-5.6.21-linux-i686

-- could not find threads (missing: threads_found)

-- could not find threads (missing: threads_found)

-- check if the system is big endian

-- searching 16 bit integer

cmake error at /usr/share/cmake/modules/testbigendian.cmake:44 (message):

no suitable type found

call stack (most recent call first):

configure.cmake:647 (test_big_endian)

cmakelists.txt:416 (include)

-- configuring incomplete, errors occurred!

摸不到頭腦,上網查了一下,說原始碼檔案刪除之後重新解壓可以解決這個問題。這麼做之後,cmake的執行日誌比之前長,報錯資訊也不同了。

-- could not find curses (missing:  curses_library curses_include_path) 

cmake error at cmake/readline.cmake:85 (message):

看到是缺少另外乙個軟體包。

yum install ncurses-devel

再次執行cmake,報錯資訊還是依舊。這時,發現有報錯資訊中還有以下資訊。

remove cmakecache.txt and rerun cmake.on debian/ubuntu, package name is libncurses5-dev, on redhat and derivates it is ncurses-devel.

按照指示,刪除cmakecache.txt之後,重新cmake即可成功。刪除cmakecache.txt即告訴cmake重新進行編譯配置,其實,前面刪除原始碼也不是必須的,只要刪除cmakecache.txt即可。

mysql5 6原始碼 mysql5 6原始碼部署

一.準備環境 環境 centos 7.3 一台 軟體版本 mysql 5.6.39 1.安裝依賴 yum y install autoconf libaio bison ncurses devel 2.建立使用者 groupadd mysql useradd g mysql s sbin nolog...

mysql 5 6 原始碼 mysql5 6原始碼安裝

os環境centos6.3 yum y install gcc gcc c gcc g77 autoconf automake zlib fiex libxml ncurses libmcrypt libtool ltdl devel make cmake 必要軟體包安裝 useradd mysql...

MySQL 5 6原始碼安裝

1 解決依賴關係 yum y install cmake bison git ncurses devel gcc gcc c 2 進入到 usr local src cd usr local srcwget4 檢視mysql的大小 解壓 du sh mysql 5.6.39 linux glibc2...