| Forum: sbml-interoperability |
|---|
| Topic: LibSBML installation went alright, but problems with executing test program |
|---|
Posts: 9
Registered: February 2006
|
|
Re: LibSBML installation went alright, but problems with executing test program
|
22 Feb '06 12:00
|
 |
|
This problem I have solved myself. Seemed that I needed to reboot or something. I cannot really remember what I did that solved it.
|
|
|
Posts: 9
Registered: February 2006
|
|
Re: LibSBML installation went alright, but problems with executing test program
|
22 Feb '06 12:18
|
 |
|
This problem I have solved myself. Seemed that I needed to reboot or something. I cannot really remember what I did that solved it.
|
|
|
Posts: 287
Registered: September 2003
|
|
Re: [libsbml-discuss] LibSBML installation went alright, but problems with executing test program
|
22 Feb '06 12:20
|
 |
|
Hi Willem,
This sounds like libsbmlj.so is not in your LD_LIBRARY_PATH. Can you
double-check that? Also, why does your output include 'No such file
or directory'?
Thanks.
Ben
On Feb 22, 2006, at 10:35 AM, WLigtenberg wrote:
> I havbe installed LibSBML on my linux box and it seemed to go ok.
> I also added the directories to the classpath etc.
> This is the output for $CLASSPATH
> .:/home/willem/afstudeer/libsbml-2.3.4/src/bindings/java/
> libsbmlj.jar: No such file or directory
>
> And LD_LIBRARY_PATH
> bash: /home/willem/afstudeer/libsbml-2.3.4/src/bindings/java:/usr/
> local/lib/: No such file or directory
>
> Compiling and running a test file went fine.
>
> But with another file I get the following error:
> java.lang.UnsatisfiedLinkError: new_SBMLReader__SWIG_1
|
|
|
| Topic: Re: [libsbml-discuss] LibSBML installation went alright, but problems with executing test program |
|---|
Posts: 287
Registered: September 2003
|
|
Re: [libsbml-discuss] LibSBML installation went alright, but problems with executing test program
|
22 Feb '06 12:20
|
 |
|
Hi Willem,
This sounds like libsbmlj.so is not in your LD_LIBRARY_PATH. Can you
double-check that? Also, why does your output include 'No such file
or directory'?
Thanks.
Ben
On Feb 22, 2006, at 10:35 AM, WLigtenberg wrote:
> I havbe installed LibSBML on my linux box and it seemed to go ok.
> I also added the directories to the classpath etc.
> This is the output for $CLASSPATH
> .:/home/willem/afstudeer/libsbml-2.3.4/src/bindings/java/
> libsbmlj.jar: No such file or directory
>
> And LD_LIBRARY_PATH
> bash: /home/willem/afstudeer/libsbml-2.3.4/src/bindings/java:/usr/
> local/lib/: No such file or directory
>
> Compiling and running a test file went fine.
>
> But with another file I get the following error:
> java.lang.UnsatisfiedLinkError: new_SBMLReader__SWIG_1
|
|
|
| Topic: Libsbml VC project files out of date |
|---|
Posts: 14
Location: KGI
Registered: May 2005
|
|
Libsbml VC project files out of date
|
01 Mar '06 17:54
|
 |
|
Hi,
I just tried compiled libSBML after a fresh checkout from CVS. It seems the
project files are out of date:
- include directories are not set up
- files:
Utils_UnitDefinition.cpp
Utils_Unit.cpp
UnitKindList.cpp
UnitFormulaFormatter.cpp
Constraint.cpp
Are missing from the project - resulting in link errors ...
- Just a thought ... there is no need to maintain MSVC6 and MSVC7 project
files
... MSVC6 is sufficient, as VC7 / VC 7.1 and VC 8 all can reliably create
project files from VC 6 ... this could lighten your workload.
Cheers
Frank
|
|
|
Posts: 413
Registered: May 2004
|
|
Re: Libsbml VC project files out of date
|
03 Mar '06 01:18
|
 |
|
Sorry Frank - its been on my list of to dos and is now on my list of I've
done it :-)
Sarah
----- Original Message -----
From: "Frank Bergmann" <fbergman@kgi.edu>
To: "'LibSBML Discussion List'" <libsbml-discuss@caltech.edu>
Sent: Thursday, March 02, 2006 1:54 AM
Subject: [libsbml-discuss] Libsbml VC project files out of date
>
> Hi,
>
> I just tried compiled libSBML after a fresh checkout from CVS. It seems
> the
> project files are out of date:
>
> - include directories are not set up
> - files:
>
> Utils_UnitDefinition.cpp
> Utils_Unit.cpp
> UnitKindList.cpp
> UnitFormulaFormatter.cpp
> Constraint.cpp
>
> Are missing from the project - resulting in link errors ...
>
> - Just a thought ... there is no need to maintain MSVC6 and MSVC7 project
> files
> ... MSVC6 is sufficient, as VC7 / VC 7.1 and VC 8 all can reliably create
> project files from VC 6 ... this could lighten your workload.
>
>
> Cheers
> Frank
>
>
>
|
|
|
Posts: 413
Registered: May 2004
|
|
Re: Libsbml VC project files out of date
|
03 Mar '06 01:18
|
 |
|
Sorry Frank - its been on my list of to dos and is now on my list of I've
done it :-)
Sarah
----- Original Message -----
From: "Frank Bergmann" <fbergman@kgi.edu>
To: "'LibSBML Discussion List'" <libsbml-discuss@caltech.edu>
Sent: Thursday, March 02, 2006 1:54 AM
Subject: [libsbml-discuss] Libsbml VC project files out of date
>
> Hi,
>
> I just tried compiled libSBML after a fresh checkout from CVS. It seems
> the
> project files are out of date:
>
> - include directories are not set up
> - files:
>
> Utils_UnitDefinition.cpp
> Utils_Unit.cpp
> UnitKindList.cpp
> UnitFormulaFormatter.cpp
> Constraint.cpp
>
> Are missing from the project - resulting in link errors ...
>
> - Just a thought ... there is no need to maintain MSVC6 and MSVC7 project
> files
> ... MSVC6 is sufficient, as VC7 / VC 7.1 and VC 8 all can reliably create
> project files from VC 6 ... this could lighten your workload.
>
>
> Cheers
> Frank
>
>
>
|
|
|
| Topic: lisSBML causes a crash |
|---|
Posts: 9
Registered: February 2006
|
|
lisSBML causes a crash
|
22 Feb '06 01:32
|
 |
