Matlab for yarp, can't make libjyarp.so ??

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

Matlab for yarp, can't make libjyarp.so ??

Anthony Morse
Hi,

I'm trying to get yarp working with matlab but I'm a bit stuck.
Following instructions here... http://wiki.icub.org/wiki/Calling_yarp_from_Matlab
swig and default-jdk are now installed
when I try to build YARP_ROOT/bindings/build I get the following error?

tony@gpu-node3:~/yarp/yarp/bindings/build$ make -j
--  +++ bindings Java is enabled
--  +++ bindings Python is not enabled
--  +++ bindings Perl is not enabled
--  +++ bindings Chicken Scheme is not enabled
--  +++ bindings CSharp is not enabled
--  +++ bindings Allegro Common Lisp is not enabled
--  +++ bindings TCL is not enabled
--  +++ bindings Ruby is not enabled
--  +++ bindings Lua is not enabled
--  +++ bindings Octave is not enabled
-- /usr/share/cmake-2.8/Modules/UseSWIG.cmake
-- copied /home/tony/yarp/yarp/bindings/build/generated_src/LoadYarp.java
-- copied /home/tony/yarp/yarp/bindings/build/generated_src/YarpImageHelper.java
-- copied /home/tony/yarp/yarp/bindings/build/generated_src/Example1.java
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tony/yarp/yarp/bindings/build
Linking CXX shared module libjyarp.so
/usr/bin/ld: /usr/local/lib/libYARP_OS.a(HttpCarrier.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libYARP_OS.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
CMakeFiles/jyarp.dir/build.make:104: recipe for target 'libjyarp.so' failed
make[2]: *** [libjyarp.so] Error 1
CMakeFiles/Makefile2:63: recipe for target 'CMakeFiles/jyarp.dir/all' failed
make[1]: *** [CMakeFiles/jyarp.dir/all] Error 2
Makefile:75: recipe for target 'all' failed
make: *** [all] Error 2

It's mentioned later in the instructions that this type of error might be die to CREATE_SHARED_LIBRARIES not being on in the yarp configuration but it is set to ON

Any ideas???
Thanks in advance

Tony

________________________________
[http://www.plymouth.ac.uk/images/email_footer.gif]<http://www.plymouth.ac.uk/worldclass>

This email and any files with it are confidential and intended solely for the use of the recipient to whom it is addressed. If you are not the intended recipient then copying, distribution or other use of the information contained is strictly prohibited and you should not rely on it. If you have received this email in error please let the sender know immediately and delete it from your system(s). Internet emails are not necessarily secure. While we take every care, Plymouth University accepts no responsibility for viruses and it is your responsibility to scan emails and their attachments. Plymouth University does not accept responsibility for any changes made after it was sent. Nothing in this email or its attachments constitutes an order for goods or services unless accompanied by an official order form.

------------------------------------------------------------------------------
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|

Yarp on Matlab, no Jyarp in java.library.path

Anthony Morse
Hi everyone,

I’ve switched to a Mac and got much further with installing yarp for matlab, but now I get this error...

>> LoadYarp;
Java exception occurred:
java.lang.UnsatisfiedLinkError: no jyarp in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1764)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:1044)
        at LoadYarp.<init>(LoadYarp.java:20)

I can’t find jyarp? when I make in the yarp/bindings/build folder it says
[100%] Built target jyarp

so presumably it’s worked and I somehow need to tell java, or matlab where it is???

