第一个基板链构建失败
build failed with first substrate chain
想根据他们的指南逐步创建我的第一个底物链 [1]:https://substrate.dev/docs/en/tutorials/create-your-first-substrate-chain/
运行 这个命令:cargo build --release
但出现此错误:
Compiling sc-chain-spec v3.0.0
The following warnings were emitted during compilation:
warning: Assembler messages:
warning: Error: can't open /tmp/cc02CgnB.s for reading: No such file or directory
error: failed to run custom build command for librocksdb-sys v6.11.4
Caused by:
process didn't exit successfully: ~/projects/rust-projects/substrate-node-template/target/release/build/librocksdb-sys-8abff3284793cb9b/build-script-build (exit code: 1)
--- stdout
cargo:rerun-if-changed=rocksdb/
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
HOST = Some("x86_64-unknown-linux-gnu")
CXX_x86_64-unknown-linux-gnu = None
CXX_x86_64_unknown_linux_gnu = None
HOST_CXX = None
CXX = None
CXXFLAGS_x86_64-unknown-linux-gnu = None
CXXFLAGS_x86_64_unknown_linux_gnu = None
HOST_CXXFLAGS = None
CXXFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
-- stderr
error occurred: Command "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "rocksdb/include/" "-I" "rocksdb/" "-I" "rocksdb/third-party/gtest-1.8.1/fused-src/" "-I" "snappy/" "-I" "." "-Wall" "-Wextra" "-std=c++11" "-Wno-unused-parameter" "-msse2" "-msse4.1" "-msse4.2" "-mpclmul" "-DSNAPPY=1" "-DNDEBUG=1" "-DHAVE_SSE42=1" "-DHAVE_PCLMUL=1" "-DOS_LINUX=1" "-DROCKSDB_PLATFORM_POSIX=1" "-DROCKSDB_LIB_IO_POSIX=1" "-o" "/home/kayvan/developer/projects/rust-projects/substrate-node-template/target/release/build/librocksdb-sys-1d9c3f88cabe429f/out/rocksdb/db/memtable.o" "-c" "rocksdb/db/memtable.cc" with args "c++" did not execute successfully
(status code exit code: 1)
WASM_BUILD_TOOLCHAIN=nightly-x86_64-unknown-linux-gnu cargo build --release
不需要包括 WASM 夜间工具链,这可能是 substrate v2.0 所必需的,但不再是 substrate v3.0
请按照guide here构建[节点模板v3.0:
git clone -b v3.0.0 --depth 1 https://github.com/substrate-developer-hub/substrate-node-template
cd substrate-node-template
# NOTE: you should always use the `--release` flag
cargo build --release
# ^^ this will take a while to do a release build!
在基于 arch 的 linux 中,您需要这些先决条件:
导出 OPENSSL_LIB_DIR="/usr/lib/openssl-1.0"
导出 OPENSSL_INCLUDE_DIR="/usr/include/openssl-1.0"
对于其他操作系统,请查看 ./docs/rust-setup.md
尝试使用 with-parity-db 特性进行编译,这样 rocksdb 就不会被编译。
如果你想要轻松的生活,那么在结帐目录中 运行nix-shell 它将安装所有必需的依赖项。
想根据他们的指南逐步创建我的第一个底物链 [1]:https://substrate.dev/docs/en/tutorials/create-your-first-substrate-chain/
运行 这个命令:cargo build --release 但出现此错误:
Compiling sc-chain-spec v3.0.0
The following warnings were emitted during compilation:
warning: Assembler messages:
warning: Error: can't open /tmp/cc02CgnB.s for reading: No such file or directory
error: failed to run custom build command for librocksdb-sys v6.11.4
Caused by:
process didn't exit successfully: ~/projects/rust-projects/substrate-node-template/target/release/build/librocksdb-sys-8abff3284793cb9b/build-script-build (exit code: 1)
--- stdout
cargo:rerun-if-changed=rocksdb/
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
HOST = Some("x86_64-unknown-linux-gnu")
CXX_x86_64-unknown-linux-gnu = None
CXX_x86_64_unknown_linux_gnu = None
HOST_CXX = None
CXX = None
CXXFLAGS_x86_64-unknown-linux-gnu = None
CXXFLAGS_x86_64_unknown_linux_gnu = None
HOST_CXXFLAGS = None
CXXFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
-- stderr
error occurred: Command "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "rocksdb/include/" "-I" "rocksdb/" "-I" "rocksdb/third-party/gtest-1.8.1/fused-src/" "-I" "snappy/" "-I" "." "-Wall" "-Wextra" "-std=c++11" "-Wno-unused-parameter" "-msse2" "-msse4.1" "-msse4.2" "-mpclmul" "-DSNAPPY=1" "-DNDEBUG=1" "-DHAVE_SSE42=1" "-DHAVE_PCLMUL=1" "-DOS_LINUX=1" "-DROCKSDB_PLATFORM_POSIX=1" "-DROCKSDB_LIB_IO_POSIX=1" "-o" "/home/kayvan/developer/projects/rust-projects/substrate-node-template/target/release/build/librocksdb-sys-1d9c3f88cabe429f/out/rocksdb/db/memtable.o" "-c" "rocksdb/db/memtable.cc" with args "c++" did not execute successfully
(status code exit code: 1)
WASM_BUILD_TOOLCHAIN=nightly-x86_64-unknown-linux-gnu cargo build --release
不需要包括 WASM 夜间工具链,这可能是 substrate v2.0 所必需的,但不再是 substrate v3.0
请按照guide here构建[节点模板v3.0:
git clone -b v3.0.0 --depth 1 https://github.com/substrate-developer-hub/substrate-node-template
cd substrate-node-template
# NOTE: you should always use the `--release` flag
cargo build --release
# ^^ this will take a while to do a release build!
在基于 arch 的 linux 中,您需要这些先决条件:
导出 OPENSSL_LIB_DIR="/usr/lib/openssl-1.0"
导出 OPENSSL_INCLUDE_DIR="/usr/include/openssl-1.0"
对于其他操作系统,请查看 ./docs/rust-setup.md
尝试使用 with-parity-db 特性进行编译,这样 rocksdb 就不会被编译。
如果你想要轻松的生活,那么在结帐目录中 运行nix-shell 它将安装所有必需的依赖项。