|
I get the following error when trying to run a java program.
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0xafdf7e4d, pid=11313, tid=2964482992
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_04-b05 mixed mode, sharing)
# Problematic frame:
# C [libsbmlj.so+0x1fe4d] Java_org_sbml_libsbml_libsbmlJNI_SimpleSpeciesReference_1getSpecies+0x2d
The classes where compiled without error.
As it seems this crash is caused by libSBML.
It is caused by the following line:
System.out.println(species.getSpecies());
in:
ListOf products = reaction.getListOfProducts();
for(int n = 0; n < products.getNumItems(); ++n) {
SpeciesReference species = (SpeciesReference)products.get(n);
System.out.println(species.getSpecies());
}
Anyone know what is wrong? I have version 2.3.4 of libSBML.
|
|
|
Posts: 287
Registered: September 2003
|
|
Re: lisSBML causes a crash
|
22 Feb '06 12:04
|
 |
|
Hi,
I received the message below last week. Could it be the problem? To
test, can you add -O to your CFLAGS environment variable and then
rerun ./configure, etc. i.e.:
export CFLAGS=-O # for sh, or
setenv CFLAGS -O # for csh
./configure --with-java
make
Thanks.
Ben
> From: Michael Hucka <mhucka@caltech.edu>
> Date: February 15, 2006 1:27:37 PM PST
> To: Benjamin J Bornstein <ben.bornstein@jpl.nasa.gov>
> Subject: Report from Akira about libsbml on Fedora Core 4
>
> Ben,
>
> I spoke with Akira last week and one thing he mentioned is
> that he had trouble with compiling the Java bindings on
> Fedora Core 4. Apparently the default optimization of -O2
> causes some part of the Java wrapping not to build
> correctly. However, -O works.
|
|
|
Posts: 287
Registered: September 2003
|
|
Re: lisSBML causes a crash
|
22 Feb '06 12:04
|
 |
|
Hi,
I received the message below last week. Could it be the problem? To
test, can you add -O to your CFLAGS environment variable and then
rerun ./configure, etc. i.e.:
export CFLAGS=-O # for sh, or
setenv CFLAGS -O # for csh
./configure --with-java
make
Thanks.
Ben
> From: Michael Hucka <mhucka@caltech.edu>
> Date: February 15, 2006 1:27:37 PM PST
> To: Benjamin J Bornstein <ben.bornstein@jpl.nasa.gov>
> Subject: Report from Akira about libsbml on Fedora Core 4
>
> Ben,
>
> I spoke with Akira last week and one thing he mentioned is
> that he had trouble with compiling the Java bindings on
> Fedora Core 4. Apparently the default optimization of -O2
> causes some part of the Java wrapping not to build
> correctly. However, -O works.
|
|
|
Posts: 9
Registered: February 2006
|
|
Re: lisSBML causes a crash
|
22 Feb '06 12:05
|
 |
|
I have here a simple class that will generate the error. (At least on my machine)
import org.sbml.libsbml.*;
public class Demo1
{
public static void main(String args[])
{
System.loadLibrary("sbmlj");
SBMLReader reader = new SBMLReader();
SBMLDocument document = reader.readSBML("network.xml");
Model model = document.getModel();
ListOf listOf_reactions = model.getListOfReactions();
for(int j = 0; j < model.getNumReactions(); j++) {
Reaction reaction = (Reaction)listOf_reactions.get(j);
ListOf products = reaction.getListOfProducts();
System.out.println(products.getNumItems());
for(int n = 0; n < products.getNumItems(); ++n) {
System.out.println(products.get(n).getClass().getName());
SpeciesReference species = SpeciesReference)products.get(n);
System.out.println(species.getSpecies());
}
}
}
}
network.xml is an SBML file.
Help is greatly appreciated. I am working on an SBML importer for Cytoscape.
|
|
|
Posts: 9
Registered: February 2006
|
|
Re: lisSBML causes a crash
|
22 Feb '06 12:17
|
 |
|
I have here a simple class that will generate the error. (At least on my machine)
import org.sbml.libsbml.*;
public class Demo1
{
public static void main(String args[])
{
System.loadLibrary("sbmlj");
SBMLReader reader = new SBMLReader();
SBMLDocument document = reader.readSBML("network.xml");
Model model = document.getModel();
ListOf listOf_reactions = model.getListOfReactions();
for(int j = 0; j < model.getNumReactions(); j++) {
Reaction reaction = (Reaction)listOf_reactions.get(j);
ListOf products = reaction.getListOfProducts();
System.out.println(products.getNumItems());
for(int n = 0; n < products.getNumItems(); ++n) {
System.out.println(products.get(n).getClass().getName());
SpeciesReference species = SpeciesReference)products.get(n);
System.out.println(species.getSpecies());
}
}
}
}
network.xml is an SBML file.
Help is greatly appreciated. I am working on an SBML importer for Cytoscape.
|
|
|
Posts: 92
Registered: May 2004
|
|
Re: Re: lisSBML causes a crash
|
22 Mar '06 02:09
|
 |
