v2.0.0-beta编译缺少LibLZMA

nebula 版本:v2.0.0-beta

  • 部署方式:分布式
  • 硬件信息
    • 磁盘: ssd
  • 问题的具体描述:
    在生产服务器(centos 7.4)下编译出现错误:
-- Looking for lzma_auto_decoder in /opt/vesoft/third-party/lib/liblzma.a
-- Looking for lzma_auto_decoder in /opt/vesoft/third-party/lib/liblzma.a - not found
-- Looking for lzma_easy_encoder in /opt/vesoft/third-party/lib/liblzma.a
-- Looking for lzma_easy_encoder in /opt/vesoft/third-party/lib/liblzma.a - not found
-- Looking for lzma_lzma_preset in /opt/vesoft/third-party/lib/liblzma.a
-- Looking for lzma_lzma_preset in /opt/vesoft/third-party/lib/liblzma.a - not found
CMake Error at /opt/vesoft/toolset/cmake-3.15.5-Linux-x86_64/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find LibLZMA (missing: LIBLZMA_HAS_AUTO_DECODER
  LIBLZMA_HAS_EASY_ENCODER LIBLZMA_HAS_LZMA_PRESET) (found version "5.2.4")
Call Stack (most recent call first):
  /opt/vesoft/toolset/cmake-3.15.5-Linux-x86_64/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /opt/vesoft/toolset/cmake-3.15.5-Linux-x86_64/share/cmake-3.15/Modules/FindLibLZMA.cmake:72 (find_package_handle_standard_args)
  cmake/nebula/ThirdPartyConfig.cmake:106 (find_package)
  CMakeLists.txt:48 (include)


-- Configuring incomplete, errors occurred!

你好!首先请确认已经根据文档说明安装了相关依赖,并根据编译文档的说明进行操作。

如果问题依然出现,请试试clone common repo到本地,运行下third-party/install-third-party.sh,这样可以手动安装第三方库。

你把build目录删除,然后重新建立build之后,把执行cmake的过程截下图。

用的什么版本的gcc?
cmake的时候加上下列参数试试?
-DCMAKE_C_COMPILER=/path/gcc -DCMAKE_CXX_COMPILER=/path/g++

  1. 之前安装的1.0,在此环境上继续编译2.0。
    由于生产环境不能联网,1.0是通过第三方离线包编译安装的。

2.现在common编译成功了。
graph、storage需要从git上获取common。

    -- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /opt/vesoft/toolset/gcc/7.5.0/bin/gcc
-- Check for working C compiler: /opt/vesoft/toolset/gcc/7.5.0/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/vesoft/toolset/gcc/7.5.0/bin/g++
-- Check for working CXX compiler: /opt/vesoft/toolset/gcc/7.5.0/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /bin/git (found version "1.8.3.1")
-- Cloning from https://github.com/vesoft-inc/nebula-common.git
Cloning into '/**********/nebula2.0/nebula-graph-2.0.0-beta/modules/common'...

这一步卡住了。

  1. common 不需要make install? 和graph和storage如何共享?
#   NEBULA_COMMON_SOURCE_DIR       -- Path to nebula-common source directory
#   NEBULA_COMMON_BUILD_DIR        -- Path to nebula-common build directory

cmake 的时候在nebula-graph里面传入你本地nebula-common的绝对路径

比如:

cmake -DNEBULA_COMMON_SOURCE_DIR=/home/user/nebula-common  -DNEBULA_COMMON_BUILD_DIR=/home/user/nebula-common/build ..
1 个赞

modules下创建一个软链接就可以
ln -s //nebula2.0/nebula-common-2.0.0-beta //nebula2.0/nebula-graph-2.0.0-beta/modules/common

或者根据@dingding的建议cmake的时候加编译参数

1 个赞

编译成功了,谢谢各位。

2 个赞

你好,最近编译时也遇到了同样的问题,看到网站上有两个相关讨论,一个是重新安装third-party匹配的版本(自己已尝试,未能解决),另一个是当前解决方案(自己代码了路径配置了,build路径没配置)

两个方案尝试后都未能解决问题,请教下当时是怎么解决的?

你把你执行cmake过程截图

上文中build路径是为了设定common所在路径便于离线编译
如果你对环境是由网络的,不设定也可以。请发一下删除build目录后重新build的log,以便于我们定位问题。

此外,关于liblzma可以尝试安装liblzma-dev库,看看是否有帮助?

这是cmake执行内容:(服务器不能联网下载,所以采用了离线安装的方式)

