| Author | Topic |
Posts: 183
Registered: July 2008
|
|
library conflicts under java
|
10 Feb '10 12:14
|
 |
|
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
|
|
|