cmake编译问题解决

2 安装cmake软件包
yum install cmake

3 create account of mysql
groupadd mysql           
useradd -g mysql mysql           
autoreconf --force --install
libtoolize --automake --force
automake --force --add-missing

4  complie the sources
mkdir -p /data/mbdata
tar -xvf mysql-5.6.13.tar.gz 

5 cmake

 time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci

[root@472322 mysql-5.6.13]# time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
-- Running cmake version 2.6.4
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:/root/mysql-5.6.13/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:/root/mysql-5.6.13/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

real    0m0.017s
user    0m0.006s
sys     0m0.005s

6 上一步cmake报错了,google得知需要重新yum make下

yum install make
ok

再继续去cmake
[root@472322 mysql-5.6.13]# time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
-- Running cmake version 2.6.4
-- 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.
-- Searching 16 bit integer
CMake Error at /usr/share/cmake/Modules/TestBigEndian.cmake:31 (MESSAGE):
  no suitable type found
Call Stack (most recent call first):
  configure.cmake:621 (TEST_BIG_ENDIAN)
  CMakeLists.txt:314 (INCLUDE)

这个错误很诡异,google上面有很多,但是每种情况都不同,我只好一个个去try了

-- Configuring incomplete, errors occurred!

报错如下: CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found.
 没有安装 gcc 和 gcc-c++,执行cmake报如上错误:
 第一次尝试,执行
yum install -y gcc
yum install -y gcc-c++

7  继续cmake

time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci

-- Searching 16 bit integer
CMake Error at /usr/share/cmake/Modules/TestBigEndian.cmake:31 (MESSAGE):
  no suitable type found
Call Stack (most recent call first):
  configure.cmake:621 (TEST_BIG_ENDIAN)
  CMakeLists.txt:314 (INCLUDE)
-- Configuring incomplete, errors occurred!

第二次尝试,有人说需要安装至少5种包
[root@472322 mysql-5.6.13]# 
yum install gcc gcc-c++
    yum install -y ncurses-devel.x86_64
    yum install -y cmake.x86_64
    yum install -y libaio.x86_64
    yum install -y bison.x86_64
yum install -y gcc-c++.x86_64

然后再cmake,还是报原来的错误

最后决定用土办法了,删除所有的已经安装过的,重新再来做一遍吧。

[解决办法]:删除原来的mysql-5.6.13目录,重新解压缩tar.gz包

rm -rf /root/mysql-5.6.13
cd /root/
tar -xvf mysql-5.6.13.tar.gz 
cd /root/mysql-5.6.13
time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci

OK,成功了,对linux底层不太熟悉,难道是因为前面没有事先安装好各种包而cmake出来错误的东西导致后面继续cmake就一直报错吗? 是否是需要准备好各种lib包然后才能yum install cmake呢?然后再安装mysql才能不报错呢?

8 build the db directy
time make 
time make install

9 init db
ll /usr/local/mysql56/
cd /usr/local/mysql56/
chown -R mysql .
chgrp -R mysql .
cp support-files/my-default.cnf /etc/my56.cnf
scripts/mysql_install_db  --user=mysql --basedir=/usr/local/mysql56 --datadir=/data56 --defaults-file=/etc/my56.cnf
[root@472322 mysql56]# scripts/mysql_install_db  --user=mysql --basedir=/usr/local/mysql56 --datadir=/data56 --defaults-file=/etc/my56.cnf

  /usr/local/mysql56/bin/mysqladmin -u root password 'new-password'
  /usr/local/mysql56/bin/mysqladmin -u root -h 472322.ea.com password 'new-password'

Alternatively you can ru
--defaults-file argument to mysqld_safe when starting the server

感到信息有warning,那就重新再执行一遍,原来在做5.6.10安装测试的时候,init db不管第一次执行失败或者成功,都可以再执行第二遍的。

时间: 2024-09-12 13:24:17

cmake编译问题解决的相关文章

mysql 5.6中使用cmake编译

mysql5.6以上的版本采用的cmake编译,和之前的5.5用../configure编译有差别,对于新的编译方法,可以查看cmake的帮助参数,选择适合自己的参数 shell>cmake . -LH -- MySQL 5.6.3-m6 -- Could NOT find Curses (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH) CMake Error at cmake/readline.cmake:83 (MESSAGE): Curses l

图像处理-cmake编译的opencv3.0.0生成的工程无法通过编译

问题描述 cmake编译的opencv3.0.0生成的工程无法通过编译 我在windows下用cmake-gui编译opencv3.0(联合opencv contrib master), 生成的工程Opencv.sln在build的时候出现了许多下列类似的错误: 请问这是什么原因呢? 系统是windows10,vs2013 解决方案 http://www.opencv.org.cn/archiver/?tid-35547.html 解决方案二: http://www.nmtree.net/201

使用 gcc 和 CMake 编译简单的 OpenCV 程序

使用 gcc 和 CMake 编译简单的 OpenCV 程序 注意 我们假设你已经成功的安装 OpenCV . 在你的项目中使用 OpenCV 的最简单方式是用 CMake. 优点是 (来自官方 Wiki): 支持 Windows 和 Linux,无需任何改动 和轻松和其他支持 CMake 的工具一起使用( 例如 Qt, ITK 和 VTK ) 如果你对 CMake 不熟悉,请参考 教程 步骤 使用 OpenCV 创建一个简单应用 DisplayImage.cpp 如下 #include <st

用cmake编译opencv3.0 时候出现的问题

问题描述 用cmake编译opencv3.0 时候出现的问题 CMake Error at CMakeLists.txt:88 (project): No CMAKE_C_COMPILER could be found. 这是什么问题啊! 求大神解决 我是win764位 刚下的opencv3.0 用cmake进行configure就出错 安装的是vs2010 解决方案 Configure中的VC++配置的版本不对,不是你机器上安装的那个版本.点击界面中的Configure 按钮进去修改一下,改为

Ubuntu 源码cmake编译安装 mysql 5.6.12数据库

环境 ubuntu 12.04桌面版,mysql 5.6.12 mysql需要使用cmake编译,所以,先安装cmake  代码如下 复制代码 sudo apt-get install cmake 配置编译参数:  代码如下 复制代码 cmake -DCMAKE_INSTALL_PREFIX=/home/fhp/server/mysql -DSYSCONFDIR=/home/fhp/server/mysql -DMYSQL_DATADIR=/home/fhp/server/mysql/data

Linux中用cmake编译mysql5.5数据库源码安装教程

MySQL自5.5版本以后,就开始使用cmake编译工具,所以这篇文章主要是讲解如何通过cmkae编译安装mysql5.5及其以后的版本. 注意本篇文章的环境为centos6.5 64bit. cat /etc/system-release uname -a   在安装mysql数据库之前,我们首先要在系统中新建mysql运行时的用户mysql.如下: useradd -M -s /sbin/nologin mysql grep mysql /etc/passwd cat /etc/passwd

cmake编译,需要openvdb库

问题描述 cmake编译,需要openvdb库 windows下编译github的代码https://github.com/david-hahn/FractureBEM 有cmakelist.需要openvdb的库.我下了之后不知道要怎么弄了. 有没有大神可以帮帮我. 解决方案 http://www.cnblogs.com/mengdd/archive/2012/07/16/2598020.html

库-pcl1.7.1 cmake编译 win 7 32位

问题描述 pcl1.7.1 cmake编译 win 7 32位 下载了PCL1.7.1 以及相关包,如何在win 7 32位电脑上用cmake编译这个库?PCL1.7.1没有现成的安装包.... 解决方案 你现在机器上安装Cmake,然后调用pcl源码包中,执行cmake来安装.估计是要从源码编译安装

Linux/Ubuntu下CMake编译MySQL教程

使用Linux+Vim写PHP简直是一种享受.下面是我的Vim配置和安装的插件. 1. 下载MySQL 5.5.28源码包 下载地址:http://www.mysql.com/downloads/mysql/#downloads 在MySQL下载页面的下拉框选择"Source Code",然后选择最下面的tar.gz格式,开始下载.wget开始可以使用:http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.28.tar.gz这个地址. 2