mitsuba-renderer / mitsuba2

Mitsuba 2: A Retargetable Forward and Inverse Renderer
Other
2.05k stars 266 forks source link

rgb2spec_opt fails to run on Mac Os Catalina #75

Open SergeyShlyaev opened 4 years ago

SergeyShlyaev commented 4 years ago

External utility rgb2spec_opt currently compiles but does not run on Mac Os Catalina 10.15.4 and Xcode 11.3.1.

login$ mitsuba2/build/ext_build/rgb2spec/rgb2spec_opt 
dyld: Library not loaded: @rpath/libtbb.dylib
  Referenced from: mitsuba2/build/ext_build/rgb2spec/rgb2spec_opt
  Reason: image not found
Abort trap: 6

File it complains about, libtbb.dylib is present in the same folder as executable. Tried adding this folder to LD_LIBRARY_PATH or DYLD_LIBRARY_PATH as a test. Does not seem to solve the issue.

What can be the best way to solve it without recompiling everything? Mitsuba2 itself works well and is awesome.

Thanks

Edit: correctly specified OS version

wjakob commented 4 years ago

I think you need to run rgb2spec_opt at the place where it was built. This should work fine -- after all, the build system runs it and generates some output that is needed to compile Mitsuba.

SergeyShlyaev commented 4 years ago

It is run at the place where it was built. Same machine, didn't change any folder structure.

It is puzzling a bit because mitsuba seem to use libtbb and it works.

carlos-urena commented 2 years ago

I just faced this issue. I think the problem is that when 'rgb2spec_opt' is run, macOs is not loading the dynamic library file 'libtbb.dylib' which is on that folder, I guess this comes from security precautions. I tried to install 'tbb' package with homebrew, but unfortunatelly that version of 'tbb' lacks a symbol which is needed. So at the end, I just created a symlink from '/usr/local/lib' to the .dylib file in the folder. Then I manually run 'rgb2spec_opt' in order to generate 'srgb.coeff' file. After that, 'ninja' built the mitsuba executable with no more problems. This is not by far the most elegant solution, but it just works.

IYuan505 commented 2 years ago

Solved by

cd mitsuba2/build/ext_build/rgb2spec/;
install_name_tool -change @rpath/libtbb.dylib @executable_path/libtbb.dylib rgb2spec_opt;

and run ninja again should work.