Yarp & Matlab

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Yarp & Matlab

Matilde Marsano
Hi Robotcub Hackers,

I'm Matilde, an Italian student from Genoa, I apologize for my bad English.
I'm using Yarp (new user!) for a project and I'm trying to interface it with Matlab on UNIX (Kubuntu 12.04 64bit).

I'm dealing with an error which seems to be common, from what I've understood it's a problem of gcc compiler versions (Matlab uses its own?).
My error is the same as the following:
http://sourceforge.net/mailarchive/message.php?msg_id=26002007

In the Wiki advises have been added at the end of the page so I inferred that the problem has been solved:
http://eris.liralab.it/wiki/Calling_yarp_from_Matlab

The error I get in Matlab after having typing LoadYarp; is:
>> LoadYarp;
Java exception occurred:
java.lang.UnsatisfiedLinkError: /home/mafalda/YARP/yarp-2.3.15/java/libjyarp.so:
/home/mafalda/MATLAB/bin/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by
/usr/lib/libACE-6.0.1.so)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at LoadYarp.<init>(LoadYarp.java:20)
 
I've already tried the following things:

1) Replaced the two files with symbolic links inside the matlab path matlab/sys/os/glnx64/ as root:
rm libgcc_s.so.1 libstdc++.so.6
 ln -s /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so.1
 ln -s /usr/lib/i386-linux-gnu/libstdc++.so.6.0.9 libstdc++.so.6
2) Modified matlab/bin/.matlab7rc.sh so that "LDPATH_PREFIX" contains the path to the version of GLIB installed with my compiler.

But the error is still the same. Can someone help me solving it? It is very important...!

Thank you!!

Matilde

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Yarp & Matlab

paulfitz
Administrator
Hi Matilde,

Maybe try LD_PRELOAD when starting matlab?  Try putting:
  LD_PRELOAD=/lib/i386-linux-gnu/libgcc_s.so.1:/usr/lib/i386-linux-gnu/libstdc++.so.6.0.9
before your call to matlab (or set it as an environment variable).

That seems to be what works in the end for most people in this thread:
   http://www.mathworks.de/matlabcentral/newsreader/view_thread/162466

I don't have matlab myself so I can't test.  Another solution would be
to install a sufficiently old version of gcc/g++ and recompile YARP/ACE.

Good luck!  If you crack it, please update the wiki with what works for
you :-)
Paul

On 06/04/2012 03:12 PM, Matilde Marsano wrote:

