RenderKit / oidn

Intel® Open Image Denoise library
https://www.openimagedenoise.org/
Apache License 2.0
1.77k stars 164 forks source link

Mac prebuilt denoise sample does not work due to @rpath usage #1

Closed aras-p closed 5 years ago

aras-p commented 5 years ago

The denoise example binary does not work on macOS.

This is seemingly due to it loading dylibs via @rpath/libOpenImageDenoise.0.dylib, but rpath itself is specified as /opt/intel//compilers_and_libraries_2019.1.144/mac/compiler/lib in the executable -- which very likely is a folder that does not exist on user's machine.

Probably needs to be built by setting rpath as needed for linker, or the executable patched after link via install_name_tool

atafra commented 5 years ago

Thanks! I'll have a look. Meanwhile it should work if you copy the dylib and the example into the same directory.

aras-p commented 5 years ago

Copying the dylibs into the executable folder was the first thing I tried, unfortunately it does not work. The executable says "load it from rpaht!", and rpath says /opt/intel//compilers_and_libraries_2019.1.144/mac/compiler/lib, so the OS tries there and nowhere else.

Doing an install_name_tool -add_rpath "@executable_path/../lib" denoise from within bin folder makes it work with the current folder structure, but I guess optimally the rpath would be set at build time.

lateralpunk commented 5 years ago

Weird, I didn't have to do anything special once I got it compiled on Mojave. https://github.com/OpenImageDenoise/oidn/issues/3#issuecomment-459567103 shows how I compiled.

Related question about the denoise sample. Can you provide some sample data files and documentation? I tried downloading https://openimagedenoise.github.io/images/sponza_16spp_input.jpg, using ImageMagick to convert it to PFM, but was very successful when running denoise (came back with an Error: option expected). I figure my input isn't correct.

atafra commented 5 years ago

Fixed it in devel, will be released in v0.8.1 soon. Thanks!

Regarding the sample usage: just run the sample without any arguments first to see the usage. e.g. for ldr images: ./denoise -ldr input.pfm -o output.pfm, but the image must not have gamma correction and it shouldn't be lossily compressed (e.g. jpg). For more sample related questions, please create a separate issue.