编译问题

在uos上make编译报错

-- Build files have been written to: /usr/src/nebula                                                                                                                                                                                               
[  0%] Built target parser_target                                                                                                                                                                                                                  
[  0%] Built target datetime_parser_target                                                                                                                                                                                                        
[  0%] Built target wkt_parser_target                                                                                                                                                                                                             
[  0%] Generating thrift files for graph                                                                                                                                                                                                          
/bin/sh: 1: --strict: not found                                                                                                                                                                                                                   
make[2]: *** [src/interface/CMakeFiles/graph_thrift_generator.dir/build.make:77: src/interface/gen-cpp2/graph_constants.h] Error 127                                                                                                               
make[1]: *** [CMakeFiles/Makefile2:8743: src/interface/CMakeFiles/graph_thrift_generator.dir/all] Error 2                                                                                                                                          
make: *** [Makefile:152: all] Error 2 

想问一下thrift用的是哪个版本

麻烦把硬件信息补充下,cpu 架构。以及你在安装的 NebulaGraph 的版本号。

系统版本、编译器(gcc/cmake)版本也请发一下。其他依赖遵循https://docs.nebula-graph.com.cn/3.3.0/4.deployment-and-installation/1.resource-preparations/中的要求

1 个赞

NebulaGraph v3.0.0
gcc 8.3.0
cmake version 3.13.4
Linux node2 4.19.0-sw64-server SMP Uos Thu Jan 27 05:20:31 UTC 2022 sw_64 GNU/Linux

1 个赞

g++ 8.5.0 及以上 执行命令g++ -v检查版本。
cmake 3.14.0 及以上 执行命令cmake --version检查版本。

你至少需要把cmake版本升上来
另外你所使用的CPU是sw_64么?关于申威CPU我们没有官方支持,你可以留下CPU型号

cmake version 3.18.4 cmake版本已经拉上来,g++版本目前最高只能8.3.0.编译之后还是我上面提到的报错。

如果实在不支持的架构上编译,哪些地方需要注意呢

>>>> Options of Nebula Graph <<<<                                                                                                                                                                                                        [71/48121]
-- 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_CREATE_GIT_HOOKS         : ON (Enable create git hooks.)
-- 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_INCLUDE_WHAT_YOU_USE     : OFF (Enable include-what-you-use find  nouse include files)
-- 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_STANDALONE_VERSION       : OFF (Enable standalone version build)                                                                                                                                                                        
-- 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                : Release (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 (Linker to be used)
-- 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-3.0-sw_64-libc-2.28-gcc-8.3.0-abi-11.sh...
Downloading vesoft-third-party-3.0-sw_64-libc-2.28-gcc-8.3.0-abi-11.sh failed
-- CMAKE_INCLUDE_PATH              :
-- CMAKE_LIBRARY_PATH              :
-- CMAKE_PROGRAM_PATH              :
-- GLIBC_VERSION                   : 2.28

-- found krb5-config here KRB5_C_CONFIG-NOTFOUND
-- KRB5 was not found. Make sure the entries KRB5_* are set.
>>>> Configuring third party for 'Nebula Graph' done <<<<
-- Create the pre-commit hook
-- Creating pre-commit hook done
-- NEBULA_BUILD_VERSION            :
-- HOST_SYSTEM_NAME                : UnionTech
-- HOST_SYSTEM_VER                 : UnionTechServer
-- CPACK_GENERATOR                 :
-- CMAKE_HOST_SYSTEM_PROCESSOR     : sw_64
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/src/nebula

这是目前的configure信息

nebula编译依赖third party(nebula的上游依赖)
目前我们没有为sw64提供third party,在log里已有体现。如果你想在sw64上编译nebula,需要先拉取nebula-third-party这个项目,编译出你当前环境下的third party。考虑到sw64并不是一个主流的硬件架构,nebula的上游开源依赖需要你们手动适配到sw64架构才行。

Downloading vesoft-third-party-3.0-sw_64-libc-2.28-gcc-8.3.0-abi-11.sh failed

2 个赞

好的,谢谢。我先去编译nebula-third-party试试

nebula的上游依赖中有breakpad,这个是否一定需要?sw目前还没有移植过breakpad

非必须。

hello,上次提到的nebula-third-party我选择了v3.0版本,并且把里面的依赖都已经编译安装了,但是现在的报错还是跟我上面提到的一样 --strict: not found。
thrift1的二进制用的是nebula-third-party里提供的链接https://github.com/facebook/fbthrift/archive/refs/tags/v2021.11.29.00.tar.gz 编译出来的。请问有什么解决办法吗?

请给出移植third party后编译nebula的时的cmake log

>>>> 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_CREATE_GIT_HOOKS         : ON (Enable create git hooks.)
-- 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_INCLUDE_WHAT_YOU_USE     : OFF (Enable include-what-you-use find  nouse include files)
-- 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_STANDALONE_VERSION       : OFF (Enable standalone version build)
-- 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                : Release (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 (Linker to be used)
-- 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-3.0-sw_64-libc-2.28-gcc-8.3.0-abi-11.sh...
Downloading vesoft-third-party-3.0-sw_64-libc-2.28-gcc-8.3.0-abi-11.sh failed
-- CMAKE_INCLUDE_PATH              : 
-- CMAKE_LIBRARY_PATH              : 
-- CMAKE_PROGRAM_PATH              : 
-- GLIBC_VERSION                   : 2.28

-- found krb5-config here /usr/bin/krb5-config
-- Found kerberos 5 headers: 
-- Found kerberos 5 libs:    /usr/lib/sw_64-linux-gnu/mit-krb5/libgssapi_krb5.so;/usr/lib/sw_64-linux-gnu/mit-krb5/libkrb5.so;/usr/lib/sw_64-linux-gnu/mit-krb5/libk5crypto.so;/usr/lib/sw_64-linux-gnu/libcom_err.so;/usr/lib/sw_64-linux-gnu/mit-krb5/libkrb5support.so
>>>> Configuring third party for 'Nebula Graph' done <<<<
-- Create the pre-commit hook
-- Creating pre-commit hook done
-- NEBULA_BUILD_VERSION            : 
-- HOST_SYSTEM_NAME                : UnionTech
-- HOST_SYSTEM_VER                 : UnionTechServer
-- CPACK_GENERATOR                 : 
-- CMAKE_HOST_SYSTEM_PROCESSOR     : sw_64
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/src/nebula

这是执行cmake . 之后的log

[  0%] Built target parser_target
[  0%] Built target datetime_parser_target
[  0%] Built target wkt_parser_target
[  0%] Generating thrift files for graph
/bin/sh: 1: --strict: not found
make[2]: *** [src/interface/CMakeFiles/graph_thrift_generator.dir/build.make:97: src/interface/gen-cpp2/graph_constants.h] Error 127
make[2]: *** Deleting file 'src/interface/gen-cpp2/graph_constants.h'
make[1]: *** [CMakeFiles/Makefile2:8463: src/interface/CMakeFiles/graph_thrift_generator.dir/all] Error 2
make: *** [Makefile:171: all] Error 2

执行make的log

从这段log可以看出你并没有移植third party到sw_64平台,请参考third party项目的构建指南(仓库首页里有),在sw_64上编译出平台特定的third party。

需要强调的一点是:装一个third party里同名的package和构建third party项目是两码事

>>>> 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_CREATE_GIT_HOOKS         : ON (Enable create git hooks.)
-- 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_INCLUDE_WHAT_YOU_USE     : OFF (Enable include-what-you-use find  nouse include files)
-- 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_STANDALONE_VERSION       : OFF (Enable standalone version build)
-- 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                   : OFF (Regard warnings as errors)
-- CMAKE_BUILD_TYPE                : Release (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 (Linker to be used)
-- CCACHE                              : Enabled but not found
>>>> Configuring third party for 'Nebula Graph' <<<<
-- NEBULA_THIRDPARTY_ROOT          : /opt/vesoft/third-party/3.0
-- Build info of nebula third party:
Package         : Nebula Third Party
Version         : 3.0
Date            : Fri Dec  2 18:06:53 CST 2022
glibc           : 2.28.1
Arch            : sw_64
Compiler        : GCC 8.3.0
C++ ABI         : 11
Vendor          : VEsoft Inc.

-- CMAKE_INCLUDE_PATH              : /opt/vesoft/third-party/3.0/include
-- CMAKE_LIBRARY_PATH              : /opt/vesoft/third-party/3.0/lib64;/opt/vesoft/third-party/3.0/lib
-- CMAKE_PROGRAM_PATH              : /opt/vesoft/third-party/3.0/bin
-- GLIBC_VERSION                   : 2.28

-- found krb5-config here /usr/bin/krb5-config
-- Found kerberos 5 headers:
-- Found kerberos 5 libs:    /usr/lib/sw_64-linux-gnu/mit-krb5/libgssapi_krb5.so;/usr/lib/sw_64-linux-gnu/mit-krb5/libkrb5.so;/usr/lib/sw_64-linux-gnu/mit-krb5/libk5crypto.so;/usr/lib/sw_64-linux-gnu/libcom_err.so;/usr/lib/sw_64-linux-gnu/mit-
krb5/libkrb5support.so
>>>> Configuring third party for 'Nebula Graph' done <<<<
-- Create the pre-commit hook
-- Creating pre-commit hook done
-- NEBULA_BUILD_VERSION            :
-- HOST_SYSTEM_NAME                : UnionTech
-- HOST_SYSTEM_VER                 : UnionTechServer
-- CPACK_GENERATOR                 :
-- CMAKE_HOST_SYSTEM_PROCESSOR     : sw_64
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/src/nebula
root@1050d-a9dda6420f3d6b5e:/usr/src/nebula# make
[  0%] Built target parser_target
[  0%] Built target datetime_parser_target
[  0%] Built target wkt_parser_target
[  0%] Generating thrift files for graph
/bin/sh: 1: --strict: not found
make[2]: *** [src/interface/CMakeFiles/graph_thrift_generator.dir/build.make:96: src/interface/gen-cpp2/graph_constants.h] Error 127
make[1]: *** [CMakeFiles/Makefile2:8463: src/interface/CMakeFiles/graph_thrift_generator.dir/all] Error 2
make: *** [Makefile:171: all] Error 2

third party里的/opt/vesoft/third-party/3.0我已经生成了,报错还是这样

root@1050d-a9dda6420f3d6b5e:/usr/src/nebula-third-party# ls /opt/vesoft/third-party/3.0
bin  docs  etc  include  lib  libexec  man  sbin  share  var  version-info

生成路径如上