RenderToolbox / RenderToolbox4

Matlab toolbox for managing 3D scenes and physically-based rendering.
MIT License
48 stars 7 forks source link

Fresh Install of Rendertoolbox gives error for libIlmImf #43

Closed vijaysoophie closed 2 years ago

vijaysoophie commented 4 years ago

It is looking for

/usr/local/lib/libIlmImf-2_2.22.dylib

but I have a different file

/usr/local/lib/libIlmImf-2_3.24.dylib

I think I need to run some mexfile to update the binaries in RenderToolbox4_binary, but I am not sure which one.

Error for recipe "luminance-0_3500-reflectance-001-BigBall-Library": Invalid MEX-file '/Users/julian/Documents/MATLAB/toolboxes/RenderToolbox4_binary/build/ReadMultichannelEXR.mexmaci64': dlopen(/Users/julian/Documents/MATLAB/toolboxes/RenderToolbox4_binary/build/ReadMultichannelEXR.mexmaci64, 6): Library not loaded: /usr/local/lib/libIlmImf-2_2.22.dylib Referenced from: /Users/julian/Documents/MATLAB/toolboxes/RenderToolbox4_binary/build/ReadMultichannelEXR.mexmaci64 Reason: image not foundSaving error info to "/Volumes/G-DRIVE USB/VirtualWorldColorConstancy/StimuliCondition2_covScaleFactor_0_001_NoReflection/Originals/Errors/luminance-0_3500-reflectance-001-BigBall-Library.mat":

DavidBrainard commented 4 years ago

We will look into this.

DavidBrainard commented 4 years ago

Vijay reports offline that the following worked:

"The mexfile in RenderToolbox4_Binary/build needs to be updated. I generated new mex file by running rtbMakeReadMultichannelEXR.m. This creates the mexfiles in RenderToolbox4/Utilities/ReadMultichannelEXR/ReadMultichannelEXR. I manually replaced this file in RenderToolbox4_Binary/build and the rendering worked. "

I updated the TbTb config for RTB4 so that the binaries won't get clobbered on each invokation of tbUse. This is good, but has the downside that should we ever modify the binaries in some interesting way, you won't get them unless you delete your RenderToolbox4_Binary toolbox. I think that is OK for now, but leaving this issue open.

DavidBrainard commented 4 years ago

Also added the need to do this copies in the instructions.

vijaysoophie commented 2 years ago

This issue returned. This time 'rtbMakeReadMultichannelEXR.m' does not complie on a newer computer (MacOSX Bigsur). The error is pasted below. Assuming the issue was with OpenEXR, I tried to install older version of openEXR but it gave another error:

ld: can't write output file: ../../bin/exr2aces for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [bin/exr2aces] Error 1 make[1]: [OpenEXR/exr2aces/CMakeFiles/exr2aces.dir/all] Error 2 make: *** [all] Error 2

See issue #22 by Ben about OpenEXR libraries.

Building with 'Xcode Clang++'. /usr/bin/xcrun -sdk macosx11.3 clang++ -c -DMATLAB_DEFAULT_RELEASE=R2017b -DUSE_MEX_CMD -DMATLAB_MEX_FILE -I"/usr/local/include/OpenEXR" -I"/usr/include/OpenEXR" -I"/opt/local/include/OpenEXR" -I"/Applications/MATLAB_R2018a.app/extern/include" -I"/Applications/MATLAB_R2018a.app/simulink/include" -fno-common -arch x86_64 -mmacosx-version-min=10.9 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -fobjc-arc -std=c++11 -stdlib=libc++ -O2 -fwrapv -DNDEBUG "/Users/julian/Documents/MATLAB/toolboxes/RenderToolbox4/Utilities/ReadMultispectralEXR/ReadMultichannelEXR/ReadMultichannelEXR.cpp" -o /var/folders/hp/ssq9bwp94v371h_sdz_rg9000000gn/T/mex_10283136009616_8836/ReadMultichannelEXR.o Error using mex In file included from /Users/julian/Documents/MATLAB/toolboxes/RenderToolbox4/Utilities/ReadMultispectralEXR/ReadMultichannelEXR/ReadMultichannelEXR.cpp:22: In file included from /usr/local/include/OpenEXR/ImathBox.h:65: In file included from /usr/local/include/OpenEXR/ImathVec.h:46: In file included from /usr/local/include/OpenEXR/ImathExc.h:47: In file included from /usr/local/include/OpenEXR/IexBaseExc.h:9: In file included from /usr/local/include/OpenEXR/IexNamespace.h:49: /usr/local/include/OpenEXR/IexConfig.h:19:9: warning: 'IEX_INTERNAL_NAMESPACE' macro redefined [-Wmacro-redefined]

define IEX_INTERNAL_NAMESPACE Iex_3_1

    ^

/usr/local/include/OpenEXR/IlmBaseConfig.h:32:9: note: previous definition is here

define IEX_INTERNAL_NAMESPACE Iex_2_5

    ^