|
Hi Ben,
I am experiencing similar crashes on the Mac and under Windows. I just
tried to get the java bindings with layout to run under windows, but
whenever I try to run the example1.java, the JVM crashes. It crashes
when I call setLevel on an SBMLDocument that I have create right before.
This was under windows.
I can reproduce this under Mac OS with the example1.cpp it also crashes
with the following backtrace:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x000001d8
0x00016880 in SBMLDocument::setLevel (this=0xb002b0, level=2) at
SBMLDocument.cpp:347
347 model->mLevel = this->level;
(gdb) bt
#0 0x00016880 in SBMLDocument::setLevel (this=0xb002b0, level=2) at
SBMLDocument.cpp:347
#1 0x00003184 in main ()
This is with the current CVS sources compiled with "-g -O0", expat and
the layout enabled.
I will see if I have the time to go into this.
Ralph
WLigtenberg wrote:
> I have here a simple class that will generate the error. (At least on my machine)
>
>
> import org.sbml.libsbml.*;
>
> public class Demo1
> {
> public static void main(String args[])
> {
> System.loadLibrary("sbmlj");
> SBMLReader reader = new SBMLReader();
> SBMLDocument document = reader.readSBML("network.xml");
> Model model = document.getModel();
>
> ListOf listOf_reactions = model.getListOfReactions();
>
> for(int j = 0; j < model.getNumReactions(); j++) {
> Reaction reaction = (Reaction)listOf_reactions.get(j);
>
> ListOf products = reaction.getListOfProducts();
> System.out.println(products.getNumItems());
> for(int n = 0; n < products.getNumItems(); ++n) {
> System.out.println(products.get(n).getClass().getName());
> SpeciesReference species = SpeciesReference)products.get(n);
> System.out.println(species.getSpecies());
> }
> }
> }
> }
>
> network.xml is an SBML file.
>
> Help is greatly appreciated. I am working on an SBML importer for Cytoscape.
>
>
|
|
|
Posts: 92
Registered: May 2004
|
|
Re: Re: lisSBML causes a crash
|
22 Mar '06 02:09
|
 |
|
Hi Ben,
I am experiencing similar crashes on the Mac and under Windows. I just
tried to get the java bindings with layout to run under windows, but
whenever I try to run the example1.java, the JVM crashes. It crashes
when I call setLevel on an SBMLDocument that I have create right before.
This was under windows.
I can reproduce this under Mac OS with the example1.cpp it also crashes
with the following backtrace:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x000001d8
0x00016880 in SBMLDocument::setLevel (this=0xb002b0, level=2) at
SBMLDocument.cpp:347
347 model->mLevel = this->level;
(gdb) bt
#0 0x00016880 in SBMLDocument::setLevel (this=0xb002b0, level=2) at
SBMLDocument.cpp:347
#1 0x00003184 in main ()
This is with the current CVS sources compiled with "-g -O0", expat and
the layout enabled.
I will see if I have the time to go into this.
Ralph
WLigtenberg wrote:
> I have here a simple class that will generate the error. (At least on my machine)
>
>
> import org.sbml.libsbml.*;
>
> public class Demo1
> {
> public static void main(String args[])
> {
> System.loadLibrary("sbmlj");
> SBMLReader reader = new SBMLReader();
> SBMLDocument document = reader.readSBML("network.xml");
> Model model = document.getModel();
>
> ListOf listOf_reactions = model.getListOfReactions();
>
> for(int j = 0; j < model.getNumReactions(); j++) {
> Reaction reaction = (Reaction)listOf_reactions.get(j);
>
> ListOf products = reaction.getListOfProducts();
> System.out.println(products.getNumItems());
> for(int n = 0; n < products.getNumItems(); ++n) {
> System.out.println(products.get(n).getClass().getName());
> SpeciesReference species = SpeciesReference)products.get(n);
> System.out.println(species.getSpecies());
> }
> }
> }
> }
>
> network.xml is an SBML file.
>
> Help is greatly appreciated. I am working on an SBML importer for Cytoscape.
>
>
|
|
|
Posts: 92
Registered: May 2004
|
|
Re: Re: lisSBML causes a crash
|
22 Mar '06 03:37
|
 |
|
To answer my own mail. The problem is obviously that the setLevel
function of SBMLDocument now also sets the level on its model, but if
the model is not set at that time libsbml crashes.
I guess the setLevel should check if model is NULL before setting the
level on it.
What I do not understand however is why model all of a sudden has a level?
Ralph
|
|
|
Posts: 92
Registered: May 2004
|
|
Re: Re: lisSBML causes a crash
|
22 Mar '06 03:37
|
 |
|
To answer my own mail. The problem is obviously that the setLevel
function of SBMLDocument now also sets the level on its model, but if
the model is not set at that time libsbml crashes.
I guess the setLevel should check if model is NULL before setting the
level on it.
What I do not understand however is why model all of a sudden has a level?
Ralph
|
|
|
Posts: 287
Registered: September 2003
|
|
Re: Re: lisSBML causes a crash
|
22 Mar '06 10:45
|
 |
|
Hi Ralph,
> The problem is obviously that the setLevel function of
> SBMLDocument now also sets the level on its model, but if the
> model is not set at that time libsbml crashes.
Sorry. Thanks for the report. This is now fixed in CVS (this bug
only affects those using a CVS checkout of libSBML after March 7, 2006.)
> What I do not understand however is why model all of a sudden has a
> level?
I put this in as a quick fix for some consistency constraints that
Sarah Keating needed to write. But I wanted to move libSBML objects
in the direction of knowing their level and version information to
solve the name / id dichotomy problem. I first proposed this idea to
libsbml-discuss about a year ago:
http://www.sbml.org/forums/index.php?t=tree&th=519
I've got an implementation of this that's much cleaner than what's
currently in CVS. I've moved the level and version information up to
SBase. I'm not quite ready to check this in since it depends on a
few other things that I'm still working on.
Thanks.
Ben
|
|
|
Posts: 287
Registered: September 2003
|
|
Re: Re: lisSBML causes a crash
|
22 Mar '06 10:45
|
 |
