tag:blogger.com,1999:blog-5405478043203825474.post1013674453903894813..comments2013-01-09T08:01:57.892-08:00Comments on Dog Bytes: Compiling MEX files on Ubuntu 11.04 amd64 with MATLAB 2011a, 2010b, and 2010aSyrus Nemat-Nasserhttp://www.blogger.com/profile/13080292789676659593noreply@blogger.comBlogger20125tag:blogger.com,1999:blog-5405478043203825474.post-13120401320838311142013-01-09T08:01:57.892-08:002013-01-09T08:01:57.892-08:00After applying Schmichael's method I was able ...After applying Schmichael's method I was able to compile with MEX, <br />but the created function gives a segmentation error (see below). <br />Here is what I get:<br /><br />> Test<br />Testing the spherical Fourier transform code<br />Try all individual spherical harmonics from j=0 .. 2*bandwidth<br />Watch for aliasing once j>bandwidth<br />Press any key to start<br /><br />bandwidth =<br /><br /> 5<br /><br /><br /><br /><br />****************<br />Testing with j=0, m=0:<br /><br />------------------------------------------------------------------------<br /> Segmentation violation detected at Wed Jan 9 16:59:59 2013<br />------------------------------------------------------------------------<br /><br />Configuration:<br /> MATLAB Version: 7.9.0.529 (R2009b)<br /> MATLAB License: 161051<br /> Operating System: Linux 2.6.38-12-generic #51-Ubuntu SMP Wed Sep 28 14:27:32 UTC 2011 x86_64<br /> GNU C Library: 2.13 stable<br /> Window System: The X.Org Foundation (11001000), display :0.0<br /> Current Visual: 0x23 (class 4, depth 24)<br /> Processor ID: x86 Family 6 Model 10 Stepping 7, GenuineIntel<br /> Virtual Machine: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode<br /> Default Encoding: UTF-8<br /><br />Fault Count: 1<br /><br />Register State:<br /> rax = 0000000000000001 rbx = 0000000000000001<br /> rcx = 00007fcda5145370 rdx = 0000000000000001<br /> rbp = 00007fcdaaebb540 rsi = 00007fcdaaebb540<br /> rdi = 0000000000000004 rsp = 00007fcdaaebb468<br /> r8 = 0000000000000000 r9 = 0000000000000001<br /> r10 = 0000000000000b90 r11 = 0000000000000000<br /> r12 = 0000000000000001 r13 = 0000000000000001<br /> r14 = 0000000000000000 r15 = 0000000000000000<br /> rip = 0000000000000000 flg = 0000000000010202<br /><br />Stack Trace:<br /> [0] 0x0000000000000000(0x7fcda40d2000, 0, 16, 0x7fcda4a3d8b0)<br /><br />This error was detected while a MEX-file was running. If the MEX-file<br />is not an official MathWorks function, please examine its source code<br />for errors. Please consult the External Interfaces Guide for information<br />on debugging MEX-files.<br /><br />If it is an official MathWorks function, please<br />follow these steps to report this problem to The MathWorks so we<br />have the best chance of correcting it:<br /><br />The next time MATLAB is launched under typical usage, a dialog box will<br />open to help you send the error log to The MathWorks. Alternatively, you<br />can send an e-mail to segv@mathworks.com with the following file attached:<br /> /home/panos/matlab_crash_dump.20315<br /><br />If the problem is reproducible, please submit a Service Request via:<br /> http://www.mathworks.com/support/contact_us/ts/help_request_1.html<br /><br />A technical support engineer might contact you with further information.<br /><br />Thank you for your help. MATLAB may attempt to recover, but even if recovery appears successful,<br />we recommend that you save your workspace and restart MATLAB as soon as possible.<br /><br />Caught MathWorks::System::FatalException<br />[Please exit and restart MATLAB]>> Ibexhttps://www.blogger.com/profile/02170075072680251971noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-63685921291014867362012-05-03T02:23:49.938-07:002012-05-03T02:23:49.938-07:00Thnx, schmichael's method worked perfectly for...Thnx, schmichael's method worked perfectly for me :)Sabyasachihttps://www.blogger.com/profile/01688296359470230325noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-90863789985368153832012-04-17T00:36:33.935-07:002012-04-17T00:36:33.935-07:00You turned out to be my savior! Spent lot of time ...You turned out to be my savior! Spent lot of time before ending up here and your method worked like a charm. Thanks!Anonymoushttps://www.blogger.com/profile/16823609677817015004noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-16194185769024882202012-02-06T09:10:30.179-08:002012-02-06T09:10:30.179-08:00Thank you very much! schmichael's method and t...Thank you very much! schmichael's method and the solution of the post worked perfectly for me, with ubuntu 11.04<br /><br />I must add the issue that after running a mex-compiled file, the comand `exit' doesn't work any more (but exit(0) works well)...Un sujeto sin importanciahttps://www.blogger.com/profile/16488639040941781058noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-40176289628110799402012-01-13T17:35:50.770-08:002012-01-13T17:35:50.770-08:00Hi vijay,
Although I haven't used schmichael&...Hi vijay,<br /><br />Although I haven't used schmichael's method, I might be able to help. Did you make sure that /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14 exists on your system? In my up-to-date Ubuntu Oneiric install, I have /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16 rather than version 6.0.14. It's important to make sure you are linking to an actual file. Good luck.Syrus Nemat-Nasserhttps://www.blogger.com/profile/13080292789676659593noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-90958806023316066432012-01-12T21:48:11.448-08:002012-01-12T21:48:11.448-08:00$ sudo rm libstdc++.so.6
$ sudo ln -s /usr/lib/x86...$ sudo rm libstdc++.so.6<br />$ sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14 libstdc++.so.6<br /><br />When I try this the matlab doesnt start-up at all..vijayhttps://www.blogger.com/profile/00122511313263921757noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-42403842384206567432011-10-12T06:38:50.877-07:002011-10-12T06:38:50.877-07:00I have the following fix which works with stock Na...I have the following fix which works with stock Natty gcc/g++ compiler (mine is 4.5.2-8ubuntu4). If you use this workaround, you do NOT need to install gcc/g++ 4.4 or edit mexopts.sh.<br /><br />Do the following at terminal:<br /><br />$ cd /usr/local/MATLAB/R2011b/sys/os/glnxa64<br /><br />[this assumes default install location on 64-bit Ubuntu]<br /><br />$ sudo rm libstdc++.so.6<br />$ sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14 libstdc++.so.6<br /><br />[the target libstdc++.so.6.X.XX version may vary]<br /><br />I'm not sure about gfortran compilation as I only use C/C++ code.<br /><br />Hope that helps anyone out there with the same problems!<br /><br />Cheers,<br />Mikemikepcwhttps://www.blogger.com/profile/17843510349682471647noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-5216514948585930042011-10-12T06:35:04.016-07:002011-10-12T06:35:04.016-07:00This comment has been removed by the author.mikepcwhttps://www.blogger.com/profile/17843510349682471647noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-26710237413949892062011-10-12T06:05:44.217-07:002011-10-12T06:05:44.217-07:00This comment has been removed by the author.mikepcwhttps://www.blogger.com/profile/17843510349682471647noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-83285073330021787722011-10-06T04:21:26.307-07:002011-10-06T04:21:26.307-07:00Great post (and shame on Matlab QA ..). You saved ...Great post (and shame on Matlab QA ..). You saved my day also (unfortunately, i didn't avoid spending a day on trying to install gcc-3.4 :( )<br /><br />One question:<br />Natty comes with gcc-4.5, so naturally i tried your method with 4.5 instead of 4.4. <br />It didn't work.<br />Any idea why?SpeechLesshttps://www.blogger.com/profile/05647908645952642220noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-16560677010789883502011-10-05T20:27:49.826-07:002011-10-05T20:27:49.826-07:00Hi Halcon,
How about you try to verify it yourself...Hi Halcon,<br />How about you try to verify it yourself by starting with a very simple mex file like the "hello world" example in the <a href="http://www.mathworks.com/support/tech-notes/1600/1605.html#example1" rel="nofollow">MATLAB mex documentation</a>?Syrus Nemat-Nasserhttps://www.blogger.com/profile/13080292789676659593noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-72286264587419657902011-10-05T17:55:23.407-07:002011-10-05T17:55:23.407-07:00Could you help me?
I'm new in Ubuntu. I made a...Could you help me?<br />I'm new in Ubuntu. I made all the steps but I can't compile this .mex file "http://www.cs.berkeley.edu/~smaji/projects/fiksvm/" yet. Could you compile this to verify if it's the problem?falcon_evhttps://www.blogger.com/profile/09567312338188882762noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-82984555571397874992011-09-18T14:31:38.172-07:002011-09-18T14:31:38.172-07:00It worked for me. Thank you!It worked for me. Thank you!plasmhttps://www.blogger.com/profile/06351471524425618637noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-72789321751478775662011-09-15T14:33:16.840-07:002011-09-15T14:33:16.840-07:00thanks a lotthanks a lotAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-79654632439603440052011-08-08T06:45:09.292-07:002011-08-08T06:45:09.292-07:00Thanks a bunch!! Your post saved my day :)Thanks a bunch!! Your post saved my day :)Esben Plengehttps://www.blogger.com/profile/16180392354961803001noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-53859479772444367982011-07-29T15:19:08.698-07:002011-07-29T15:19:08.698-07:00Hi Christopher,
I don't have any insight to y...Hi Christopher,<br /><br />I don't have any insight to your post-compile problem. If your MEX function includes external C-language source code, perhaps it has additional dependencies outside of MATLAB? In my case, I'm compiling pure MATLAB (to mexa64).Syrus Nemat-Nasserhttps://www.blogger.com/profile/13080292789676659593noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-10527801338209411772011-07-19T09:09:33.904-07:002011-07-19T09:09:33.904-07:00it compiled OK for me, but I'm still getting a...it compiled OK for me, but I'm still getting an error with the .mexa64 file: <br />??? Invalid MEX-file '/home/cparmer/VarietyPack/Programming/Lessons/Mex/import_matrix.mexa64':<br />/home/cparmer/MATLAB/R2011a/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by<br />/home/cparmer/VarietyPack/Programming/Lessons/Mex/import_matrix.mexa64)Christopher Parmerhttps://www.blogger.com/profile/17687217557482138269noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-90687163997363648442011-07-08T07:46:21.425-07:002011-07-08T07:46:21.425-07:00thanks, worked a treatthanks, worked a treatTomhttps://www.blogger.com/profile/06397289500969546410noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-51971051637370982962011-06-07T16:03:18.895-07:002011-06-07T16:03:18.895-07:00Worked for me. Thanks a bunch!Worked for me. Thanks a bunch!Scotthttps://www.blogger.com/profile/01056571544030530408noreply@blogger.comtag:blogger.com,1999:blog-5405478043203825474.post-41962286525639308552011-05-19T14:55:22.745-07:002011-05-19T14:55:22.745-07:00Thanks, your post has exactly what i needed.Thanks, your post has exactly what i needed.adjfhttps://www.blogger.com/profile/09975722743742101802noreply@blogger.com