/home/apps/oliver/NG_clion_remote/nebula-common-2.0.1/cmake-install-new/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=/opt/vesoft/toolset/gcc/7.5.0/bin/g++ -DENABLE_BUILD_STORAGE=on -DENABLE_TESTING=on -DMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local/nebula-remote-debug -DNEBULA_STORAGE_SOURCE_DIR=/home/apps/oliver/NG_clion_remote/nebula-storage-2.0.1 -DNEBULA_COMMON_SOURCE_DIR=/home/apps/oliver/NG_clion_remote/nebula-common-2.0.1 -DNEBULA_THIRDPARTY_ROOT=/opt/vesoft/third-party -G “CodeBlocks - Unix Makefiles” /home/apps/oliver/NG_clion_remote/nebula-graph-2.0.1
– The C compiler identification is GNU 4.4.7
– The CXX compiler identification is GNU 7.5.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /opt/vesoft/toolset/gcc/7.5.0/bin/g++
– Check for working CXX compiler: /opt/vesoft/toolset/gcc/7.5.0/bin/g++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Found Git: /bin/git (found version “2.4.5”)
– NEBULA_COMMON_SOURCE_DIR: /home/apps/oliver/NG_clion_remote/nebula-common-2.0.1

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 : on (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-remote-debug (Install path prefix, prepended onto install directories.)
– CMAKE_CXX_STANDARD : 14
– CMAKE_CXX_COMPILER : /opt/vesoft/toolset/gcc/7.5.0/bin/g++
– CMAKE_CXX_COMPILER_ID : GNU
– NEBULA_USE_LINKER : bfd
– CCACHE : Enabled but not found
Configuring third party for ‘Nebula Graph’ <<<<
– NEBULA_THIRDPARTY_ROOT : /opt/vesoft/third-party
– CMAKE_INCLUDE_PATH : /opt/vesoft/third-party/include
– CMAKE_LIBRARY_PATH : /opt/vesoft/third-party/lib64;/opt/vesoft/third-party/lib
– CMAKE_PROGRAM_PATH : /opt/vesoft/third-party/bin
– GLIBC_VERSION : 2.17

– Mstch_INCLUDE_DIR : /opt/vesoft/third-party/include
– Mstch_LIBRARY : /opt/vesoft/third-party/lib/libmstch.a
– Found ZLIB: /opt/vesoft/third-party/lib/libz.a (found version “1.2.11”)
– Found OpenSSL: /opt/vesoft/third-party/lib/libcrypto.a (found version “1.1.1c”)
– found krb5-config here /opt/vesoft/third-party/bin/krb5-config
– Found kerberos 5 headers: /opt/vesoft/third-party/include
– Found kerberos 5 libs: /opt/vesoft/third-party/lib/libgssapi_krb5.a;/opt/vesoft/third-party/lib/libkrb5.a;/opt/vesoft/third-party/lib/libk5crypto.a;/opt/vesoft/third-party/lib/libcom_err.a;/opt/vesoft/third-party/lib/libkrb5support.a
– Found Boost: /opt/vesoft/third-party/include (found version “1.67.0”)
– Found GPERF: /opt/vesoft/third-party/bin/gperf (found suitable version “3.1”, minimum required is “2.8”)
– Found Libunwind: /opt/vesoft/third-party/lib/libunwind.a
– Found BISON: /opt/vesoft/third-party/bin/bison (found suitable version “3.0.5”, minimum required is “3.0.5”)
– Found FLEX: /opt/vesoft/third-party/bin/flex (found version “2.6.4”)
– Looking for lzma_auto_decoder in /opt/vesoft/third-party/lib/liblzma.a
– Looking for lzma_auto_decoder in /opt/vesoft/third-party/lib/liblzma.a - not found
– Looking for lzma_easy_encoder in /opt/vesoft/third-party/lib/liblzma.a
– Looking for lzma_easy_encoder in /opt/vesoft/third-party/lib/liblzma.a - not found
– Looking for lzma_lzma_preset in /opt/vesoft/third-party/lib/liblzma.a
– Looking for lzma_lzma_preset in /opt/vesoft/third-party/lib/liblzma.a - not found
CMake Error at /home/apps/oliver/NG_clion_remote/nebula-common-2.0.1/cmake-install-new/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find LibLZMA (missing: LIBLZMA_HAS_AUTO_DECODER
LIBLZMA_HAS_EASY_ENCODER LIBLZMA_HAS_LZMA_PRESET) (found version “5.2.4”)
Call Stack (most recent call first):
/home/apps/oliver/NG_clion_remote/nebula-common-2.0.1/cmake-install-new/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/home/apps/oliver/NG_clion_remote/nebula-common-2.0.1/cmake-install-new/share/cmake-3.15/Modules/FindLibLZMA.cmake:72 (find_package_handle_standard_args)
/home/apps/oliver/NG_clion_remote/nebula-common-2.0.1/cmake/nebula/ThirdPartyConfig.cmake:104 (find_package)
CMakeLists.txt:94 (include)

– Configuring incomplete, errors occurred!
See also “/home/apps/oliver/NG_clion_remote/nebula-graph-2.0.1/cmake-build-debug-remote-host/CMakeFiles/CMakeOutput.log”.
See also “/home/apps/oliver/NG_clion_remote/nebula-graph-2.0.1/cmake-build-debug-remote-host/CMakeFiles/CMakeError.log”.
Cannot resolve path: D:\05_Project\02_Nebula_clion_mapping\nebula-graph-2.0.1\cmake-build-debug-remote-host

[Failed to reload]

Hi,感谢回复。

cmake相关内容在上面回复了,服务器不能连网下载,所以采用了离线安装的方式。

由于服务器不能连网,有安装liblzma-dev,但安装相关依赖库时,后面依赖 libc.so.6(GLIBC_2.32),就暂时未安装(如下的安装情况)

liblzma 不需要用户安装的,这个third-party里面已经是有的,我看了下,你应该是编译器有问题,你的gcc 是 4.4.7,然后路径有的是用系统目录的,有的是用我们提供的gcc,你可以重新安装下我们提供的,然后把build目录删除之后重新创建build,然后重新cmake看下。

安装我们的编译器后请注意声明环境变量来应用变更。

谢谢指正,gcc改成7.5.0后 common模块可以编译了。(之前只配置了g++,以为不会用到gcc)

好的,谢谢提醒,这次的问题就是gcc版本不一致导致的 :rofl: