centos 7.6编译安装cmake3.9

运行./configure 报错

[root@localhost cmake-3.9.0]# ./configure
---------------------------------------------
CMake 3.9.0, Copyright 2000-2017 Kitware, Inc. and Contributors
Found GNU toolchain
C compiler on this system is: gcc  -std=gnu11
C++ compiler on this system is: g++  -std=gnu++1y
Makefile processor on this system is: gmake
g++ is GNU compiler
g++ has setenv
g++ has unsetenv
g++ does not have environ in stdlib.h
g++ has stl wstring
g++ has <ext/stdio_filebuf.h>
---------------------------------------------
g++  -std=gnu++1y     -I/data/cmake-3.9.0/Bootstrap.cmk   -I/data/cmake-3.9.0/Source   -I/data/cmake-3.9.0/Source/LexerParser   -I/data/cmake-3.9.0/Utilities  -c /data/cmake-3.9.0/Source/cmSystemTools.cxx -o cmSystemTools.o
/data/cmake-3.9.0/Source/cmSystemTools.cxx: In static member function ‘static void cmSystemTools::FindCMakeResources(const char*)’:
/data/cmake-3.9.0/Source/cmSystemTools.cxx:2061:13: error: ‘CMAKE_BOOTSTRAP_BINARY_DIR’ was not declared in this scope
   exe_dir = CMAKE_BOOTSTRAP_BINARY_DIR "/bin";
             ^
/data/cmake-3.9.0/Source/cmSystemTools.cxx:2061:40: error: expected ‘;’ before string constant
   exe_dir = CMAKE_BOOTSTRAP_BINARY_DIR "/bin";
                                        ^
/data/cmake-3.9.0/Source/cmSystemTools.cxx:2121:28: error: ‘CMAKE_BOOTSTRAP_SOURCE_DIR’ was not declared in this scope
   cmSystemToolsCMakeRoot = CMAKE_BOOTSTRAP_SOURCE_DIR;
                            ^
gmake: *** [cmSystemTools.o] Error 1
---------------------------------------------
Error when bootstrapping CMake:
Problem while running gmake
---------------------------------------------
Log of errors: /data/cmake-3.9.0/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------


cmake3.9不需要用./configure 配置,而是使用./bootstrap 进行引导

[root@localhost cmake-3.9.0]# ./bootstrap && make && make install
---------------------------------------------
CMake 3.9.0, Copyright 2000-2017 Kitware, Inc. and Contributors
Found GNU toolchain
C compiler on this system is: gcc  -std=gnu11
C++ compiler on this system is: g++  -std=gnu++1y
Makefile processor on this system is: gmake
g++ is GNU compiler
g++ has setenv
g++ has unsetenv
g++ does not have environ in stdlib.h
g++ has stl wstring
g++ has <ext/stdio_filebuf.h>
---------------------------------------------
g++  -std=gnu++1y     -I/data/cmake-3.9.0/Bootstrap.cmk   -I/data/cmake-3.9.0/Source   -I/data/cmake-3.9.0/Source/LexerParser   -I/data/cmake-3.9.0/Utilities  -c /data/cmake-3.9.0/Source/cmSystemTools.cxx -o cmSystemTools.o
/data/cmake-3.9.0/Source/cmSystemTools.cxx: In static member function ‘static void cmSystemTools::FindCMakeResources(const char*)’:
/data/cmake-3.9.0/Source/cmSystemTools.cxx:2061:13: error: ‘CMAKE_BOOTSTRAP_BINARY_DIR’ was not declared in this scope
   exe_dir = CMAKE_BOOTSTRAP_BINARY_DIR "/bin";
             ^
/data/cmake-3.9.0/Source/cmSystemTools.cxx:2061:40: error: expected ‘;’ before string constant
   exe_dir = CMAKE_BOOTSTRAP_BINARY_DIR "/bin";
                                        ^
/data/cmake-3.9.0/Source/cmSystemTools.cxx:2121:28: error: ‘CMAKE_BOOTSTRAP_SOURCE_DIR’ was not declared in this scope
   cmSystemToolsCMakeRoot = CMAKE_BOOTSTRAP_SOURCE_DIR;
                            ^
gmake: *** [cmSystemTools.o] Error 1
---------------------------------------------
Error when bootstrapping CMake:
Problem while running gmake
---------------------------------------------
Log of errors: /data/cmake-3.9.0/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------
trap.log
---------------------------------------------

删除目录重新解压编译即可

rm -fr cmake-3.9.0 && tar xf cmake-3.9.0.tar.gz
cd cmake-3.9.0 &&  ./bootstrap && make && make install

make时报错:

[ 23%] Linking C executable LIBCURL
lib/libcmcurl.a(openssl.c.o): In function `sk_X509_EXTENSION_num':
openssl.c:(.text+0xb6): undefined reference to `OPENSSL_sk_num'
lib/libcmcurl.a(openssl.c.o): In function `sk_X509_EXTENSION_value':
openssl.c:(.text+0xd8): undefined reference to `OPENSSL_sk_value'
lib/libcmcurl.a(openssl.c.o): In function `sk_X509_num':
openssl.c:(.text+0xf2): undefined reference to `OPENSSL_sk_num'
lib/libcmcurl.a(openssl.c.o): In function `sk_X509_value':
openssl.c:(.text+0x114): undefined reference to `OPENSSL_sk_value'
lib/libcmcurl.a(openssl.c.o): In function `sk_X509_pop':
openssl.c:(.text+0x12e): undefined reference to `OPENSSL_sk_pop'
lib/libcmcurl.a(openssl.c.o): In function `sk_X509_pop_free':
openssl.c:(.text+0x153): undefined reference to `OPENSSL_sk_pop_free'
lib/libcmcurl.a(openssl.c.o): In function `sk_GENERAL_NAME_num':
openssl.c:(.text+0x16d): undefined reference to `OPENSSL_sk_num'
lib/libcmcurl.a(openssl.c.o): In function `sk_GENERAL_NAME_value':
openssl.c:(.text+0x18f): undefined reference to `OPENSSL_sk_value'
lib/libcmcurl.a(openssl.c.o): In function `verifyhost':
openssl.c:(.text+0x193c): undefined reference to `ASN1_STRING_get0_data'
openssl.c:(.text+0x1ba0): undefined reference to `ASN1_STRING_get0_data'
lib/libcmcurl.a(openssl.c.o): In function `ossl_connect_step1':
openssl.c:(.text+0x2cc9): undefined reference to `TLS_client_method'
openssl.c:(.text+0x3024): undefined reference to `SSL_CTX_set_options'
lib/libcmcurl.a(openssl.c.o): In function `get_cert_chain':
openssl.c:(.text+0x4362): undefined reference to `X509_get_version'
openssl.c:(.text+0x45c3): undefined reference to `X509_get0_extensions'
openssl.c:(.text+0x45e3): undefined reference to `X509_get0_notBefore'
openssl.c:(.text+0x466b): undefined reference to `X509_get0_notAfter'
openssl.c:(.text+0x4758): undefined reference to `EVP_PKEY_get0_RSA'
openssl.c:(.text+0x4781): undefined reference to `RSA_get0_key'
openssl.c:(.text+0x4868): undefined reference to `EVP_PKEY_get0_DSA'
openssl.c:(.text+0x4893): undefined reference to `DSA_get0_pqg'
openssl.c:(.text+0x48b1): undefined reference to `DSA_get0_key'
openssl.c:(.text+0x4962): undefined reference to `EVP_PKEY_get0_DH'
openssl.c:(.text+0x498d): undefined reference to `DH_get0_pqg'
openssl.c:(.text+0x49ab): undefined reference to `DH_get0_key'
lib/libcmcurl.a(openssl.c.o): In function `pkp_pin_peer_pubkey':
openssl.c:(.text+0x4c2d): undefined reference to `X509_get_X509_PUBKEY'
openssl.c:(.text+0x4c7b): undefined reference to `X509_get_X509_PUBKEY'
lib/libcmcurl.a(openssl.c.o): In function `servercert':
openssl.c:(.text+0x4f1e): undefined reference to `X509_get0_notBefore'
openssl.c:(.text+0x4fa6): undefined reference to `X509_get0_notAfter'
lib/libcmcurl.a(openssl.c.o): In function `Curl_ossl_version':
openssl.c:(.text+0x643e): undefined reference to `OpenSSL_version_num'
collect2: error: ld returned 1 exit status
make[2]: *** [Utilities/cmcurl/LIBCURL] Error 1
make[1]: *** [Utilities/cmcurl/CMakeFiles/LIBCURL.dir/all] Error 2
make: *** [all] Error 2

原因:
openssl版本过低或者不兼容,由于我系统上装了两个版本的openssl 编译时自动找的是低版本的openssl-1.0.2k
在这里插入图片描述
解决:
在/usr/lib64/ 重新添加软连接到新版本的openssl-1.1.1li

一、安装MySQL 1、安装cmake cd /usr/local/src tar zxvf cmake-2.8.11.2.tar.gz cd cmake-2.8.11.2 ./configure make make install 2、安装MySQL groupadd mysql #添加mysql组 useradd -g mysql mysql -s /bin/false #创建用户mysql并加入到mysql组,不允许mysql用户直接登录系统 mkdir -p /data/mysql #创建MySQL数据库存放目录 chown -R mysql:mysql /data/mysql #设置MySQL数据库存放目录权限 mkdir -p /usr/local/mysql #创建MySQL安装目录 cd /usr/local/src #进入软件包存放目录 tar zxvf mysql-5.6.19.tar.gz #解压 cd mysql-5.6.19 #进入目录 cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/etc #配置 make #编译 make install #安装 rm -rf /etc/my.cnf #删除系统默认的配置文件(如果默认没有就不用删除) cd /usr/local/mysql #进入MySQL安装目录 ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql #生成mysql系统数据库 ln -s /usr/local/mysql/my.cnf /etc/my.cnf #添加到/etc目录的软连接 cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld #把Mysql加入系统启动 chmod 755 /etc/init.d/mysqld #增加执行权限 chkconfig mysqld on #加入开机启动 vi /etc/rc.d/init.d/mysqld #编辑 basedir=/usr/local/mysql #MySQL程序安装路径 datadir=/data/mysql #MySQl数据库存放目录 :wq! #保存退出 service mysqld start #启动 vi /etc/profile #把mysql服务加入系统环境变量:在最后添加下面这一行 export PATH=$PATH:/usr/local/mysql/bin :wq! #保存退出 source /etc/profile #使配置立刻生效 下面这两行把myslq的库文件链接到系统默认的位置,这样你在编译类似PHP等软件时可以不用指定mysql的库文件地址。 ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql ln -s /usr/local/mysql/include/mysql /usr/include/mysql mkdir /var/lib/mysql #创建目录 ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock #添加软链接 mysql_secure_installation #设置Mysql密码,根据提示按Y 回车输入2次密码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值