> Hi Robotcub Hackers,
>
> I'm Matilde, an Italian student from Genoa, I apologize for my bad
> English.
> I'm using Yarp (new user!) for a project and I'm trying to interface
> it with Matlab on UNIX (Kubuntu 12.04 64bit).
>
> I'm dealing with an error which seems to be common, from what I've
> understood it's a problem of gcc compiler versions (Matlab uses its own?).
> My error is the same as the following:
> http://sourceforge.net/mailarchive/message.php?msg_id=26002007
>
> In the Wiki advises have been added at the end of the page so I
> inferred that the problem has been solved:
> http://eris.liralab.it/wiki/Calling_yarp_from_Matlab
>
> The error I get in Matlab after having typing /LoadYarp/; is:
>
>     >> LoadYarp;
>     Java exception occurred:
>     java.lang.UnsatisfiedLinkError:
>     /home/mafalda/YARP/yarp-2.3.15/java/libjyarp.so:
>     /home/mafalda/MATLAB/bin/glnxa64/libstdc++.so.6: version
>     `GLIBCXX_3.4.15' not found (required by
>     /usr/lib/libACE-6.0.1.so <http://libACE-6.0.1.so>)
>         at java.lang.ClassLoader$NativeLibrary.load(Native Method)
>         at java.lang.ClassLoader.loadLibrary0(Unknown Source)
>         at java.lang.ClassLoader.loadLibrary(Unknown Source)
>         at java.lang.Runtime.loadLibrary0(Unknown Source)
>         at java.lang.System.loadLibrary(Unknown Source)
>         at LoadYarp.<init>(LoadYarp.java:20)
>
>
> I've already tried the following things:
>
> 1) Replaced the two files with symbolic links inside the matlab path
> matlab/sys/os/glnx64/ as root:
>
>     rm libgcc_s.so.1 libstdc++.so.6
>       ln -s /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so.1
>       ln -s /usr/lib/i386-linux-gnu/libstdc++.so.6.0.9 libstdc++.so.6
>
> 2) Modified matlab/bin/.matlab7rc.sh so that "LDPATH_PREFIX" contains
> the path to the version of GLIB installed with my compiler.
>
> But the error is still the same. Can someone help me solving it? It is
> very important...!
>
> Thank you!!
>
> Matilde


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Yarp & Matlab

Matilde Marsano
Thank you very much Paul!!

If I launch Matlab from command line:

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 MATLABDIR/bin/matlab

LoadYarp is now able to load and initialize the library.

The problem now is that, if I define a bottle object immediately after:

LoadYarp;
b=Bottle;

Matlab returns me:
Undefined function or variable 'Bottle'.

Someone knows what I'm missing?

Matilde


2012/6/6 Paul Fitzpatrick <[hidden email]>
Hi Matilde,

Maybe try LD_PRELOAD when starting matlab?  Try putting:
 LD_PRELOAD=/lib/i386-linux-gnu/libgcc_s.so.1:/usr/lib/i386-linux-gnu/libstdc++.so.6.0.9
before your call to matlab (or set it as an environment variable).

That seems to be what works in the end for most people in this thread:
  http://www.mathworks.de/matlabcentral/newsreader/view_thread/162466

I don't have matlab myself so I can't test.  Another solution would be
to install a sufficiently old version of gcc/g++ and recompile YARP/ACE.

Good luck!  If you crack it, please update the wiki with what works for
you :-)
Paul

On 06/04/2012 03:12 PM, Matilde Marsano wrote:
> Hi Robotcub Hackers,
>
> I'm Matilde, an Italian student from Genoa, I apologize for my bad
> English.
> I'm using Yarp (new user!) for a project and I'm trying to interface
> it with Matlab on UNIX (Kubuntu 12.04 64bit).
>
> I'm dealing with an error which seems to be common, from what I've
> understood it's a problem of gcc compiler versions (Matlab uses its own?).
> My error is the same as the following:
> http://sourceforge.net/mailarchive/message.php?msg_id=26002007
>
> In the Wiki advises have been added at the end of the page so I
> inferred that the problem has been solved:
> http://eris.liralab.it/wiki/Calling_yarp_from_Matlab
>
> The error I get in Matlab after having typing /LoadYarp/; is:
>
>     >> LoadYarp;
>     Java exception occurred:
>     java.lang.UnsatisfiedLinkError:
>     /home/mafalda/YARP/yarp-2.3.15/java/libjyarp.so:
>     /home/mafalda/MATLAB/bin/glnxa64/libstdc++.so.6: version
>     `GLIBCXX_3.4.15' not found (required by
>     /usr/lib/libACE-6.0.1.so <http://libACE-6.0.1.so>)
>         at java.lang.ClassLoader$NativeLibrary.load(Native Method)
>         at java.lang.ClassLoader.loadLibrary0(Unknown Source)
>         at java.lang.ClassLoader.loadLibrary(Unknown Source)
>         at java.lang.Runtime.loadLibrary0(Unknown Source)
>         at java.lang.System.loadLibrary(Unknown Source)
>         at LoadYarp.<init>(LoadYarp.java:20)
>
>
> I've already tried the following things:
>
> 1) Replaced the two files with symbolic links inside the matlab path
> matlab/sys/os/glnx64/ as root:
>
>     rm libgcc_s.so.1 libstdc++.so.6
>       ln -s /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so.1
>       ln -s /usr/lib/i386-linux-gnu/libstdc++.so.6.0.9 libstdc++.so.6
>
> 2) Modified matlab/bin/.matlab7rc.sh so that "LDPATH_PREFIX" contains
> the path to the version of GLIB installed with my compiler.
>
> But the error is still the same. Can someone help me solving it? It is
> very important...!
>
> Thank you!!
>
> Matilde


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Yarp & Matlab

