Nebula Graph v2.0 版本安装失败

  • nebula 2.0

  • 问题的具体描述
    安装最新的v2.0版本,执行cmake时报错

cmake -DENABLE_BUILD_STORAGE=on -DENABLE_TESTING=OFF -DNEBULA_COMMON_REPO_TAG=v2.0.0 -DNEBULA_STORAGE_REPO_TAG=v2.0.0 ..
  • 相关的日志信息
    控制台输出:
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- 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
-- Found Git: /usr/bin/git (found version "2.25.1") 
-- Cloning from https://github.com/vesoft-inc/nebula-common.git:v2.0.0

Options of Nebula Graph

-- ENABLE_ASAN                     : OFF (Build with AddressSanitizer)
-- ENABLE_BUILD_STORAGE            : on (Whether to build storage)
-- 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_MODULE_UPDATE            : OFF (Automatically update module)
-- 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              : 14
-- 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
Downloading vesoft-third-party-x86_64-libc-2.27-gcc-9.2.0-abi-11.sh...
Nebula Third Party has been installed to /usr/local/nebula-graph/build/third-party/install
-- NEBULA_THIRDPARTY_ROOT          : /usr/local/nebula-graph/build/third-party/install
-- CMAKE_INCLUDE_PATH              : /usr/local/nebula-graph/build/third-party/install/include
-- CMAKE_LIBRARY_PATH              : /usr/local/nebula-graph/build/third-party/install/lib64;/usr/local/nebula-graph/build/third-party/install/lib
-- CMAKE_PROGRAM_PATH              : /usr/local/nebula-graph/build/third-party/install/bin
-- GLIBC_VERSION                   : 2.31

-- Mstch_INCLUDE_DIR       : /usr/local/nebula-graph/build/third-party/install/include
-- Mstch_LIBRARY           : /usr/local/nebula-graph/build/third-party/install/lib/libmstch.a
-- Found ZLIB: /usr/local/nebula-graph/build/third-party/install/lib/libz.a (found version "1.2.11") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found OpenSSL: /usr/local/nebula-graph/build/third-party/install/lib/libcrypto.a (found version "1.1.1c")  
-- found krb5-config here /usr/local/nebula-graph/build/third-party/install/bin/krb5-config
-- Found kerberos 5 headers: /usr/local/nebula-graph/build/third-party/install/include
-- Found kerberos 5 libs:    /usr/local/nebula-graph/build/third-party/install/lib/libgssapi_krb5.a;/usr/local/nebula-graph/build/third-party/install/lib/libkrb5.a;/usr/local/nebula-graph/build/third-party/install/lib/libk5crypto.a;/usr/local/nebula-graph/build/third-party/install/lib/libcom_err.a;/usr/local/nebula-graph/build/third-party/install/lib/libkrb5support.a
-- Found Boost: /usr/local/nebula-graph/build/third-party/install/include (found version "1.67.0")  
-- Found GPERF: /usr/local/nebula-graph/build/third-party/install/bin/gperf (found suitable version "3.1", minimum required is "2.8") 
-- Found Libunwind: /usr/local/nebula-graph/build/third-party/install/lib/libunwind.a  
-- Found BISON: /usr/local/nebula-graph/build/third-party/install/bin/bison (found suitable version "3.0.5", minimum required is "3.0.5") 
-- Found FLEX: /usr/local/nebula-graph/build/third-party/install/bin/flex (found version "2.6.4") 
-- Looking for lzma_auto_decoder in /usr/local/nebula-graph/build/third-party/install/lib/liblzma.a
-- Looking for lzma_auto_decoder in /usr/local/nebula-graph/build/third-party/install/lib/liblzma.a - found
-- Looking for lzma_easy_encoder in /usr/local/nebula-graph/build/third-party/install/lib/liblzma.a
-- Looking for lzma_easy_encoder in /usr/local/nebula-graph/build/third-party/install/lib/liblzma.a - found
-- Looking for lzma_lzma_preset in /usr/local/nebula-graph/build/third-party/install/lib/liblzma.a
-- Looking for lzma_lzma_preset in /usr/local/nebula-graph/build/third-party/install/lib/liblzma.a - found
-- Found LibLZMA: /usr/local/nebula-graph/build/third-party/install/lib/liblzma.a (found version "5.2.4") 
>>>> Configuring third party for 'Nebula Graph' done <<<<
-- Create the pre-commit hook
-- Creating pre-commit hook done

