1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 01:43:29 +01:00

Merge pull request #696 from ayanamidev/master

Add guide for other Ubuntu & Debian releases to compile and install librocksdb
This commit is contained in:
Roman Zeyde 2022-04-01 16:28:26 +03:00 committed by GitHub
commit 2b1b0f2f04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,6 +59,15 @@ On [Debian 11 (bullseye)](https://packages.debian.org/bullseye/librocksdb-dev) a
$ sudo apt install librocksdb-dev=6.11.4-3
```
For other versions of Debian or Ubuntu, you can build librocksdb and install inside `/usr/local` directory using following command.
```bash
$ sudo apt install -y libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev
$ git clone -b v6.11.4 --depth 1 https://github.com/facebook/rocksdb && cd rocksdb
$ make shared_lib -j $(nproc) && sudo make install-shared
$ cd .. && rm -r rocksdb
```
#### Preparing for cross compilation
Cross compilation can save you some time since you can compile `electrs` for a slower computer (like Raspberry Pi) on a faster machine
@ -140,6 +149,12 @@ Relevant issues: [#134](https://github.com/romanz/electrs/issues/134) and [#391]
$ ROCKSDB_INCLUDE_DIR=/usr/include ROCKSDB_LIB_DIR=/usr/lib cargo build --locked --release
```
Or if you have installed librocksdb from source
```
$ ROCKSDB_INCLUDE_DIR=/usr/local/include ROCKSDB_LIB_DIR=/usr/local/lib cargo build --locked --release
```
#### Cross compilation
Run one of the commands above (depending on linking type) with argument `--target aarch64-unknown-linux-gnu` and prepended with env vars: `BINDGEN_EXTRA_CLANG_ARGS="-target gcc-aarch64-linux-gnu" RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc"`