Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!z24g2000prf.googlegroups.com!not-for-mail
From: spasmous <spasmous@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Conflict with mcc... libstdc++.so.6
Date: Mon, 2 Jun 2008 11:59:02 -0700 (PDT)
Organization: http://groups.google.com
Lines: 59
Message-ID: <9f4032f6-4871-4bae-b649-e78b2b4fa1bc@z24g2000prf.googlegroups.com>
References: <431d112e-2cfc-4e5e-8b68-e2dcac8b7008@w5g2000prd.googlegroups.com> 
NNTP-Posting-Host: 132.239.142.130
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1212433143 24785 127.0.0.1 (2 Jun 2008 18:59:03 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 2 Jun 2008 18:59:03 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: z24g2000prf.googlegroups.com; posting-host=132.239.142.130; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) 
Xref: news.mathworks.com comp.soft-sys.matlab:471837



On Jun 2, 11:16=A0am, "Sebastiaan "
<s.breedv...@erasmusmc.REMOVE.BOO.BOO.nl> wrote:
> > Sebastian - by responding you are saving my life :) Thank you!
> > The result of ldd hello is:
>
> > =A0 =A0 =A0 =A0 linux-gate.so.1 =3D3D> =A0(0xffffe000)
> > =A0 =A0 =A0 =A0 libmwmclmcrrt.so =3D3D> /usr/local/matlab/bin/glnx86/
> > libmwmclmcrrt.so (0x40001000)
> > =A0 =A0 =A0 =A0 libm.so.6 =3D3D> /lib/tls/libm.so.6 (0x42e08000)
> > =A0 =A0 =A0 =A0 libstdc++.so.5 =3D3D> /usr/lib/libstdc++.so.5
> (0x439b9000)
> > =A0 =A0 =A0 =A0 libpthread.so.0 =3D3D> /lib/tls/libpthread.so.0
> (0x42f20000)
> > =A0 =A0 =A0 =A0 libc.so.6 =3D3D> /lib/tls/libc.so.6 (0x42cea000)
> > =A0 =A0 =A0 =A0 libdl.so.2 =3D3D> /lib/libdl.so.2 (0x42e2d000)
> > =A0 =A0 =A0 =A0 libstdc++.so.6 =3D3D>
>
> /usr/local/matlab/bin/glnx86/../../sys/os/> glnx86/libstdc++.so.6 (0x40069=
000)
> > =A0 =A0 =A0 =A0 libgcc_s.so.1 =3D3D>
>
> /usr/local/matlab/bin/glnx86/../../sys/os/
>
> > glnx86/libgcc_s.so.1 (0x40146000)
> > =A0 =A0 =A0 =A0 /lib/ld-linux.so.2 =3D3D> /lib/ld-linux.so.2
> (0x42cd1000)
>
> > So it looks like my platform uses libstdc++.so.5. Is there any
> > solution where I can tell MATLAB to use .so.6?
>
> > I'm not sure I understand what you meant by compiling with
> -L/opt/
> > matlab/2007b/sys/os/glnxa64/-lstdc++. There is not -L flag
> with mcc
> > that I can see.
>
> Funny, it is actually linked to .so.5 and .so.6. Seems
> strange, but I am not an expert on this.
>
> I also have no experience with mcc, only with mex files.
>
> Fromhttp://www.gravity.psu.edu/~s4/software/MATLAB-R2006a/Compiling_MATLA.=
..
> it seems that you have to edit bin/mbuildopts.sh (or better:
> ~/.matlab/R2007b/mbuildopts.sh which is the one you can and
> should edit) and change:
> CLIBS=3D"$RPATH $MLIBS -lm $TMW_ROOT/sys/os/$Arch/libstdc++.so.6""
>
> in the section belonging to your architecture (seems glnx86).
>
> Does it work?


Interesting. I changed my mbuildopts.sh file as you suggested and it
does work. But only calling from the MATLAB prompt via system('./
hello'). Calling from the bash shell gives the error

=2E/hello: error while loading shared libraries: libmwmclmcrrt.so:
cannot open shared object file: No such file or directory