electrs: `librocksdb` fails to build on a Raspberry Pi 4

I’ve had another try at compiling librocksdb on a Raspberry Pi 4, which is failing with the following error:

error occurred: Command "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-march=armv7-a" "-I" "rocksdb/include/" "-I" "rocksdb/" "-I" "rocksdb/third-party/gtest-1.8.1/fused-src/" "-I" "zstd/lib/" "-I" "zstd/lib/dictBuilder/" "-I" "." "-Wall" "-Wextra" "-std=c++11" "-Wno-unused-parameter" "-DZSTD=1" "-DNDEBUG=1" "-DOS_LINUX" "-DROCKSDB_PLATFORM_POSIX" "-DROCKSDB_LIB_IO_POSIX" "-o" "/home/xxx/git/electrs/target/release/build/librocksdb-sys-320abe6ed7d88d37/out/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.o" "-c" "rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.cc" with args "c++" did not execute successfully (status code exit code: 1).

I’ve now run the c++ compilation command outside the script, and it seems the architecture is either not supported or not properly detected:

~/.cargo/git/checkouts/rust-rocksdb-949349bba4a70d36/379c2d7/librocksdb-sys $ "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-march=armv7-a" "-I" "rocksdb/include/" "-I" "rocksdb/" "-I" "rocksdb/third-party/gtest-1.8.1/fused-src/" "-I" "zstd/lib/" "-I" "zstd/lib/dictBuilder/" "-I" "." "-Wall" "-Wextra" "-std=c++11" "-Wno-unused-parameter" "-DZSTD=1" "-DNDEBUG=1" "-DOS_LINUX" "-DROCKSDB_PLATFORM_POSIX" "-DROCKSDB_LIB_IO_POSIX" "-o" "/home/xxx/git/electrs/target/release/build/librocksdb-sys-320abe6ed7d88d37/out/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.o" "-c" "rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.cc"
In file included from rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/locktree.h:62,
                 from rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.h:59,
                 from rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.cc:56:
rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/../portability/toku_time.h:137:2: error: #error No timer implementation for this platform
 #error No timer implementation for this platform
  ^~~~~
rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/../portability/toku_time.h: In function ‘tokutime_t toku_time_now()’:
rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/../portability/toku_time.h:139:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^

_Originally posted by @craigraw in https://github.com/romanz/electrs/issues/308#issuecomment-845122206_

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (11 by maintainers)

Most upvoted comments

AFAIK Raspbian is still 32-bit and quite popular. Looking forward to this changing.

Yay! No errors!

Finished release [optimized] target(s) in 32m 23s

Ok, that worked. I will now try to index the database again, this did take around 1-2 days in the past.

@craigraw IIUC, https://github.com/romanz/electrs/commit/ce0018be5787e03b8f2c9c37a01178b29be68fe3 on p2p branch should use rocksdb 6.15.4 which should compile on ARM 32-bit. Could you please try building it on RPi4?