【问题标题】:Percona5.7 cmake failed on centos 7Percona5.7 cmake 在 centos 7 上失败
【发布时间】:2018-06-23 16:35:23
【问题描述】:

我从 github 获取 percona-server 的源代码。我安装了 boost 1.59 和 gcc gcc-c ncurses-devel。我进入 percona-server 的目录并运行“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

【问题讨论】:

    标签: cmake percona


    【解决方案1】:

    您似乎还没有安装所有需要的依赖项。

    这些是需要的步骤:

    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会自动下载

    【讨论】:

    • 感谢您的介绍。我已经解决了我的问题!
    猜你喜欢
    • 2016-07-26
    • 2018-04-21
    • 2015-08-22
    • 2023-04-04
    • 1970-01-01
    • 1970-01-01
    • 2017-10-05
    • 2017-11-03
    • 2020-08-15
    相关资源
    最近更新 更多