RocksDB fails to compile, error: failed to run custom build command for `libtitan_sys v0.0.1

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: rucksdb在编译时无法通过,error: failed to run custom build command for `libtitan_sys v0.0.1

| username: Lystorm

Downloaded the source code on the local Ubuntu system for reading, but encountered a compilation failure when compiling rocksdb. The core error is:

error: failed to run custom build command for `libtitan_sys v0.0.1

Tried many methods but none succeeded, seeking help.

Full log:

error: failed to run custom build command for `libtitan_sys v0.0.1 (/root/桌面/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys)`

Caused by:
  process didn't exit successfully: `/root/桌面/code/tikv/rust-rocksdb-master/target/debug/build/libtitan_sys-84a5a6c772a65c23/build-script-build` (exit status: 101)
  --- stdout
  CMAKE_TOOLCHAIN_FILE_x86_64-unknown-linux-gnu = None
  CMAKE_TOOLCHAIN_FILE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-unknown-linux-gnu = None
  CMAKE_GENERATOR_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-unknown-linux-gnu = None
  CMAKE_PREFIX_PATH_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = Some("/root/桌面/code/tikv/rust-rocksdb-master/target/debug/build/libz-sys-12485b2e29dd661a/out/build")
  CMAKE_x86_64-unknown-linux-gnu = None
  CMAKE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "-Wdev" "--debug-output" "/root/\xe6\xa1\x8c\xe9\x9d\xa2/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan" "-DROCKSDB_DIR=/root/\xe6\xa1\x8c\xe9\x9d\xa2/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/../rocksdb" "-DWITH_TITAN_TESTS=OFF" "-DWITH_TITAN_TOOLS=OFF" "-DWITH_ZLIB=ON" "-DWITH_BZ2=ON" "-DWITH_LZ4=ON" "-DWITH_ZSTD=ON" "-DWITH_SNAPPY=ON" "-DWITH_TITAN_TESTS=OFF" "-DWITH_TITAN_TOOLS=OFF" "-DCMAKE_INSTALL_PREFIX=/root/\xe6\xa1\x8c\xe9\x9d\xa2/code/tikv/rust-rocksdb-master/target/debug/build/libtitan_sys-8c8d3f418a565431/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
  Running with debug output on.

  --- stderr
  CMake Error: The source directory "/root/桌面/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan" does not exist.
  Specify --help for usage, or press the help button on the CMake GUI.
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 1

  build script failed, must exit now', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
| username: TiDBer_jYQINSnf | Original post link

Do you want to compile TiKV? Or rust-rocksdb? Or rocksdb?

| username: Lystorm | Original post link

rustrocksdb

| username: TiDBer_jYQINSnf | Original post link

Did you do this? Download all the submodules.
| username: Lystorm | Original post link

I have already executed it. Before compiling rustrocksdb, I had already compiled tikv and raft, both successfully.

| username: TiDBer_jYQINSnf | Original post link

Isn’t the error saying that this doesn’t exist? Does it actually exist? I compiled it using Linux and didn’t encounter these issues. Just follow the manual and it should be fine.

| username: Lystorm | Original post link

What manual is it executed according to? Could you provide a link or file?

| username: TiDBer_jYQINSnf | Original post link

Just this readme.

$ git submodule update --init --recursive # if you just cloned the repository
$ cargo build
| username: Lystorm | Original post link

Got it, it might be that the source code I downloaded is incomplete. I’ll try pulling a new copy. Thank you very much~!

| username: TiDBer_jYQINSnf | Original post link

rust-rocksdb is just a wrapper that encapsulates the C++ rocksdb for use in Rust. The C++ rocksdb is still necessary, and since TiKV has introduced Titan, Titan is also required. As for whether there is an option to remove it, you can look into it. I haven’t removed it on my end.

| username: Lystorm | Original post link

Hmm, I found that there is indeed no titan file in the local directory. I re-downloaded the source code and followed the readme to execute it, but the old error still appeared.

| username: TiDBer_jYQINSnf | Original post link

After executing git submodule init, is there no titan? I have it here.
image

| username: Lystorm | Original post link

Is there any file in this folder? I have titan here, but it’s empty inside.

| username: TiDBer_jYQINSnf | Original post link

Can’t get the git submodule? You need to download it.
If it doesn’t work, manually download it and place it there. Path:

As for the version, it’s in .gitmodules.

| username: Lystorm | Original post link

I have already tried to pull it manually, but it still doesn’t work and still reports an error:

error: failed to run custom build command for `libtitan_sys v0.0.1 (/root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys)`

Caused by:
  process didn't exit successfully: `/root/Desktop/code/tikv/rust-rocksdb-master/target/debug/build/libtitan_sys-84a5a6c772a65c23/build-script-build` (exit status: 101)
  --- stdout
  CMAKE_TOOLCHAIN_FILE_x86_64-unknown-linux-gnu = None
  CMAKE_TOOLCHAIN_FILE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-unknown-linux-gnu = None
  CMAKE_GENERATOR_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-unknown-linux-gnu = None
  CMAKE_PREFIX_PATH_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = Some("/root/Desktop/code/tikv/rust-rocksdb-master/target/debug/build/libz-sys-12485b2e29dd661a/out/build")
  CMAKE_x86_64-unknown-linux-gnu = None
  CMAKE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "-Wdev" "--debug-output" "/root/\xe6\xa1\x8c\xe9\x9d\xa2/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan" "-DROCKSDB_DIR=/root/\xe6\xa1\x8c\xe9\x9d\xa2/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/../rocksdb" "-DWITH_TITAN_TESTS=OFF" "-DWITH_TITAN_TOOLS=OFF" "-DWITH_ZLIB=ON" "-DWITH_BZ2=ON" "-DWITH_LZ4=ON" "-DWITH_ZSTD=ON" "-DWITH_SNAPPY=ON" "-DWITH_TITAN_TESTS=OFF" "-DWITH_TITAN_TOOLS=OFF" "-DCMAKE_INSTALL_PREFIX=/root/\xe6\xa1\x8c\xe9\x9d\xa2/code/tikv/rust-rocksdb-master/target/debug/build/libtitan_sys-8c8d3f418a565431/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
  Running with debug output on.
  -- The C compiler identification is GNU 11.2.0
     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerId.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeDetermineCCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  -- The CXX compiler identification is GNU 11.2.0
     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerId.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeDetermineCXXCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  -- Detecting C compiler ABI info
     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerABI.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  -- Detecting C compiler ABI info - done
     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerABI.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  -- Check for working C compiler: /usr/bin/cc - skipped
     Called from: [2]   /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  -- Detecting C compile features
     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompileFeatures.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  -- Detecting C compile features - done
     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompileFeatures.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  -- Detecting CXX compiler ABI info
     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerABI.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  -- Detecting CXX compiler ABI info - done
     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerABI.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
     Called from: [2]   /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  -- Detecting CXX compile features
     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompileFeatures.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  -- Detecting CXX compile features - done
     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompileFeatures.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  -- Found Git: /usr/bin/git (found version "2.34.1") 
     Called from: [4]   /usr/share/cmake-3.22/Modules/FindPackageMessage.cmake
                  [3]   /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake
                  [2]   /usr/share/cmake-3.22/Modules/FindGit.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  -- Configuring incomplete, errors occurred!
  See also "/root/Desktop/code/tikv/rust-rocksdb-master/target/debug/build/libtitan_sys-8c8d3f418a565431/out/build/CMakeFiles/CMakeOutput.log".

  --- stderr
  CMake Warning (dev) at /usr/share/cmake-3.22/Modules/CMakeDetermineCompiler.cmake:143 (set):
    Policy CMP0126 is not set: set(CACHE) does not remove a normal variable of
    the same name.  Run "cmake --help-policy CMP0126" for policy details.  Use
    the cmake_policy command to set the policy and suppress this warning.

    For compatibility with older versions of CMake, normal variable
    "CMAKE_C_COMPILER" will be removed from the current scope.
  Call Stack (most recent call first):
    /usr/share/cmake-3.22/Modules/CMakeDetermineCCompiler.cmake:68 (_cmake_find_compiler_path)
    CMakeLists.txt:2 (project)
  This warning is for project developers.  Use -Wno-dev to suppress it.

     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompiler.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeDetermineCCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  CMake Warning (dev) at /usr/share/cmake-3.22/Modules/CMakeDetermineCompiler.cmake:143 (set):
    Policy CMP0126 is not set: set(CACHE) does not remove a normal variable of
    the same name.  Run "cmake --help-policy CMP0126" for policy details.  Use
    the cmake_policy command to set the policy and suppress this warning.

    For compatibility with older versions of CMake, normal variable
    "CMAKE_CXX_COMPILER" will be removed from the current scope.
  Call Stack (most recent call first):
    /usr/share/cmake-3.22/Modules/CMakeDetermineCXXCompiler.cmake:66 (_cmake_find_compiler_path)
    CMakeLists.txt:2 (project)
  This warning is for project developers.  Use -Wno-dev to suppress it.

     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompiler.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeDetermineCXXCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  CMake Warning (dev) at /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerABI.cmake:49 (try_compile):
    Policy CMP0066 is not set: Honor per-config flags in try_compile()
    source-file signature.  Run "cmake --help-policy CMP0066" for policy
    details.  Use the cmake_policy command to set the policy and suppress this
    warning.

    For compatibility with older versions of CMake, try_compile is not honoring
    caller config-specific compiler flags (e.g.  CMAKE_C_FLAGS_DEBUG) in the
    test project.
  Call Stack (most recent call first):
    /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)
    CMakeLists.txt:2 (project)
  This warning is for project developers.  Use -Wno-dev to suppress it.

     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerABI.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  CMake Warning (dev) at /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerABI.cmake:49 (try_compile):
    Policy CMP0056 is not set: Honor link flags in try_compile() source-file
    signature.  Run "cmake --help-policy CMP0056" for policy details.  Use the
    cmake_policy command to set the policy and suppress this warning.

    For compatibility with older versions of CMake, try_compile is not honoring
    caller link flags (e.g.  CMAKE_EXE_LINKER_FLAGS) in the test project.
  Call Stack (most recent call first):
    /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)
    CMakeLists.txt:2 (project)
  This warning is for project developers.  Use -Wno-dev to suppress it.

     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerABI.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  CMake Warning (dev) at /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerABI.cmake:49 (try_compile):
    Policy CMP0066 is not set: Honor per-config flags in try_compile()
    source-file signature.  Run "cmake --help-policy CMP0066" for policy
    details.  Use the cmake_policy command to set the policy and suppress this
    warning.

    For compatibility with older versions of CMake, try_compile is not honoring
    caller config-specific compiler flags (e.g.  CMAKE_C_FLAGS_DEBUG) in the
    test project.
  Call Stack (most recent call first):
    /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)
    CMakeLists.txt:2 (project)
  This warning is for project developers.  Use -Wno-dev to suppress it.

     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerABI.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  CMake Warning (dev) at /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerABI.cmake:49 (try_compile):
    Policy CMP0056 is not set: Honor link flags in try_compile() source-file
    signature.  Run "cmake --help-policy CMP0056" for policy details.  Use the
    cmake_policy command to set the policy and suppress this warning.

    For compatibility with older versions of CMake, try_compile is not honoring
    caller link flags (e.g.  CMAKE_EXE_LINKER_FLAGS) in the test project.
  Call Stack (most recent call first):
    /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)
    CMakeLists.txt:2 (project)
  This warning is for project developers.  Use -Wno-dev to suppress it.

     Called from: [3]   /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerABI.cmake
                  [2]   /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake
                  [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  CMake Error at CMakeLists.txt:31 (include):
    include could not find requested file:

      cmake/rocksdb_flags.cmake


     Called from: [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  CMake Error at CMakeLists.txt:115 (CHECK_CXX_SOURCE_COMPILES):
    Unknown CMake command "CHECK_CXX_SOURCE_COMPILES".


     Called from: [1]   /root/Desktop/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 1

  build script failed, must exit now', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
| username: TiDBer_jYQINSnf | Original post link

I don’t understand, try searching for it yourself. Or wait for others to answer.

| username: Lystorm | Original post link

Okay.

| username: jansu-dev | Original post link

For questions about the source code, you can discuss them here: → https://internals.tidb.io/

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.