Compile OS X 10.9 MATLAB 2014a #110
Comments
Very likely you're linking against libstdc++ but not libc++, which is |
The mexopts.sh above uses -lstdc++ I tried changing the |
Different errors mean different things. Please try to parse out errors one by one. As a reference, I have my config example here. |
ok I started over with the original mexopts.sh that came with 2014a, and added/changed the lines in your example (link in previous comment). The MATLAB mex examples compile correctly, although they're in c not c++. When I compile mexopencv I now get the error below. I thought this line in mexopts.sh should have taken care of it:
|
Remove -DCHAR16_T if it’s not necessary in your environment. Matlab 2014a made a significant change in MEX configuration, but I don’t know what they are. |
Removing -DCHAR16_T goes back to the errors in my first post. Still no luck I found some good info for matlab 2013b here: but not much out there about 2014a. I'll try installing 2013b and see if I can get it working. |
I installed 2013b and I'm getting the same errors as with 2014a |
Try to define |
Ok, I tried both, although I might be screwing this up (I have zero c++ skills) When I define the macro
I get this error:
and when I define macro
I get this error:
|
The error says you already have CHAR16_T defined somewhere. Then, don’t define that macro in the compile-time option. |
oops wrote
|
The |
@ previous comment: I got this working, see next comment |
Here is what I did to get mexopencv working in MATLAB 2013b and 2014a running OS X 10.9 and Xcode 5.1 I edited mexopts.sh following your link I needed to link the non-matlab version of
I had to move the matlab builtin opencv so the mexopencv functions didn't find it, so I made a new directory called libopencv in /Applications/MATLAB_R2014a.app/bin/maci64/ and moved all the matlab opencv libraries in there
I'll write up a how to for dummies (like me) in a following post. There are a lot of people in the scientific community who could use mexopencv but aren't c++ savy |
Here is what I did to get mexopencv working in MATLAB 2013b and 2014a running OS X 10.9 and Xcode 5.1. All my packages are installed using Homebrew (everything in /usr/local/bin). Edit your 'mexopts.sh' file, located at change after change after Now compile mexopencv: Add the non-matlab version of libtiff when starting matlab |
thanks for your help |
Followed @davesc 's last comment, I got this error messages:
I'm using Yosemite, and I check there still exist |
Did you install Xcode CL tools? |
Yes.
I'm using Xcode 6.1 |
Then perhaps the mex configuration file has a wrong flag. The relevant line in your output is:
From this, I suspect that your |
I have those 2 lines contain |
This points to correct directory. |
Can you add |
Sorry, did you mean edit this line?
|
You can add |
I got this:
|
Apparently |
You are right! I need remove
I tried to add |
Could you post you |
I run the code below:
and I got the result:
Then how to solve this problem please? T . T |
@haipz What do you get if you type the following in UNIX shell (not in matlab) make MATLABDIR="/Applications/MATLAB_R2014b.app" MEXEXT=mexmaci64 -I/usr/local/Cellar/opencv/2.4.11/include -L/usr/local/Cellar/opencv/2.4.11/lib |
I run the code in iTerm2, and got this:
I success installed mexopencv the day before yesterday after read this issues, but there have something wrong with matlab and I can not open matlab, so I reinstall mexopencv today and got lots of error. |
Oops, that was not the solution. Basically you cannot have whitespace between
|
Oh, you are right.
and got the same error:
|
@haipz Hold on a second. You don't need to specify any extra in OS X. Just make sure your |
I reinstall the
and check the path of
Is it any wrong? |
@haipz I don't know your specific setting, but if things are set up correctly, you would see compiler flags by
If nothing is showing up, you probably have messed up your environment. |
Unluckly, I got this:
:-( I try my limited knowledge to solve this problem, but it doesn't work. |
@haipz do |
I solved the
Second, I found something wrong with
Finally, I got this in iTerm2:
But it is still the same wrong with |
@haipz No, you don't need any extra.
|
I try to make with
and I really don't know why this happen:
UPDATEI just to link
and I run
I am still trying to solve the new issuse. UPDATE AGAINI edit
|
@haipz
|
Sorry, I don't know how to do exactly. There are logs:
|
@haipz Your empty result is simply indicating your
For example, the above returns
Note that the above will be different depending on the environment (i.e., version). Alternative is to move |
@kyamagu Thank you for answering.
and get the correct result:
this seems right. After that I try the code you gave me, and the results is:
The only work one respond:
And I run the result got this:
|
@haipz Okay, then you can construct a launcher command by manually specifying all the dependent dylibs, like
Note that you must list all the dependencies above ( |
@kyamagu I run:
and here returns a new error:
|
@haipz I suspect this issue. |
@kyamagu Before I submit my comment, I have read this issue.
I don't have version 2.1.0 in the Cellar. I try to install homebrew-versions to find the older version, but homebrew-versions isn't include UPDATEI solve the version problem, I download
So far, I got new issue:
UPDATE AGAINI find the solution!!! I add
I hope my comments would be helpful for other people, and I post a article on my own blog |
@haipz Great :) |
I get the following error when trying to compile mexopencv on OS x 10.9 with MATLAB 2014a:
I have the matlab example mex files compiling correctly. I'm using the the mexopt.sh from this link: http://folk.ntnu.no/seljasen/Arbeider/GSL_and_openMP_mexopts.sh, which specifies gcc and gcc++ (I'm using gcc49).
Any help appreciated.
The text was updated successfully, but these errors were encountered: