Closed mandeep closed 4 years ago
I was able to solve this by fiddling with /usr/local/lib
and LD_LIBRARY_PATH, but I'm not sure this is the preferred solution.
Thanks for the bug report! It shouldn't be necessary to set LD_LIBRARY_PATH
at build time (maybe at runtime). At build time I use the OIDN_DIR
env. var to find the library, and it looks like that is set correctly in the log from cargo, so I'm not sure why it fails to find it.
I'll get CI running nightly as well and take a lookt
It looks like the nightly build passed, and I'm unable to replicate this again so I think it's safe to close this issue.
One thing I was wondering however, is if it's possible to pass ODIN_DIR at runtime rather than build time.
Since we need it to link the library in our build.rs build script, we need the OIDN_DIR
at build time. Do you mean more of specifying a library path to find the OIDN DLLs or SO files?
I'm using oidn-rs as a crate in my project and I'm trying to emulate the oidn-rs travis build in my build.rs. I keep running into a problem with OIDN_DIR not being set and I think it's related to this issue: https://github.com/rust-lang/cargo/issues/4121. I'm hoping to find a workaround but I'm not sure one exists at the application level.
That could be the issue you're having as well, where the OIDN_DIR
var is not propagated down to the crate, but if you set it as a global environment variable it seems like it should find it? I'm not sure how the env-var query works, but something like export OIDN_DIR=<path>
will be picked up from the environment. For example, the example in this crate doesn't have a build script but just uses the oidn-rs one to find OIDN_DIR
.
I was looking for your build script in your repo but couldn't find it, how were you trying to pass the OIDN_DIR
var over to oidn-rs? Propagating it through the build script may not work due to that issue, but setting it globally in the environment should.
Right now I'm using export OIDN_DIR=path
and also appending to LD_LIBRARY_PATH
. However, I feel like this isn't very portable and would prefer to have this set in a build.rs
build script. It seems that Cargo build scripts right now don't really have the capability of exporting environment variables for dependencies at compile time.
I used the Linux portion of the
.travis.yml
file to set up oidn-rs locally. Runningcargo build
in the oidn-rs root directory works without a hitch. However, once I runcargo build
inside theexamples/simple
directory I receive the error below. This is on the rust nightly channel.