mimblewimble / cuckoo-miner

Mining wrapper around the Cuckoo Cycle proof of work system for the Grin/MimbleWimble blockchain.
Apache License 2.0
52 stars 16 forks source link

Rust dynamic dependencies #2

Closed yeastplume closed 7 years ago

yeastplume commented 7 years ago

It seems when building the plugins within cuckoo miner, cargo adds some dynamic dependencies to rust DLLs, causing loading to fail if they're not on the dynamic linker path. You don't see this issue in cargo, because cargo sets all the environment variables properly, but when running standalone, you might get a message that the plugin directory isn't able to load.

This may propagate into grin... at the moment there are two solutions:

Either add the rust DLLs to the linker path, e.g:

export LD_LIBRARY_PATH=/home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib

OR

Build via the plugins via the cmake project, which is at:

https://github.com/mimblewimble/cuckoo-miner-plugins

When building via cmake, these dependencies aren't included, and the DLLs don't have the rust dependency.

I think the long term fix here is to include and use the cmake build instead of building the plugins internally, which will have benefits in that platform can be detected, the presence of CUDA/opencl can be detected and used if present and the right versions of the libraries can be built, etc. The downside is that anything that includes cuckoo-miner (just thinking of grin at the moment,) will need to have cmake installed as a build dependency, and it will take a little while to iron out the cmake build to ensure it works on all platforms.

ignopeverell commented 7 years ago

I agree on using the cmake build instead. We may also eventually publish a binary for each platform to make that easier.