Percona5.7 cmake在centos 7上失败

时间:2018-06-23 16:35:23

标签: cmake percona

我从github获得了percona-server的源代码。然后安装boost 1.59和gcc gcc-c ncurses-devel。我进入percona服务器的目录并运行“ cmake --DWITH_BOOST = / data / boost”,但出现以下错误。我找不到解决方案,所以我来到了这里。谢谢!!

-- Performing Test HAVE_UNUSED_PARAMETER - Success

-- Googletest was not found. gtest-based unit tests will be disabled. You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download and build required components from source.

-- If you are inside a firewall, you may need to use an https proxy: export https_proxy=http://example.com:80

-- Performing Test HAVE_MISLEADING_INDENTATION

-- Performing Test HAVE_MISLEADING_INDENTATION - Failed

-- executable target mysqld debug_target /home/teg/Downloads/debug/sql/mysqld

-- Library mysqlserver depends on OSLIBS -lpthread;/usr/lib64/libz.so;m;rt;crypt;dl;aio;numa

-- MERGE_CONVENIENCE_LIBRARIES TARGET mysqlserver

-- MERGE_CONVENIENCE_LIBRARIES LIBS dbug;strings;regex;mysys;mysys_ssl;vio;/usr/lib64/libz.so;yassl;taocrypt;crypt;dl;archive_embedded;b lackhole_embedded;csv_embedded;federated_embedded; heap_embedded;innobase_embedded;lz4_lib;numa;myisa m_embedded;myisammrg_embedded;partition_embedded;n gram_parser_embedded;sql_embedded

-- MERGE_CONVENIENCE_LIBRARIES MYLIBS dbug;strings;regex;mysys;mysys_ssl;vio;yassl;taocr ypt;archive_embedded;blackhole_embedded;csv_embedd ed;federated_embedded;heap_embedded;innobase_embed ded;lz4_lib;myisam_embedded;myisammrg_embedded;par tition_embedded;ngram_parser_embedded;sql_embedded

-- library target mysqlserver debug_target /home/teg/Downloads/debug/archive_output_directory/libmysqld.a

-- INSTALL perconaserverclient.pc lib/pkgconfig

-- Skipping deb packaging on unsupported platform Core.

-- CMAKE_BUILD_TYPE: RelWithDebInfo

-- COMPILE_DEFINITIONS: _GNU_SOURCE;_FILE_OFFSET_BITS=64;HAVE_CONFIG_H;HAV E_LIBEVENT1

-- CMAKE_C_FLAGS: -Wall -Wextra -Wformat-security -Wvla -Wwrite-strings -Wdeclaration-after-statement

-- CMAKE_CXX_FLAGS: -std=gnu++03 -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter

-- CMAKE_C_LINK_FLAGS: 

-- CMAKE_CXX_LINK_FLAGS: 

-- CMAKE_C_FLAGS_RELWITHDEBINFO: -O3 -D_FORTIFY_SOURCE=2 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF -DNDEBUG

-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O3 -D_FORTIFY_SOURCE=2 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF -DNDEBUG

-- Configuring incomplete, errors occurred!

See also "/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeOutput.log".

See also "/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeError.log".

............................................... ...................................

然后我打开/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeError.log并发现以下错误。错误太多,我只列出其中一部分。

Run Build Command:/usr/bin/gmake "cmTryCompileExec1295500228/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec1295500228.dir/build.make CMakeFiles/cmTryCompileExec1295500228.dir/build
gmake[1]: Entering directory `/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec1295500228.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTryCompileExec1295500228.dir/CheckSymbolExists.c.o -c /home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec1295500228
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1295500228.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTryCompileExec1295500228.dir/CheckSymbolExists.c.o -o cmTryCompileExec1295500228 -rdynamic
CMakeFiles/cmTryCompileExec1295500228.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
gmake[1]: Leaving directory `/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp'
gmake[1]: *** [cmTryCompileExec1295500228] Error 1
gmake: *** [cmTryCompileExec1295500228/fast] Error 2

File /home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp/CheckSymbolExists.c:

Run Build Command:/usr/bin/gmake "cmTryCompileExec1916958743/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec1916958743.dir/build.make CMakeFiles/cmTryCompileExec1916958743.dir/build
gmake[1]: Entering directory `/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec1916958743.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec1916958743.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec1916958743
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1916958743.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec1916958743.dir/CheckFunctionExists.c.o -o cmTryCompileExec1916958743 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: Leaving directory `/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp'
gmake[1]: *** [cmTryCompileExec1916958743] Error 1
gmake: *** [cmTryCompileExec1916958743/fast] Error 2


Determining if the function floor exists failed with the following output:
Change Dir: /home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/gmake "cmTryCompileExec1596718479/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec1596718479.dir/build.make CMakeFiles/cmTryCompileExec1596718479.dir/build
gmake[1]: Entering directory `/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec1596718479.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=floor -o CMakeFiles/cmTryCompileExec1596718479.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c
<command-line>:0:23: warning: conflicting types for built-in function ‘floor’ [enabled by default]
/usr/share/cmake/Modules/CheckFunctionExists.c:3:6: note: in expansion of macro ‘CHECK_FUNCTION_EXISTS’
char CHECK_FUNCTION_EXISTS();
^
Linking C executable cmTryCompileExec1596718479
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1596718479.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=floor CMakeFiles/cmTryCompileExec1596718479.dir/CheckFunctionExists.c.o -o cmTryCompileExec1596718479 -rdynamic
CMakeFiles/cmTryCompileExec1596718479.dir/CheckFunctionExists.c.o: In function `main':
CheckFunctionExists.c.text+0x15): undefined reference to `floor'
collect2: error: ld returned 1 exit status
gmake[1]: Leaving directory `/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp'
gmake[1]: *** [cmTryCompileExec1596718479] Error 1
gmake: *** [cmTryCompileExec1596718479/fast] Error 2

1 个答案:

答案 0 :(得分:0)

似乎您尚未安装所有必需的依赖项。

这些是所需的步骤:

sudo yum install epel-release
sudo yum install git gcc gcc-c++ openssl check cmake bison boost-devel asio-devel 
libaio-devel ncurses-devel readline-devel pam-devel wget perl-Env time numactl-devel 
rpmdevtools rpm-build curl-devel
git clone https://github.com/percona/percona-server.git
cd percona-server
git submodule init
git submodule update
cmake . -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<PATCH_TO_BOOST_DIR>

然后boost将自动下载