Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » sbml-interoperability » library conflicts under java
Show: Today's Posts  :: Message Navigator
| Subscribe to topic 
Return to the default flat view Create a new topic Submit Reply
AuthorTopic
Lucian Smith


Posts: 183
Registered:
July 2008
library conflicts under java 10 Feb '10 12:14 Go to previous message

So, I'm working on a smallish project to use libsbml under java for use
with a different project, written in java (JSim). However, the libsbml
library and the other project's library seem to be clashing, and I'm not
sure where to look to start debugging the problem.

(I'm using ubuntu and a version of libsbmlj that I compiled myself from
the 4.0.1 source distribution)


Here's a small java class that demonstrates the problem:


import org.sbml.libsbml.*;

public class test {
public static void main(String[] args) {
System.out.println("Hello world.");
System.loadLibrary("odesolver");
System.out.println("Loaded odesolver");
System.loadLibrary("sbmlj");
System.out.println("Loaded sbmlj.");
SBMLReader reader = new SBMLReader();
System.out.println("Ran something using libsbml");
}
}

Compiling this with javac works fine if I set the classpath to point at
the libsbmlj.jar file and the various .jar files that the 'odesolver'
uses.

Then running it under java, I use the same classpath, and point
java.library.path to the directory with libsbml*.so and the directory with
the odesolver's .so files.

I get the following:

Hello world.
Loaded odesolver
Segmentation fault


If I reverse the order in which I load the libraries, suddenly everything
works!

Hello world.
Loaded sbmlj.
Loaded odesolver
Ran something using libsbml

(I did run nm on the various .so files, but didn't find any conflicts in
the text symbols, at least.)

Anyone have some insight as to what's going wrong? Thanks!

-Lucian
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability

For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu

      

SubjectPosterDate
Read Message   library conflicts under java  Lucian Smith10 Feb '10 12:14
Read Message   Re: library conflicts under java ajouraku11 Feb '10 00:13
Read Message   Re: library conflicts under java Lucian Smith11 Feb '10 10:45
Read Message   Re: library conflicts under java ajouraku11 Feb '10 23:48
Read Message   Re: library conflicts under java Lucian Smith12 Feb '10 11:13
Read Message   Re: library conflicts under java ajouraku14 Feb '10 02:14
Read Message   Re: library conflicts under java Lucian Smith16 Feb '10 11:06
Previous Topic:Re: [sbml-discuss] Problem running SBMLEditor on Mac OS X
Next Topic:unsetCharge
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.