Bugs item #2911463, was opened at 2009-12-09 11:20
Message generated for change (Comment added) made by klausraizer
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=500492&aid=2911463&group_id=62418
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: kaouete (kakaouete)
Assigned to: Nobody/Anonymous (nobody)
Summary: java swig: liblibjyarp.so?
Initial Comment:
Hello,
If I compile the java swig library with the following command:
cmake . -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCREATE_PYTHON=TRUE -DCREATE_JAVA=TRUE
make
I get a file named liblibjyarp.so instead of libjyarp.so!
Also there is no way to install it and to have a jar file with the generated java file.
It would be cool to have the .so file in the jar also, I think this can be done…
----------------------------------------------------------------------
Comment By: Klaus (klausraizer)
Date: 2010-08-13 17:46
Message:
By the way, is there a combination of versions for swig, cmake. yarp, etc
that should surely work? A combination that has worked before for instance?
tnx :D
----------------------------------------------------------------------
Comment By: kaouete (kakaouete)
Date: 2009-12-09 13:16
Message:
I think there is no version between 2.6.4 and 2.8, so for this it is
easy :)
I tried with swig 1.3.39 and the problem was also present, so I guess we
only need to check for the cmake version!
----------------------------------------------------------------------
Comment By: Paul Fitzpatrick (eshuy)
Date: 2009-12-09 12:57
Message:
For the .so naming issue (liblibjyarp.so), as of cmake 2.6-4 and swig
1.3.39, the code as is generates libjyarp.so. I would guess that the SWIG
helper methods in cmake 2.8, which you are using, have been improved to
insert a lib on UNIX style systems. If that is the case, we need to put in
a conditional (we need to support cmake back to at least 2.4). It will
take a little work to figure out the right conditional.
Thanks for your suggestions for better Java packaging, and offer of
testing. I'll advertise the suggestions on our mailing list and see if any
of the Java users has time for it.
----------------------------------------------------------------------
Comment By: kaouete (kakaouete)
Date: 2009-12-09 12:45
Message:
So here is a proposition for installing jyarp:
1) Choose better package names for the generated files AND the examples
(for example it.liralab.eris.yarp or maybe with robotcub somewhere in the
name) to avoid conflicts.
2) package everything in a jar file without a main class (or you can make
one jar only with the yarp common classes, and one per examples. To run
them one will need to add the yarp one to the classpath).
3) for the library thing, take a look at this
http://nizzoli.net/2007/06/06/jar-jni-dll/ that explains how to exploit it,
to me it looks like a not too bad solution…
For the point 3, it is not really your problem, maybe you can just provide
the jar without the library since it will be complex to make it work for
every platform, it is more the problem of the user of yarp…
I hope it helps, I don't have a the time to do it myself but I can do
tests if you need me to :)
Anyway, thanks for your help on this!
----------------------------------------------------------------------
Comment By: kaouete (kakaouete)
Date: 2009-12-09 12:30
Message:
Hello,
I am using 2.8.0, Swig 1.3.40 on Archlinux.
At least for the version I have, I noticed that:
In the source of the cmake swig module, there is this comment:
# In java you want:
# System.loadLibrary("LIBRARY");
# then JNI will look for a library whose name is platform
dependent, namely
# MacOS : libLIBRARY.jnilib
# Windows: LIBRARY.dll
# Linux : libLIBRARY.so
It looks like to me that swig handles the naming, so maybe you should let
it do it and just use jyarp as module name.
(and anyway, cmake does add .jnilib at the end of the module name when
necessary).
----------------------------------------------------------------------
Comment By: Paul Fitzpatrick (eshuy)
Date: 2009-12-09 11:45
Message:
Hi Kaouete, thanks for reporting this. What OS, CMake, and Swig versions
are you using? If you look in example/swig/CMakeLists.txt, in the area
within IF(CREATE_JAVA)... ENDIF(CREATE_JAVA) you'll see there is a little
bit of logic that tries to pick a target name with or without the "lib"
prefix depending on the platform. This logic will need to be extended, I
guess, for your situation.
Noone has added an install target for the java wrappers yet. You can see
examples of INSTALL lines in the CMakeLists.txt for other languages, in
case it inspires you to figure out a patch :-).
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=500492&aid=2911463&group_id=62418
|