/Users/julian/Documents/MATLAB/toolboxes/RenderToolbox4/Utilities/ReadMultispectralEXR/ReadMultichannelEXR/ReadMultichannelEXR.cpp:57:29: error: member access into incomplete type 'const Imf_3_1::Header' Box2i dw = file.header().dataWindow(); ^ /usr/local/include/OpenEXR/ImfForward.h:31:23: note: forward declaration of 'Imf_3_1::Header' class IMF_EXPORT_TYPE Header; ^ /Users/julian/Documents/MATLAB/toolboxes/RenderToolbox4/Utilities/ReadMultispectralEXR/ReadMultichannelEXR/ReadMultichannelEXR.cpp:61:48: error: member access into incomplete type 'const Imf_3_1::Header' const ChannelList &channels = file.header().channels(); ^ /usr/local/include/OpenEXR/ImfForward.h:31:23: note: forward declaration of 'Imf_3_1::Header' class IMF_EXPORT_TYPE Header; ^ /Users/julian/Documents/MATLAB/toolboxes/RenderToolbox4/Utilities/ReadMultispectralEXR/ReadMultichannelEXR/ReadMultichannelEXR.cpp:109:21: error: variable has incomplete type 'Imf_3_1::FrameBuffer' FrameBuffer frameBuffer; ^ /usr/local/include/OpenEXR/ImfForward.h:75:24: note: forward declaration of 'Imf_3_1::FrameBuffer' class IMF_EXPORT_TYPE FrameBuffer; ^ /Users/julian/Documents/MATLAB/toolboxes/RenderToolbox4/Utilities/ReadMultispectralEXR/ReadMultichannelEXR/ReadMultichannelEXR.cpp:118:25: error: use of undeclared identifier 'Slice' Slice(HALF, ^ /Users/julian/Documents/MATLAB/toolboxes/RenderToolbox4/Utilities/ReadMultispectralEXR/ReadMultichannelEXR/ReadMultichannelEXR.cpp:145:25: error: use of undeclared identifier 'Slice' Slice(HALF, ^ /Users/julian/Documents/MATLAB/toolboxes/RenderToolbox4/Utilities/ReadMultispectralEXR/ReadMultichannelEXR/ReadMultichannelEXR.cpp:172:25: error: use of undeclared identifier 'Slice' Slice(HALF, ^ 1 warning and 6 errors generated.

Error in rtbMakeReadMultichannelEXR (line 44) eval(mexCmd);

DavidBrainard commented 2 years ago

My desktop is running Big Sur and:

a) I was able to duplicate your problem by running rtbTestInstallation.

b) There was a message that I needed to update subversion with instructions. I followed these, which were to run "brew install subversion" in the command window. If you don't have homebrew installed on your machine, you would need to do that first.

c) I recompiled ReadMultichannelEXR by doing the following in Matlab:

cd ReadMultichannelEXR/ ls ReadMultichannelEXR.cpp ReadMultichannelEXR.mexmaci64 TestSphereBlender.exr TestSphereMitsuba.exr mexopts.sh rtbMakeReadMultichannelEXR.m rtbReadMultichannelEXR.m

rtbMakeReadMultichannelEXR

This generated a pile of output and produced an updated ReadMultichannelEXR.mexmaci64.

d) I copied ReadMultichannelEXR.mexmaci64 to the toolbox RenderToolbox4_binary/build. Before I did this, I renamed the old version that was there with an extension .old, just in case.

e) Running rtbTestInstallation again ran without errors.

This ought to work because I think my machine is pretty vanilla Big Sur. But you never know. In case the procedure above doesn't work, you can try the binary mex file attached here.

Let me know how it goes. ReadMultichannelEXR.mexmaci64.zip

DavidBrainard commented 2 years ago

From: Vijay Singh vsin@sas.upenn.edu Date: Thursday, January 20, 2022 at 6:17 PM To: "Brainard, David H" brainard@psych.upenn.edu Cc: "Cottaris, Nicolas" cottaris@psych.upenn.edu Subject: Re: [RenderToolbox/RenderToolbox4] Fresh Install of Rendertoolbox gives error for libIlmImf (#43)

This worked with openexr 2.5.2.

Also, there was some issue with struct2xml.m on Matlab 2018a version, but on newer versions of Matlab things work fine.

I am going to start thinking about binocular rendering from tomorrow. I will update you when I am able to do it.

On Wed, Jan 12, 2022 at 8:39 PM Brainard, David H brainard@psych.upenn.edu wrote: dhb@iMac ~ % brew list --version openexr openexr 2.5.2 dhb@iMac ~ %

From: Vijay Singh vsin@sas.upenn.edu Date: Wednesday, January 12, 2022 at 3:19 PM To: "Brainard, David H" brainard@psych.upenn.edu Cc: "Cottaris, Nicolas" cottaris@psych.upenn.edu Subject: Re: [RenderToolbox/RenderToolbox4] Fresh Install of Rendertoolbox gives error for libIlmImf (#43)

The issue might be due to the version of OpenEXR I have. Could you please tell me which version is installed on your computer?

On Wed, Jan 12, 2022 at 3:02 PM Vijay Singh vsin@sas.upenn.edu wrote: Hi David,

I followed the steps you provided. I was not able to compile readMultichannelEXR. When I do rtdMakeReadMultichannelEXR I get the error below. I also tried using the binary you provided, but it doesn't work as it was not compiled on my machine.

DavidBrainard commented 2 years ago

Great that it is now working. Closing this issue.