Thanks for your help in advance
Tony
________________________________
[http://www.plymouth.ac.uk/images/email_footer.gif]<http://www.plymouth.ac.uk/worldclass>

This email and any files with it are confidential and intended solely for the use of the recipient to whom it is addressed. If you are not the intended recipient then copying, distribution or other use of the information contained is strictly prohibited and you should not rely on it. If you have received this email in error please let the sender know immediately and delete it from your system(s). Internet emails are not necessarily secure. While we take every care, Plymouth University accepts no responsibility for viruses and it is your responsibility to scan emails and their attachments. Plymouth University does not accept responsibility for any changes made after it was sent. Nothing in this email or its attachments constitutes an order for goods or services unless accompanied by an official order form.
------------------------------------------------------------------------------
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Yarp on Matlab, no Jyarp in java.library.path

Lars Schillingmann
Hi Tony,

did you use java -Djava.library.path=/path/where/libjyarp.so/is/installed/ ? (Or configure matlab in a way that is uses the right java.library.path setting?

Best
Lars

Am 12.06.2015 um 20:23 schrieb Anthony Morse:

> Hi everyone,
>
> I’ve switched to a Mac and got much further with installing yarp for matlab, but now I get this error...
>
>>> LoadYarp;
> Java exception occurred:
> java.lang.UnsatisfiedLinkError: no jyarp in java.library.path
>         at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1764)
>         at java.lang.Runtime.loadLibrary0(Runtime.java:823)
>         at java.lang.System.loadLibrary(System.java:1044)
>         at LoadYarp.<init>(LoadYarp.java:20)
>
> I can’t find jyarp? when I make in the yarp/bindings/build folder it says
> [100%] Built target jyarp
>
> so presumably it’s worked and I somehow need to tell java, or matlab where it is???
>
> Thanks for your help in advance
> Tony
> ________________________________
> [http://www.plymouth.ac.uk/images/email_footer.gif]<http://www.plymouth.ac.uk/worldclass>
>
> This email and any files with it are confidential and intended solely for the use of the recipient to whom it is addressed. If you are not the intended recipient then copying, distribution or other use of the information contained is strictly prohibited and you should not rely on it. If you have received this email in error please let the sender know immediately and delete it from your system(s). Internet emails are not necessarily secure. While we take every care, Plymouth University accepts no responsibility for viruses and it is your responsibility to scan emails and their attachments. Plymouth University does not accept responsibility for any changes made after it was sent. Nothing in this email or its attachments constitutes an order for goods or services unless accompanied by an official order form.
> ------------------------------------------------------------------------------
> _______________________________________________
> Robotcub-hackers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
>

------------------------------------------------------------------------------
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Yarp on Matlab, no Jyarp in java.library.path

pattacini
Hi hackers,

If you're a swig/java hater like me and by any chance you've got the Instrument Control Toolbox available, there's an easy way to interface yarp with matlab that resorts directly to the use of sockets and administrative messages over yarp ports.

An example is this one: https://github.com/pattacini/yarp2IC.

Cheers,
Ugo


> -----Original Message-----
> From: Lars Schillingmann [mailto:[hidden email]]
> Sent: 12 June 2015 13:34
> To: [hidden email]
> Subject: Re: [rc-hackers] Yarp on Matlab, no Jyarp in java.library.path
>
> Hi Tony,
>
> did you use java -Djava.library.path=/path/where/libjyarp.so/is/installed/ ?
> (Or configure matlab in a way that is uses the right java.library.path
> setting?
>
> Best
> Lars
>
> Am 12.06.2015 um 20:23 schrieb Anthony Morse:
> > Hi everyone,
> >
> > I’ve switched to a Mac and got much further with installing yarp for
> matlab, but now I get this error...
> >
> >>> LoadYarp;
> > Java exception occurred:
> > java.lang.UnsatisfiedLinkError: no jyarp in java.library.path
> >         at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1764)
> >         at java.lang.Runtime.loadLibrary0(Runtime.java:823)
> >         at java.lang.System.loadLibrary(System.java:1044)
> >         at LoadYarp.<init>(LoadYarp.java:20)
> >
> > I can’t find jyarp? when I make in the yarp/bindings/build folder it says
> > [100%] Built target jyarp
> >
> > so presumably it’s worked and I somehow need to tell java, or matlab where
> it is???
> >
> > Thanks for your help in advance
> > Tony
> > ________________________________
> >
> [http://www.plymouth.ac.uk/images/email_footer.gif]<http://www.plymouth.ac.uk
> /worldclass>
> >
> > This email and any files with it are confidential and intended solely for
> the use of the recipient to whom it is addressed. If you are not the intended
> recipient then copying, distribution or other use of the information
> contained is strictly prohibited and you should not rely on it. If you have
> received this email in error please let the sender know immediately and
> delete it from your system(s). Internet emails are not necessarily secure.
> While we take every care, Plymouth University accepts no responsibility for
> viruses and it is your responsibility to scan emails and their attachments.
> Plymouth University does not accept responsibility for any changes made after
> it was sent. Nothing in this email or its attachments constitutes an order
> for goods or services unless accompanied by an official order form.
> > ---------------------------------------------------------------------------
> ---
> > _______________________________________________
> > Robotcub-hackers mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
> >
>
> -----------------------------------------------------------------------------
> -
> _______________________________________________
> Robotcub-hackers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
------------------------------------------------------------------------------
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Matlab for yarp, can't make libjyarp.so ??

Daniele E. Domenichelli
In reply to this post by Anthony Morse
Hello Anthony

If I understand correctly, you are building the bindings separate from YARP.
The recommended way to do it is to enable them when building YARP, by enabling
the "CREATE_BINDINGS" option.


On Thursday 11 Jun 2015 13:17:07 Anthony Morse wrote:
> Linking CXX shared module libjyarp.so
> /usr/bin/ld: /usr/local/lib/libYARP_OS.a(HttpCarrier.cpp.o): relocation
> R_X86_64_32 against `.rodata' can not be used when making a shared object;
> recompile with -fPIC /usr/local/lib/libYARP_OS.a: error adding symbols: Bad
> value


"/usr/local/lib/libYARP_OS.a" means that like you are linking to a STATIC
version of YARP. The "CREATE_SHARED_LIBRARIES" option must be ON when building
YARP, not the bindings. If this is what you are doing, you probably have some
old version of YARP installed on your system, please get rid of them and try
again.
Also if I remember correctly, newer version of YARP are built with -fPIC,
therefore you should not have this issue unless you are trying to link to a
very old version.


Cheers,
 Daniele

------------------------------------------------------------------------------
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers