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

在本地的ubantu系统下下载了源码进行阅读,编译rocksdb时,无法编译通过
核心报错为:
error: failed to run custom build command for `libtitan_sys v0.0.1
找了很多的方法,都没成功,求助下

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

要编tikv?还是rustrocksdb? 还是rocksdb?

rustrocksdb

git submodule update --init --recursive

这个搞了么?把子模块都下载下来。

执行过了的
在编译rustrocksdb之前,已经编译过tikv和raft,都成功了

不是报错的这个不存在吗,实际上存在吗?我用linux编的,也没遇到这些问题,按照手册执行就行了

是按照什么手册执行?方便给个链接或者文件么

https://github.com/tikv/rust-rocksdb
就这个readme啊。

$ git submodule update --init --recursive # if you just cloned the repository
$ cargo build

明白了,可能是我下的源码不全,我重新拉取一份试一下,非常感谢~!

rust-rocksdb就是个壳,把c++的rocksdb封一下给rust用。c++的rocksdb还是要有的,tikv引入了titan,所以titan也是要有的。至于有没有选项去掉,你可以找找。我这边没去掉。

嗯,我发现本地的目录下,确实没有titan这文件,重新下了源码,按照readme执行,依旧提示了老的报错

执行完git submodule init后有也没有titan吗?我这里有的。
image

这个文件夹里是有文件的么,我这里有titan,但是里面是空的

git submodule下不来吗?你得下载下来啊。
实在不行你手动下载以后放那里。路径:
https://github.com/tikv/titan.git
版本的话在.gitmodules里面

已经尝试过手动拉下来了
但是还是不行
还是在报错

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.
– 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/桌面/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/桌面/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/桌面/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/桌面/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/桌面/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/桌面/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/桌面/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/桌面/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/桌面/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/桌面/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/桌面/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/桌面/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/桌面/code/tikv/rust-rocksdb-master/librocksdb_sys/libtitan_sys/titan/CMakeLists.txt
– Configuring incomplete, errors occurred!
See also “/root/桌面/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/桌面/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/桌面/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/桌面/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/桌面/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/桌面/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/桌面/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/桌面/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/桌面/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

不懂了,自己搜搜吧。或者等其他人回答吧。

好的呢

关于源码问题可以去这里讨论,–> https://internals.tidb.io/

该主题在最后一个回复创建后60天后自动关闭。不再允许新的回复。