-
Clone
rust-lightninggit repo2. -
Install
clang-12and set it as the default versionlinux Ubuntu install and set it as the default version
macos
brew install llvm -
Install rust-src
linux
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnumacos
rustup component add rust-src --toolchain nightly-x86_64-apple-darwin -
Run script to build bindings
./genbindings.sh ../rust-lightning true >& genbindings.out -
Check
genbindings.outfor any warning or error messages
- Install open JDK 11 and maven
sudo apt update
sudo apt install openjdk-11-jdk maven- Clone
ldk-garbagecollectedrepo
git clone [email protected]:lightningdevkit/ldk-garbagecollected.git
cd ldk-garbagecollected- Run java tests
export LD_LIBRARY_PATH=.
mvn testAll good, test passes.
- Set rust toolchain
rustup default 1.51.0- Clone Matt's
rust-lightningrepo
git clone https://git.bitcoin.ninja/rust-lightning
cd rust-lightning
git checkout 2021-03-java-bindings-base
cd ..- Clone
ldk-c-bindingsrepo
git clone [email protected]:lightningdevkit/ldk-c-bindings.git
cd ldk-c-bindings- Install tools
rustup target add wasm32-wasi
# clang 10.0.1, gcc 9.3.0, g++ 9.3.0, valgrind 3.15.0
cargo install cbindgen g++ valgrind- Generate bindings
./genbindings.sh ../rust-lightning trueThis is where I'm stuck.. with error:
+ clang++ -Wall -Wno-nullability-completeness -pthread -std=c++11 -flto -O2 demo.cpp target/release/libldk.a -ldl
/usr/bin/ld: error: LLVM gold plugin has failed to create LTO module: Invalid record
clang: error: linker command failed with exit code 1 (use -v to see invocation)