源码安装时cmake报错

Nebula版本:2.6.2
操作系统:CentOS7.9
安装步骤如下:
git clone --branch v2.6.2 https://github.com/vesoft-inc/nebula.git

cd nebula

mkdir build && cd build

执行cmake设置路径和编译选项时报错

[root@localhost build]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nebula -DENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Debug ..
-- The C compiler identification is GNU 8.3.1
-- The CXX compiler identification is GNU 4.8.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
>>>> Options of Nebula Graph <<<<
-- ENABLE_ASAN                     : OFF (Build with AddressSanitizer)
-- ENABLE_CCACHE                   : ON (Use ccache to speed up compiling)
-- ENABLE_CLANG_TIDY               : OFF (Enable clang-tidy if present)
-- ENABLE_COMPRESSED_DEBUG_INFO    : ON (Compress debug info to reduce binary size)
-- ENABLE_COVERAGE                 : OFF (Build with coverage report)
-- ENABLE_FRAME_POINTER            : OFF (Build with frame pointer)
-- ENABLE_FUZZY_TESTING            : OFF (Enable Fuzzy tests)
-- ENABLE_GDB_SCRIPT_SECTION       : OFF (Add .debug_gdb_scripts section)
-- ENABLE_JEMALLOC                 : ON (Use jemalloc as memory allocator)
-- ENABLE_PACKAGE_TAR              : OFF (Enable package artifacts to tar.)
-- ENABLE_PACK_ONE                 : ON (Whether to package into one)
-- ENABLE_PIC                      : OFF (Build with -fPIC)
-- ENABLE_STATIC_ASAN              : OFF (Statically link against libasan)
-- ENABLE_STATIC_UBSAN             : OFF (Statically link against libubsan)
-- ENABLE_STRICT_ALIASING          : OFF (Build with -fstrict-aliasing)
-- ENABLE_TESTING                  : OFF (Build unit tests)
-- ENABLE_TSAN                     : OFF (Build with ThreadSanitizer)
-- ENABLE_UBSAN                    : OFF (Build with UndefinedBehaviourSanitizer)
-- ENABLE_VERBOSE_BISON            : OFF (Enable Bison to report state)
-- ENABLE_WERROR                   : ON (Regard warnings as errors)
-- CMAKE_BUILD_TYPE                : Debug (Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ...)
-- CMAKE_INSTALL_PREFIX            : /usr/local/nebula (Install path prefix, prepended onto install directories.)
-- CMAKE_CXX_STANDARD              : 17
-- CMAKE_CXX_COMPILER              : /usr/bin/c++ (CXX compiler)
-- CMAKE_CXX_COMPILER_ID           : GNU
-- NEBULA_USE_LINKER               : bfd
-- CCACHE                              : Enabled but not found
>>>> Configuring third party for 'Nebula Graph' <<<<
-- Downloading prebuilt third party automatically...
-- cxx_cmd: /usr/bin/c++ -D_GLIBCXX_USE_CXX11_ABI=1
c++: error: unrecognized command line option ‘-std=c++14’
Downloading vesoft-third-party-2.0-x86_64-libc-2.17-gcc--abi-.sh...
Downloading vesoft-third-party-2.0-x86_64-libc-2.17-gcc--abi-.sh failed
-- CMAKE_INCLUDE_PATH              : 
-- CMAKE_LIBRARY_PATH              : 
-- CMAKE_PROGRAM_PATH              : 
-- GLIBC_VERSION                   : 2.17

CMake Error at cmake/FindBzip2.cmake:31 (message):
  Bzip2 doesn't exist
Call Stack (most recent call first):
  cmake/nebula/ThirdPartyConfig.cmake:81 (find_package)
  CMakeLists.txt:42 (include)


-- Configuring incomplete, errors occurred!
See also "/home/pl/nebula2.6/build/CMakeFiles/CMakeOutput.log".

检查如下依赖软件包均已安装

yum install -y make \
                 m4 \
                 git \
                 wget \
                 unzip \
                 xz \
                 readline-devel \
                 ncurses-devel \
                 zlib-devel \
                 gcc \
                 gcc-c++ \
                 cmake \
                 gettext \
                 curl \
                 redhat-lsb-core \
                 bzip2

按照这个文档更新 gcc 和cmake后再试一下

1 个赞
[root@localhost build]# gcc --version
gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@localhost build]# cmake --version
cmake version 3.18.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

找到了一个之前的帖子 似乎也是这个问题 请移步

我之前也遇到过这个问题,你这个版本的gcc 和文档上的不一样,后来换成文档上的gcc 和cmake 版本就编译通过了。

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。