Configuring Nebula Common

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- 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 Common

-- 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_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_WERROR                   : ON (Regard warnings as errors)
-- Set D_GLIBCXX_USE_CXX11_ABI to 1
-- 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              : 14
-- CMAKE_CXX_COMPILER              : /usr/bin/c++
-- CMAKE_CXX_COMPILER_ID           : GNU
-- NEBULA_USE_LINKER               : bfd
-- CCACHE                              : Enabled but not found

Configuring third party for ‘Nebula Common’

-- NEBULA_THIRDPARTY_ROOT          : /usr/local/nebula-graph/build/third-party/install
-- CMAKE_INCLUDE_PATH              : /usr/local/nebula-graph/build/third-party/install/include
-- CMAKE_LIBRARY_PATH              : /usr/local/nebula-graph/build/third-party/install/lib64;/usr/local/nebula-graph/build/third-party/install/lib
-- CMAKE_PROGRAM_PATH              : /usr/local/nebula-graph/build/third-party/install/bin
-- GLIBC_VERSION                   : 2.31

-- Mstch_INCLUDE_DIR       : /usr/local/nebula-graph/build/third-party/install/include
-- Mstch_LIBRARY           : /usr/local/nebula-graph/build/third-party/install/lib/libmstch.a
-- Found ZLIB: /usr/local/nebula-graph/build/third-party/install/lib/libz.a (found version "1.2.11") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found OpenSSL: /usr/local/nebula-graph/build/third-party/install/lib/libcrypto.a (found version "1.1.1c")  
-- found krb5-config here /usr/local/nebula-graph/build/third-party/install/bin/krb5-config
-- Found kerberos 5 headers: /usr/local/nebula-graph/build/third-party/install/include
-- Found kerberos 5 libs:    /usr/local/nebula-graph/build/third-party/install/lib/libgssapi_krb5.a;/usr/local/nebula-graph/build/third-party/install/lib/libkrb5.a;/usr/local/nebula-graph/build/third-party/install/lib/libk5crypto.a;/usr/local/nebula-graph/build/third-party/install/lib/libcom_err.a;/usr/local/nebula-graph/build/third-party/install/lib/libkrb5support.a
-- Found Boost: /usr/local/nebula-graph/build/third-party/install/include (found version "1.67.0")  
-- Found GPERF: /usr/local/nebula-graph/build/third-party/install/bin/gperf (found suitable version "3.1", minimum required is "2.8") 
-- Found Libunwind: /usr/local/nebula-graph/build/third-party/install/lib/libunwind.a  
-- Found BISON: /usr/local/nebula-graph/build/third-party/install/bin/bison (found suitable version "3.0.5", minimum required is "3.0.5") 
-- Found FLEX: /usr/local/nebula-graph/build/third-party/install/bin/flex (found version "2.6.4") 
-- Looking for lzma_auto_decoder in /usr/local/nebula-graph/build/third-party/install/lib/liblzma.a
-- Looking for lzma_auto_decoder in /usr/local/nebula-graph/build/third-party/install/lib/liblzma.a - found
-- Looking for lzma_easy_encoder in /usr/local/nebula-graph/build/third-party/install/lib/liblzma.a
-- Looking for lzma_easy_encoder in /usr/local/nebula-graph/build/third-party/install/lib/liblzma.a - found
-- Looking for lzma_lzma_preset in /usr/local/nebula-graph/build/third-party/install/lib/liblzma.a
-- Looking for lzma_lzma_preset in /usr/local/nebula-graph/build/third-party/install/lib/liblzma.a - found
-- Found LibLZMA: /usr/local/nebula-graph/build/third-party/install/lib/liblzma.a (found version "5.2.4") 

Configuring third party for ‘Nebula Common’ done

-- Create the pre-commit hook
-- Creating pre-commit hook done
-- Found Git: /usr/bin/git (found version "2.25.1") 
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/nebula-graph/build/modules/common

Configuring Nebula Common done

**-- Cloning from https://github.com/vesoft-inc/nebula-storage.git:v2.0.0**
**CMake Error at cmake/FetchModule.cmake:29 (message):**
**  Cloning failed**
**Call Stack (most recent call first):**
**  CMakeLists.txt:108 (nebula_fetch_module)**


**-- Configuring incomplete, errors occurred!**

以下是CMakeError.log

Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /usr/local/nebula-graph/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_901a9/fast && /usr/bin/make  -f CMakeFiles/cmTC_901a9.dir/build.make CMakeFiles/cmTC_901a9.dir/build
make[1]: 进入目录“/usr/local/nebula-graph/build/CMakeFiles/CMakeTmp”
Building C object CMakeFiles/cmTC_901a9.dir/src.c.o
/usr/bin/cc   -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_901a9.dir/src.c.o -c /usr/local/nebula-graph/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_901a9
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_901a9.dir/link.txt --verbose=1
/usr/bin/cc  -DCMAKE_HAVE_LIBC_PTHREAD  -fuse-ld=bfd -static-libstdc++ -static-libgcc -no-pie -rdynamic -Wl,--gc-sections -Wl,--compress-debug-sections=zlib  CMakeFiles/cmTC_901a9.dir/src.c.o -o cmTC_901a9 
/usr/bin/ld.bfd: CMakeFiles/cmTC_901a9.dir/src.c.o: in function `main':
src.c:(.text+0x46): undefined reference to `pthread_create'
/usr/bin/ld.bfd: src.c:(.text+0x52): undefined reference to `pthread_detach'
/usr/bin/ld.bfd: src.c:(.text+0x5e): undefined reference to `pthread_cancel'
/usr/bin/ld.bfd: src.c:(.text+0x6f): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_901a9.dir/build.make:106:cmTC_901a9] 错误 1
make[1]: 离开目录“/usr/local/nebula-graph/build/CMakeFiles/CMakeTmp”
make: *** [Makefile:140:cmTC_901a9/fast] 错误 2

Source file was:

#include <pthread.h>

void* test_func(void* data)
{
  return data;
}

int main(void)
{
  pthread_t thread;
  pthread_create(&thread, NULL, test_func, NULL);
  pthread_detach(thread);
  pthread_cancel(thread);
  pthread_join(thread, NULL);
  pthread_atfork(NULL, NULL, NULL);
  pthread_exit(NULL);

  return 0;
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /usr/local/nebula-graph/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_d546e/fast && /usr/bin/make  -f CMakeFiles/cmTC_d546e.dir/build.make CMakeFiles/cmTC_d546e.dir/build
make[1]: 进入目录“/usr/local/nebula-graph/build/CMakeFiles/CMakeTmp”
Building C object CMakeFiles/cmTC_d546e.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_d546e.dir/CheckFunctionExists.c.o -c /usr/local/share/cmake-3.18/Modules/CheckFunctionExists.c
Linking C executable cmTC_d546e
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d546e.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create  -fuse-ld=bfd -static-libstdc++ -static-libgcc -no-pie -rdynamic -Wl,--gc-sections -Wl,--compress-debug-sections=zlib  CMakeFiles/cmTC_d546e.dir/CheckFunctionExists.c.o -o cmTC_d546e  -lpthreads 
/usr/bin/ld.bfd: 找不到 -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_d546e.dir/build.make:106:cmTC_d546e] 错误 1
make[1]: 离开目录“/usr/local/nebula-graph/build/CMakeFiles/CMakeTmp”
make: *** [Makefile:140:cmTC_d546e/fast] 错误 2

不太清楚你用的什么系统,如果编译 nebula 的话,需要按照编译文档安装需要的依赖。

比如 centos 系统,就需要安装类似 Dockerfile 中的这些依赖

在重启电脑后 问题已经得到解决

这也可以?

真的可以

1 个赞

我读书少,你不要骗我

1 个赞

没有什么是 reset 解决不了的 :joy:

1 个赞

没错儿 重启解决不了才是大问题

是不是改了什么环境变量没source, 重启后就生效了

编译报错的不是你自己写的代码?不是nebula-graph的代码。

以#include <pthread.h>开头的是系统里面的文件 我从来没有改动过

浙ICP备20010487号