RenderToolbox / RenderToolbox3

Matlab toolbox for managing graphics rendering for psychophysics
Other
5 stars 2 forks source link

MakeReadMultichannelEXR fails with XCode (6.4) and 2014b #30

Closed benjamin-heasly closed 7 years ago

benjamin-heasly commented 9 years ago

From David:

I’m using a new machine. I downloaded RTB 3 and then tried to compile ReadMultichannelEXR using our Make m file.

Here is the error:

>> MakeReadMultichannelEXR
mex -I/usr/local/include/OpenEXR -I/usr/include/OpenEXR -I/opt/local/include/OpenEXR -L/usr/local/lib -L/usr/lib -L/opt/local/lib -lIlmImf -lz -lImath -lHalf -lIex -lIlmThread -lpthread -output ReadMultichannelEXR ReadMultichannelEXR.cpp
Building with 'Xcode Clang++'.
Error using mex
Undefined symbols for architecture x86_64:
  "_mxArrayToString", referenced from:
      _mexFunction in ReadMultichannelEXR.o
  "_mxCreateDoubleScalar", referenced from:
      _mexFunction in ReadMultichannelEXR.o
  "_mxCreateLogicalScalar", referenced from:
      _mexFunction in ReadMultichannelEXR.o
  "_mxCreateNumericArray_700", referenced from:
      _mexFunction in ReadMultichannelEXR.o
  "_mxCreateString", referenced from:
      _mexFunction in ReadMultichannelEXR.o
  "_mxCreateStructArray_700", referenced from:
      _mexFunction in ReadMultichannelEXR.o
  "_mxFree", referenced from:
      _mexFunction in ReadMultichannelEXR.o
  "_mxGetPr", referenced from:
      _mexFunction in ReadMultichannelEXR.o
  "_mxIsChar", referenced from:
      _mexFunction in ReadMultichannelEXR.o
  "_mxSetField_700", referenced from:
      _mexFunction in ReadMultichannelEXR.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I suspect this has something to do with the fact that I’m using the latest XCode (6.4) with 2014b.

benjamin-heasly commented 9 years ago

This seems to be an ongoing saga. See also #25 .

It seems that XCode is a moving target, and updates tend to break the Matlab mexopts configuration.

benjamin-heasly commented 9 years ago

I also encountered this with OS X 10.10, XCode 6.4, and Matlab 2014b.

I got the build to work by editing MATLAB_R2014b.app/bin/mexopts.sh. I put a copy of this mexopts to our Admin folder.

To install it:

Now MakeReadMultichannelEXR should work.

If you try this, please add a comment with your results -- good or bad.

DavidBrainard commented 9 years ago

I tried this but it didn't fix the problem -- same error or one that looks very much like it.

But, I never got an option to choose MATLAB_R2014b.app/bin/mexopts.sh. When I run mex -setup I don't get asked anything.

It does say I can choose mex -setup C, mex -setup C++, or also Fortan. Neither C nor C++ worked.

So I am not confident I am invoking the new mexopts.sh file.

benjamin-heasly commented 9 years ago

I wonder why you don't get to pick the new mexopts.sh.

I think the effect of the mex command is to copy the chosen mexopts.sh to your home folder: ~/.matlab/R2014b/mexopts.sh

Perhaps you can replace this one and try again?

On Wed, Sep 9, 2015 at 5:04 PM, David Brainard notifications@github.com wrote:

I tried this but it didn't fix the problem -- same error or one that looks very much like it.

But, I never got an option to choose MATLAB_R2014b.app/bin/mexopts.sh. When I run mex -setup I don't get asked anything.

It does say I can choose mex -setup C, mex -setup C++, or also Fortan. Neither C nor C++ worked.

So I am not confident I am invoking the new mexopts.sh file.

— Reply to this email directly or view it on GitHub https://github.com/RenderToolbox3/RenderToolbox3/issues/30#issuecomment-139045211 .

DavidBrainard commented 9 years ago

This worked. And indeed, once I had a mexopts.sh in my ~/.matlab folder, it did ask me which one I wanted to use. Seems like a Matlab mex setup bug, but probably worth adding this info to the instructions.

Also note that Matlab now issues a warning about the fact that the MEX API is changing and that mex files need to be updated.

benjamin-heasly commented 8 years ago

Here is another data point with OS X 10.11, XCode 7.0, and Matlab 2015b.

To install it:

I think in 2015b, you no longer need to run mex -setup.

Now MakeReadMultichannelEXR should work.

benjamin-heasly commented 8 years ago

For Version 3, we are planning to put pre-build executables on our Archiva server. This should take some pressure off of this issue.

benjamin-heasly commented 7 years ago

Closing this issue. It should be addressed in RenderToolbox4: https://github.com/RenderToolbox/RenderToolbox4