|
Hi Ralph,
> The problem is obviously that the setLevel function of
> SBMLDocument now also sets the level on its model, but if the
> model is not set at that time libsbml crashes.
Sorry. Thanks for the report. This is now fixed in CVS (this bug
only affects those using a CVS checkout of libSBML after March 7, 2006.)
> What I do not understand however is why model all of a sudden has a
> level?
I put this in as a quick fix for some consistency constraints that
Sarah Keating needed to write. But I wanted to move libSBML objects
in the direction of knowing their level and version information to
solve the name / id dichotomy problem. I first proposed this idea to
libsbml-discuss about a year ago:
http://www.sbml.org/forums/index.php?t=tree&th=519
I've got an implementation of this that's much cleaner than what's
currently in CVS. I've moved the level and version information up to
SBase. I'm not quite ready to check this in since it depends on a
few other things that I'm still working on.
Thanks.
Ben
|
|
|
Posts: 92
Registered: May 2004
|
|
Re: Re: lisSBML causes a crash
|
27 Mar '06 01:21
|
 |
|
Ben Bornstein wrote:
> Hi Ralph,
>
>> The problem is obviously that the setLevel function of SBMLDocument
>> now also sets the level on its model, but if the model is not set at
>> that time libsbml crashes.
>
> Sorry. Thanks for the report. This is now fixed in CVS (this bug
> only affects those using a CVS checkout of libSBML after March 7, 2006.)
>
>
OK.
>> What I do not understand however is why model all of a sudden has a
>> level?
>
> I put this in as a quick fix for some consistency constraints that
> Sarah Keating needed to write. But I wanted to move libSBML objects
> in the direction of knowing their level and version information to
> solve the name / id dichotomy problem. I first proposed this idea to
> libsbml-discuss about a year ago:
>
> http://www.sbml.org/forums/index.php?t=tree&th=519
>
> I've got an implementation of this that's much cleaner than what's
> currently in CVS. I've moved the level and version information up to
> SBase. I'm not quite ready to check this in since it depends on a few
> other things that I'm still working on.
>
Why don't all objects have a parent /child relationship in libsbml? This
way, each object could also find out it's level and version and some
other things as well.
Ralph
|
|
|
Posts: 92
Registered: May 2004
|
|
Re: Re: lisSBML causes a crash
|
27 Mar '06 01:21
|
 |
|
Ben Bornstein wrote:
> Hi Ralph,
>
>> The problem is obviously that the setLevel function of SBMLDocument
>> now also sets the level on its model, but if the model is not set at
>> that time libsbml crashes.
>
> Sorry. Thanks for the report. This is now fixed in CVS (this bug
> only affects those using a CVS checkout of libSBML after March 7, 2006.)
>
>
OK.
>> What I do not understand however is why model all of a sudden has a
>> level?
>
> I put this in as a quick fix for some consistency constraints that
> Sarah Keating needed to write. But I wanted to move libSBML objects
> in the direction of knowing their level and version information to
> solve the name / id dichotomy problem. I first proposed this idea to
> libsbml-discuss about a year ago:
>
> http://www.sbml.org/forums/index.php?t=tree&th=519
>
> I've got an implementation of this that's much cleaner than what's
> currently in CVS. I've moved the level and version information up to
> SBase. I'm not quite ready to check this in since it depends on a few
> other things that I'm still working on.
>
Why don't all objects have a parent /child relationship in libsbml? This
way, each object could also find out it's level and version and some
other things as well.
Ralph
|
|
|
Posts: 287
Registered: September 2003
|
|
Re: Re: lisSBML causes a crash
|
27 Mar '06 10:02
|
 |
|
Hi Ralph,
> Why don't all objects have a parent /child relationship in libsbml?
> This way, each object could also find out it's level and version
> and some other things as well.
I protested parent pointers for awhile because it complicates the
design and adds overhead to each object, but it's clear now the
benefits outweigh the costs. Okay, I didn't really "protest", but I
just couldn't resist the chance to alliterate. :)
For now, I've added an SBMLDocument pointer on SBase as well as the
four methods:
SBMLDocument* getSBMLDocument()
Model* getModel()
unsigned int getLevel()
unsigned int getVersion()
The last three methods defer to SBMLDocument (if available). If the
SBMLDocument pointer is NULL, getModel() returns NULL and getLevel()/
getVersion() call the new static methods SBMLDocument::getDefaultLevel
() or SBMLDocument::getDefaultVersion().
A slightly better design (looking towards Model composition in Level
3) is to have SBase contain a pointer to its parent Model and Model
contains a pointer to its SBMLDocument. Either way, the
implementation choice won't affect SBase's public interface. The
four methods are implementable either way.
The notion of pervasive parent pointers is palatable. For instance a
KineticLaw would be able to know its parent Reaction. For this, I'd
like to define a single method on SBase:
virtual SBase* getParent()
and then override it on KineticLaw:
virtual Reaction* getParent()
This is allowed in C++ (it's called a covariant return type), but
there are two issues:
1. MSVC 6 doesn't support it (yet another reason to upgrade)
2. I'm not sure how some language bindings will react.
For instance, does anyone know if Java supports
something similar?
So, perhaps pervasive parent pointers deserves further pondering.
Let's talk about it at the Hackathon.
Thanks.
Ben
|
|
|
Posts: 287
Registered: September 2003
|
|
Re: Re: lisSBML causes a crash
|
27 Mar '06 10:02
|
 |
|
Hi Ralph,
> Why don't all objects have a parent /child relationship in libsbml?
> This way, each object could also find out it's level and version
> and some other things as well.
I protested parent pointers for awhile because it complicates the
design and adds overhead to each object, but it's clear now the
benefits outweigh the costs. Okay, I didn't really "protest", but I
just couldn't resist the chance to alliterate. :)
For now, I've added an SBMLDocument pointer on SBase as well as the
four methods:
SBMLDocument* getSBMLDocument()
Model* getModel()
unsigned int getLevel()
unsigned int getVersion()
The last three methods defer to SBMLDocument (if available). If the
SBMLDocument pointer is NULL, getModel() returns NULL and getLevel()/
getVersion() call the new static methods SBMLDocument::getDefaultLevel
() or SBMLDocument::getDefaultVersion().
A slightly better design (looking towards Model composition in Level
3) is to have SBase contain a pointer to its parent Model and Model
contains a pointer to its SBMLDocument. Either way, the
implementation choice won't affect SBase's public interface. The
four methods are implementable either way.
The notion of pervasive parent pointers is palatable. For instance a
KineticLaw would be able to know its parent Reaction. For this, I'd
like to define a single method on SBase:
virtual SBase* getParent()
and then override it on KineticLaw:
virtual Reaction* getParent()
This is allowed in C++ (it's called a covariant return type), but
there are two issues:
1. MSVC 6 doesn't support it (yet another reason to upgrade)
2. I'm not sure how some language bindings will react.
For instance, does anyone know if Java supports
something similar?
So, perhaps pervasive parent pointers deserves further pondering.
Let's talk about it at the Hackathon.
Thanks.
Ben
|
|
|
Posts: 287
Registered: September 2003
|
|
Re: Re: lisSBML causes a crash
|
27 Mar '06 10:02
|
 |
|
Hi Ralph,
> Why don't all objects have a parent /child relationship in libsbml?
> This way, each object could also find out it's level and version
> and some other things as well.
I protested parent pointers for awhile because it complicates the
design and adds overhead to each object, but it's clear now the
benefits outweigh the costs. Okay, I didn't really "protest", but I
just couldn't resist the chance to alliterate. :)
For now, I've added an SBMLDocument pointer on SBase as well as the
four methods:
SBMLDocument* getSBMLDocument()
Model* getModel()
unsigned int getLevel()
unsigned int getVersion()
The last three methods defer to SBMLDocument (if available). If the
SBMLDocument pointer is NULL, getModel() returns NULL and getLevel()/
getVersion() call the new static methods SBMLDocument::getDefaultLevel
() or SBMLDocument::getDefaultVersion().
A slightly better design (looking towards Model composition in Level
3) is to have SBase contain a pointer to its parent Model and Model
contains a pointer to its SBMLDocument. Either way, the
implementation choice won't affect SBase's public interface. The
four methods are implementable either way.
The notion of pervasive parent pointers is palatable. For instance a
KineticLaw would be able to know its parent Reaction. For this, I'd
like to define a single method on SBase:
virtual SBase* getParent()
and then override it on KineticLaw:
virtual Reaction* getParent()
This is allowed in C++ (it's called a covariant return type), but
there are two issues:
1. MSVC 6 doesn't support it (yet another reason to upgrade)
2. I'm not sure how some language bindings will react.
For instance, does anyone know if Java supports
something similar?
So, perhaps pervasive parent pointers deserves further pondering.
Let's talk about it at the Hackathon.
Thanks.
Ben
|
|
|
Posts: 287
Registered: September 2003
|
|
Re: Re: lisSBML causes a crash
|
27 Mar '06 10:02
|
 |
|
Hi Ralph,
> Why don't all objects have a parent /child relationship in libsbml?
> This way, each object could also find out it's level and version
> and some other things as well.
I protested parent pointers for awhile because it complicates the
design and adds overhead to each object, but it's clear now the
benefits outweigh the costs. Okay, I didn't really "protest", but I
just couldn't resist the chance to alliterate. :)
For now, I've added an SBMLDocument pointer on SBase as well as the
four methods:
SBMLDocument* getSBMLDocument()
Model* getModel()
unsigned int getLevel()
unsigned int getVersion()
The last three methods defer to SBMLDocument (if available). If the
SBMLDocument pointer is NULL, getModel() returns NULL and getLevel()/
getVersion() call the new static methods SBMLDocument::getDefaultLevel
() or SBMLDocument::getDefaultVersion().
A slightly better design (looking towards Model composition in Level
3) is to have SBase contain a pointer to its parent Model and Model
contains a pointer to its SBMLDocument. Either way, the
implementation choice won't affect SBase's public interface. The
four methods are implementable either way.
The notion of pervasive parent pointers is palatable. For instance a
KineticLaw would be able to know its parent Reaction. For this, I'd
like to define a single method on SBase:
virtual SBase* getParent()
and then override it on KineticLaw:
virtual Reaction* getParent()
This is allowed in C++ (it's called a covariant return type), but
there are two issues:
1. MSVC 6 doesn't support it (yet another reason to upgrade)
2. I'm not sure how some language bindings will react.
For instance, does anyone know if Java supports
something similar?
So, perhaps pervasive parent pointers deserves further pondering.
Let's talk about it at the Hackathon.
Thanks.
Ben
|
|
|
| Topic: libSBML Changes |
|---|
Posts: 287
Registered: September 2003
|
|
libSBML Changes
|
29 Mar '06 21:15
|
 |
|
Hi All,
I've made some rather significant architectural changes to libSBML.
I tried to keep these changes out of CVS until everything was
complete so as not to break the build or anyone else's code, but I
can't do so any longer. I need to start sharing code with Sarah and
Mike in preparation for the Hackathon.
For the next few days, please consider the CVS copy of libSBML to be
in flux while we tie-up loose ends and iron out platform and compiler
differences. This means a build from CVS sources may not work for
you, or if it does, unit tests may fail.
Ralph and Sven, the layout extension definitely will not work.
Sorry. I'll do my best to get it working again ASAP.
I'll send out another email either tomorrow or Friday describing the
changes and new features in the upcoming release.
Thanks.
Ben
|
|
|
| Topic: [sbml-discuss] libSBML Error compiling under cygwin |
|---|
Posts: 32
Registered: March 2006
|
|
[sbml-discuss] libSBML Error compiling under cygwin
|
31 Mar '06 06:34
|
 |
|
I get the following errors when compiling libSBML under cygwin. It
appears to be a problem with expat. I have not tried xerces yet, but if
I remember correctly, expat is faster, has a smaller footprint, and is
generally better for libSBML, so I wanted to use it.
Bill
g++ -I.. -I. -DWIN32 -DCYGWIN -DLIBSBML_EXPORTS -g -O2 -MT
StreamFormatTarg
et.o -MD -MP -MF ".deps/StreamFormatTarget.Po" -c -o
StreamFormatTarget.o Stream
FormatTarget.cpp
In file included from StreamFormatTarget.h:47,
from StreamFormatTarget.cpp:40:
expat.h:65: error: 'XML_Parser' is used as a type, but is not defined as a
type.
expat.h:82: error: parse error before `*' token
expat.h:152: error: parse error before `*' token
expat.h:159: error: parse error before `*' token
expat.h:173: error: parse error before `*' token
expat.h:188: error: parse error before `*' token
expat.h:200: error: parse error before `*' token
expat.h:244: error: parse error before `*' token
expat.h:260: error: parse error before `*' token
expat.h:277: error: parse error before `*' token
expat.h:320: error: parse error before `*' token
expat.h:327: error: parse error before `*' token
expat.h:342: error: parse error before `*' token
expat.h:372: error: parse error before `*' token
expat.h:385: error: use of enum `XML_Error' without previous declaration
expat.h:385: error: ISO C++ forbids declaration of `getErrorCode' with
no type
expat.h:392: error: ISO C++ forbids declaration of `XML_LChar' with no type
expat.h:392: error: parse error before `*' token
expat.h:397: error: ISO C++ forbids declaration of `XML_LChar' with no type
expat.h:397: error: declaration of `const int Expat::XML_LChar'
expat.h:392: error: conflicts with previous declaration `const int
Expat::XML_LChar'
expat.h:397: error: parse error before `*' token
expat.h:427: error: ISO C++ forbids declaration of `XML_LChar' with no type
expat.h:427: error: declaration of `const int Expat::XML_LChar'
expat.h:392: error: conflicts with previous declaration `const int
Expat::XML_LChar'
expat.h:427: error: parse error before `*' token
expat.h:449: error: parse error before `*' token
expat.h:458: error: parse error before `*' token
expat.h:468: error: parse error before `*' token
expat.h:479: error: parse error before `*' token
expat.h:488: error: parse error before `*' token
expat.h:511: error: parse error before `*' token
expat.h:524: error: `XML_Parser' was not declared in this scope
expat.h:524: error: parse error before `,' token
expat.h:538: error: parse error before `*' token
expat.h:549: error: parse error before `*' token
expat.h:558: error: parse error before `*' token
expat.h:569: error: parse error before `*' token
expat.h:583: error: parse error before `*' token
In file included from StreamFormatTarget.h:48,
from StreamFormatTarget.cpp:40:
ExpatFormatter.h:123: error: parse error before `[' token
ExpatFormatter.h:124: error: parse error before `&' token
ExpatFormatter.h:134: error: parse error before `*' token
ExpatFormatter.h:141: error: parse error before `&' token
ExpatFormatter.h:141: error: `XMLFormatter&
XMLFormatter::operator<<(...)' must
take exactly one argument
ExpatFormatter.h:142: error: parse error before `*' token
ExpatFormatter.h:142: error: `XMLFormatter&
XMLFormatter::operator<<(...)' must
take exactly one argument
ExpatFormatter.h:142: error: `XMLFormatter&
XMLFormatter::operator<<(...)' and
`XMLFormatter& XMLFormatter::operator<<(...)' cannot be overloaded
ExpatFormatter.h:143: error: parse error before `*' token
ExpatFormatter.h:147: error: ISO C++ forbids declaration of `XML_Char'
with no
type
ExpatFormatter.h:147: error: parse error before `*' token
ExpatFormatter.h:152: error: parse error before `&' token
ExpatFormatter.h:153: error: parse error before `&' token
ExpatFormatter.h:154: error: parse error before `&' token
ExpatFormatter.h:156: error: parse error before `&' token
make[2]: *** [StreamFormatTarget.o] Error 1
make[2]: Leaving directory `/tmp/libsbml-2.3.4/src/xml'
make[1]: *** [xml-recurse] Error 2
make[1]: Leaving directory `/tmp/libsbml-2.3.4/src'
make: *** [src-recurse] Error 2
|
|
|
| Topic: libSBML Changes |
|---|
Posts: 287
Registered: September 2003
|
|
libSBML Changes
|
29 Mar '06 21:15
|
 |
|
Hi All,
I've made some rather significant architectural changes to libSBML.
I tried to keep these changes out of CVS until everything was
complete so as not to break the build or anyone else's code, but I
can't do so any longer. I need to start sharing code with Sarah and
Mike in preparation for the Hackathon.
For the next few days, please consider the CVS copy of libSBML to be
in flux while we tie-up loose ends and iron out platform and compiler
differences. This means a build from CVS sources may not work for
you, or if it does, unit tests may fail.
Ralph and Sven, the layout extension definitely will not work.
Sorry. I'll do my best to get it working again ASAP.
I'll send out another email either tomorrow or Friday describing the
changes and new features in the upcoming release.
Thanks.
Ben
|
|
|
Posts: 287
Registered: September 2003
|
|
Re: libSBML Changes
|
04 Apr '06 14:23
|
 |
|
Hi All,
Unfortunately, the CVS copy of libSBML is now very much out-of-date
due to an inopportune SourceForge CVS outage:
http://sourceforge.net/docs/A04/
Developer CVS has been down since late last Thursday night, which
means, among other annoyances, Sarah and I have had to exchange code
by sending each other tarballs at the end of each day and then
performing diffs and manual merges.
We'll be releasing libSBML 3.0 Beta at the Hackathon and I'll give a
short presentation describing major changes and migration strategies
for this new and significantly improved libSBML.
Thanks.
Ben
|
|
|
Posts: 349
Registered: September 2003
|
|
RE: libSBML Changes
|
04 Apr '06 16:40
|
 |
|
I've noticed that sourceforge has become unreliable over the last 6
months, we're in the same situation.
Herbert
-----Original Message-----
From: Ben Bornstein [mailto:ben@bbornstein.org]
Sent: Tuesday, April 04, 2006 2:23 PM
To: LibSBML Discussion List
Subject: Re: [libsbml-discuss] libSBML Changes
Hi All,
Unfortunately, the CVS copy of libSBML is now very much out-of-date due
to an inopportune SourceForge CVS outage:
http://sourceforge.net/docs/A04/
Developer CVS has been down since late last Thursday night, which means,
among other annoyances, Sarah and I have had to exchange code by sending
each other tarballs at the end of each day and then performing diffs and
manual merges.
We'll be releasing libSBML 3.0 Beta at the Hackathon and I'll give a
short presentation describing major changes and migration strategies for
this new and significantly improved libSBML.
Thanks.
Ben
|
|
|
| Topic: Cannot load python binding module |
|---|
Posts: 11
Registered: June 2006
|
|
Cannot load python binding module
|
08 Apr '06 15:12
|
 |
|
Hello,
I have the same problem as described in
(*) http://www.sbml.org/forums/index.php?t=tree&goto=1099&rid=0
and I run eclipse 3.1.
As I understand from (*), it is important that python first looks
for libsbml.py and then for the two private and public *.so.
1) my first example, is the copy libsbmlpy.py of libsbml.py which is included in the PYTHONPATH before
the *.so s
2) my second example is libsbml.py which is included in the PYTHONPATH after the *.so s
2) terminates with
Traceback (most recent call last):
File "/home/olli/workspace/MSc_hello_world_py/test.py", line 4, in ?
import libsbml
ImportError: dynamic module does not define init function (initlibsbml)
as expected but
1) terminates with
Traceback (most recent call last):
File "/home/olli/workspace/MSc_hello_world_py/test.py", line 4, in ?
import libsbmlpy
File "/usr/local/lib/libsbmlpy.py", line 6, in ?
import _libsbml
ImportError: libsbml.so: cannot open shared object file: No such file or directory
which is supposed to work?
--------------------------
without Eclipse, essentially libsbmlpy.py is not found even though it is there (!?), and
the error from (2) above reproduces. I illustrate with some commmandline output:
#libsbmlpy.py is there
olliver:/usr/local/lib# ls
firmware libsbmlpy.py libsbmlpy.pyc python2.3 python2.4 site_ruby
#the *.so s are in the site-packages
olliver:/usr/local/lib/python2.3/site-packages# ls
_libsbml.so libsbml libsbml.2.3.4.so libsbml.a libsbml.pth libsbml.so
#pythonpath points to libsbml.py
olliver:/usr/local/lib/python2.3/site-packages# echo $PYTHONPATH
#the LD_LIBRARY_PATH points to the *.os s
/home/olli/scripting/src/tools:/usr/local/lib/python2.3/site-packages/libsbml:/usr/local/lib/
olliver:/usr/local/lib/python2.3/site-packages# echo $LD_LIBRARY_PATH
/usr/local/lib/python2.3/site-packages
Could you please help?
oliver
|
|
|
| Topic: Bug in libsbml? |
|---|
Posts: 23
Registered: June 2004
|
|
|
| Topic: Bug in libsbml? |
|---|
Posts: 23
Registered: June 2004
|
|
|
Posts: 287
Registered: September 2003
|
|
Re: Bug in libsbml?
|
17 Apr '06 11:13
|
 |
|
Hi Colin,
Thanks for the bug report. I haven't tried to reproduce this in
libSBML 2.3.4 yet, but the good news is it does not seem to be
present in libSBML 3.0.
Does the error occur if you call either:
s = libsbml.writeSBMLToString(d) # or
libsbml.writeSBML(d, filename)
?
Also, are you using Xerces or Expat? What version?
Thanks.
Ben
On Apr 17, 2006, at 12:49 AM, Colin Gillespie wrote:
> print d.toSBML()
>
> <sbml xmlns="http://www.sbml.org/sbml/level2" xmlns:math="http://
> www.w3.org/1998/Math/MathML" xmlns:math="http://www.w3.org/1998/
> Math/MathML" level="2" version="1">
> <model id="MyModel"/>
> </sbml>
>
> i.e. it prints out the MathML namespace twice, giving an invalid
> model.
>
> (Using libsbml 2.3.4 under linux)
|
|
|
Posts: 287
Registered: September 2003
|
|
Re: Bug in libsbml?
|
17 Apr '06 11:13
|
 |
|
Hi Colin,
Thanks for the bug report. I haven't tried to reproduce this in
libSBML 2.3.4 yet, but the good news is it does not seem to be
present in libSBML 3.0.
Does the error occur if you call either:
s = libsbml.writeSBMLToString(d) # or
libsbml.writeSBML(d, filename)
?
Also, are you using Xerces or Expat? What version?
Thanks.
Ben
On Apr 17, 2006, at 12:49 AM, Colin Gillespie wrote:
> print d.toSBML()
>
> <sbml xmlns="http://www.sbml.org/sbml/level2" xmlns:math="http://
> www.w3.org/1998/Math/MathML" xmlns:math="http://www.w3.org/1998/
> Math/MathML" level="2" version="1">
> <model id="MyModel"/>
> </sbml>
>
> i.e. it prints out the MathML namespace twice, giving an invalid
> model.
>
> (Using libsbml 2.3.4 under linux)
|
|
|
Posts: 23
Registered: June 2004
|
|
Re: Bug in libsbml?
|
18 Apr '06 01:18
|
 |
|
Hi Ben,
Ben Bornstein wrote:
> Hi Colin,
>
> Thanks for the bug report. I haven't tried to reproduce this in
> libSBML 2.3.4 yet, but the good news is it does not seem to be
> present in libSBML 3.0.
>
> Does the error occur if you call either:
>
> s = libsbml.writeSBMLToString(d) # or
> libsbml.writeSBML(d, filename)
>
Yes
>
> Also, are you using Xerces or Expat? What version?
Xerces 2.3.0
Many thanks
Colin
>
> On Apr 17, 2006, at 12:49 AM, Colin Gillespie wrote:
>
>> print d.toSBML()
>>
>> <sbml xmlns="http://www.sbml.org/sbml/level2" xmlns:math="http://
>> www.w3.org/1998/Math/MathML" xmlns:math="http://www.w3.org/1998/
>> Math/MathML" level="2" version="1">
>> <model id="MyModel"/>
>> </sbml>
>>
>> i.e. it prints out the MathML namespace twice, giving an invalid
>> model.
>>
>> (Using libsbml 2.3.4 under linux)
>
>
>
|
|
|
| Topic: InitialConcentration vs. InitialAmount |
|---|
Posts: 53
Registered: April 2005
|
|
InitialConcentration vs. InitialAmount
|
17 Apr '06 18:56
|
 |
|
Hello,
What does libSBML do if Species_getInitialAmount(species) is called on a species where the initialAmount is not set? (Similarly, what is returned if Species_getInitialConcentration(species) is called on a species where the initialConcentration is not set?).
It seems that the functions are returning the one that is set. For example, if initialAmount is set, and I call Species_getInitialConcentration, it returns the initialAmount. Am I observing this correctly?
Thank you,
--Jordan
|
|
|
Posts: 287
Registered: September 2003
|
|
Re: InitialConcentration vs. InitialAmount
|
18 Apr '06 11:13
|
 |
|
Hi Jordon,
Your observations are correct. Use Species.isSetInitialAmount() and
Species.isSetInitialConcentration() to determine which field has been
set.
In libSBML, any numeric field without a default value has isSetXXX()
and unsetXXX() methods. A separate boolean field is used to track
the set/unset status of each numeric field. This boolean field
necessary because there is no special numeric value for either
integers or floats (since NaN is allowed) to indicate "no value
present". In most cases, when a numeric field is unset, I clear the
corresponding numeric value to be safe. For integers, I set the
field to zero. For doubles, I set the field to NaN (that way when
you try to use the value, you should notice that something is not
right). For Species, since initialAmount and initialConcentration
are mutually exclusive, I chose to let them share the same underlying
field with two separate boolean variables to keep track of which one
is set. This explains the behavior you've described.
Thanks.
Ben
On Apr 18, 2006, at 9:27 AM, Jordan Atlas wrote:
> It seems that the functions are returning the one that is set. For
> example, if initialAmount is set, and I call
> Species_getInitialConcentration, it returns the initialAmount. Am
> I observing this correctly?
|
|
|
| Topic: Removing components from models |
|---|
Posts: 53
Registered: April 2005
|
|
Removing components from models
|
16 Apr '06 15:32
|
 |
|
Hello,
I would like to remove a Species/Compartment/etc. from an SBML model using libSBML. It seems that the only methods for deleting these components are the "_free" destructors. But these don't actually change the Model_t* object, do they? For example, in the following code, will the value of 'number' be any different after the second/fourth lines?:
Species_t* s = Model_createSpecies(model);
int number = Model_getNumSpecies(model);
Species_free(s);
number = Model_getNumSpecies(model);
(assuming 'model' is defined elsewhere).
So is there some other way to actually "remove" the species from the model?
Thanks,
--Jordan
|
|
|
Posts: 287
Registered: September 2003
|
|
Re: Removing components from models
|
17 Apr '06 10:58
|
 |
|
Hi Jordan,
You can remove items via the ListOf object. Modifying your example
slightly:
Species_t *s = Model_createSpecies(model);
ListOf_t *lo = Model_getListOfSpecies(model);
int number = Model_getNumSpecies(model);
s = (Species_t *) ListOf_remove(lo, 0);
Species_free(s);
number = Model_getNumSpecies(model);
I didn't add "remove" functions for every object (e.g.
Model_removeSpecies()) because it didn't seem like a very common
operation. I thought the two most common use cases would be i) to
query a model that has been read in, or ii) to construct a new model
and write it out. If the above is too onerous or circuitous, let me
know and I'll add "remove" functions throughout in libSBML 3.0.
Thanks.
Ben
On Apr 16, 2006, at 9:26 PM, Jordan Atlas wrote:
> I would like to remove a Species/Compartment/etc. from an SBML
> model using libSBML. It seems that the only methods for deleting
> these components are the "_free" destructors. But these don't
> actually change the Model_t* object, do they? For example, in the
> following code, will the value of 'number' be any different after
> the second/fourth lines?:
>
> Species_t* s = Model_createSpecies(model);
> int number = Model_getNumSpecies(model);
> Species_free(s);
> number = Model_getNumSpecies(model);
> (assuming 'model' is defined elsewhere).
>
> So is there some other way to actually "remove" the species from
> the model?
|
|
|
Posts: 287
Registered: September 2003
|
|
Re: Removing components from models
|
17 Apr '06 10:58
|
 |
|
Hi Jordan,
You can remove items via the ListOf object. Modifying your example
slightly:
Species_t *s = Model_createSpecies(model);
ListOf_t *lo = Model_getListOfSpecies(model);
int number = Model_getNumSpecies(model);
s = (Species_t *) ListOf_remove(lo, 0);
Species_free(s);
number = Model_getNumSpecies(model);
I didn't add "remove" functions for every object (e.g.
Model_removeSpecies()) because it didn't seem like a very common
operation. I thought the two most common use cases would be i) to
query a model that has been read in, or ii) to construct a new model
and write it out. If the above is too onerous or circuitous, let me
know and I'll add "remove" functions throughout in libSBML 3.0.
Thanks.
Ben
On Apr 16, 2006, at 9:26 PM, Jordan Atlas wrote:
> I would like to remove a Species/Compartment/etc. from an SBML
> model using libSBML. It seems that the only methods for deleting
> these components are the "_free" destructors. But these don't
> actually change the Model_t* object, do they? For example, in the
> following code, will the value of 'number' be any different after
> the second/fourth lines?:
>
> Species_t* s = Model_createSpecies(model);
> int number = Model_getNumSpecies(model);
> Species_free(s);
> number = Model_getNumSpecies(model);
> (assuming 'model' is defined elsewhere).
>
> So is there some other way to actually "remove" the species from
> the model?
|
|
|