Matilde Marsano
Solved!

I just change the definition into:

b=yarp.Bottle;

Thanks again Paul!

2012/6/9 Matilde Marsano <[hidden email]>
Thank you very much Paul!!

If I launch Matlab from command line:

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 MATLABDIR/bin/matlab

LoadYarp is now able to load and initialize the library.

The problem now is that, if I define a bottle object immediately after:

LoadYarp;
b=Bottle;

Matlab returns me:
Undefined function or variable 'Bottle'.

Someone knows what I'm missing?

Matilde



2012/6/6 Paul Fitzpatrick <[hidden email]>
Hi Matilde,

Maybe try LD_PRELOAD when starting matlab?  Try putting:
 LD_PRELOAD=/lib/i386-linux-gnu/libgcc_s.so.1:/usr/lib/i386-linux-gnu/libstdc++.so.6.0.9
before your call to matlab (or set it as an environment variable).

That seems to be what works in the end for most people in this thread:
  http://www.mathworks.de/matlabcentral/newsreader/view_thread/162466

I don't have matlab myself so I can't test.  Another solution would be
to install a sufficiently old version of gcc/g++ and recompile YARP/ACE.

Good luck!  If you crack it, please update the wiki with what works for
you :-)
Paul

On 06/04/2012 03:12 PM, Matilde Marsano wrote:
> Hi Robotcub Hackers,
>
> I'm Matilde, an Italian student from Genoa, I apologize for my bad
> English.
> I'm using Yarp (new user!) for a project and I'm trying to interface
> it with Matlab on UNIX (Kubuntu 12.04 64bit).
>
> I'm dealing with an error which seems to be common, from what I've
> understood it's a problem of gcc compiler versions (Matlab uses its own?).
> My error is the same as the following:
> http://sourceforge.net/mailarchive/message.php?msg_id=26002007
>
> In the Wiki advises have been added at the end of the page so I
> inferred that the problem has been solved:
> http://eris.liralab.it/wiki/Calling_yarp_from_Matlab
>
> The error I get in Matlab after having typing /LoadYarp/; is:
>
>     >> LoadYarp;
>     Java exception occurred:
>     java.lang.UnsatisfiedLinkError:
>     /home/mafalda/YARP/yarp-2.3.15/java/libjyarp.so:
>     /home/mafalda/MATLAB/bin/glnxa64/libstdc++.so.6: version
>     `GLIBCXX_3.4.15' not found (required by
>     /usr/lib/libACE-6.0.1.so <http://libACE-6.0.1.so>)
>         at java.lang.ClassLoader$NativeLibrary.load(Native Method)
>         at java.lang.ClassLoader.loadLibrary0(Unknown Source)
>         at java.lang.ClassLoader.loadLibrary(Unknown Source)
>         at java.lang.Runtime.loadLibrary0(Unknown Source)
>         at java.lang.System.loadLibrary(Unknown Source)
>         at LoadYarp.<init>(LoadYarp.java:20)
>
>
> I've already tried the following things:
>
> 1) Replaced the two files with symbolic links inside the matlab path
> matlab/sys/os/glnx64/ as root:
>
>     rm libgcc_s.so.1 libstdc++.so.6
>       ln -s /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so.1
>       ln -s /usr/lib/i386-linux-gnu/libstdc++.so.6.0.9 libstdc++.so.6
>
> 2) Modified matlab/bin/.matlab7rc.sh so that "LDPATH_PREFIX" contains
> the path to the version of GLIB installed with my compiler.
>
> But the error is still the same. Can someone help me solving it? It is
> very important...!
>
> Thank you!!
>
> Matilde


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers