unexpected results after manual installation

9 views
Skip to first unread message

Alexander Tille

unread,
Nov 7, 2018, 11:17:21 AM11/7/18
to libsbml-development
Hi,

I have written a program that does simulations of sbml-models in c++.

Normally I use the library that I get from the package libsbml5-dev

libsbml5-dev:
Installiert: 5.16.0+dfsg-1
Installationskandidat: 5.16.0+dfsg-1

Now I want to do simulations on a server, where I am not able to install the package. So I decided to install it manually.
You can see the steps of installation in the following.

wget 'https://sourceforge.net/projects/sbml/files/libsbml/5.16.0/stable/libSBML-5.16.0-core-src.zip'
unzip libSBML-5.16.0-core-src.zip
rm libSBML-5.16.0-core-src.zip
cd libsbml-5.16.0
mkdir -p build
cd build
cmake -DLIBSBML_USE_LEGACY_MATH=ON ..
make

I included the manually installed library into my code, but here I observe some difference to the libsbml5-dev package.

The code-breaking difference is the following method
model->getReaction(r)->getKineticLaw()->getMath()->getType()
In the manually build version always 0 is returned, in contrast to the package version, where the AST of the kinetic Law is read correctly.

I tried to choose a different XMLParser like Xerxes or EXPAT, but this parser aren't on my machine, so that I assume that the XMLparser of both versions are the same.

Any ideas why I get different results from the function?

Best,
Alex

Frank T. Bergmann

unread,
Nov 8, 2018, 3:38:43 AM11/8/18
to libsbml-development
Hello Alex, 

I'm afraid we don't have enough information yet to sort this issue for you: 

- from what distro / version did you get the package?
- is there a specific sbml file that causing this issue? if so could we have a look at it. 

if it is not an isolated issue, please be aware that there are several potential issues with the line you mentioned as: 

- reactions don't necessarily have a kinetic law and  even if they do 
- they might not contain math

so each of those pointers returned could be NULL. But of course it is tough to say without seeing the actual code. 

Oh .. and the choice of xml parsers won't influence whether the model is completely read or not. 

best
Frank



Alexander Tille

unread,
Nov 8, 2018, 4:40:07 AM11/8/18
to libsbml-development
Here come the missing information:

Im using Ubuntu18.04, and I installed the package libsbml5-dev with has the version libsbml-5.16.0

I have created and tested my program with various sbml models(like the attached one) and I've always made sure that every reaction was a kinetic law and there is some math in it.

Now I've manually installed a version downloaded from sourceforge. I tested libsbml-5.16.0 and libsbml-5.17.0 but I want to compare only the manually installed 5.16.0 version to minimize the difference between both versions.

As I sad before the manual installation includes the option LIBSBML_USE_LEGACY_MATH=ON. I just thought that this option would solve my problem already. (I also tested it without changing any options)

My Program with the manual installation is not able to do a simulation any more. I tracked one crucial error (there might be more). When I try to parse the AST of the math given from a kinetic law of a reaction.

The function 
model->getReaction(r)->getKineticLaw()->getMath()
returns an adress, but when I want to do some operations like
->getNumChildren() ---> Segmentation fault
->getType() ---> 0/NULL

Best,
Alex
model_confrontation_essay.xml

Frank T. Bergmann

unread,
Nov 8, 2018, 5:12:12 AM11/8/18
to libsbml-development
Hello Alex, 

So i've checked with the binary package in ubuntu, they compile with LIBSBML_USE_LEGACY_MATH=OFF, but that really should make no difference as far as i can tell. What could make a difference though, is if you compiled your simulator project with legacy math off, while the library has been created with legacy math on. Does #defining LIBSBML_USE_LEGACY_MATH 1 make a difference? (or alternatively you could include <sbml/common/libsbml-config.h> before the first use of sbml functions, if that makes a difference we might have not included it somewhere). 

You could try and grab our pre-compiled binaries to see whether it makes a difference: 


these have been compiled with legacy math on. 

if neither of those suggestions work, i'm afraid we would have to look at the code / build system to see what is going on. 

best
Frank


Alexander Tille

unread,
Nov 8, 2018, 5:37:25 AM11/8/18
to libsbml-development
I build a minimal program that just reads and prints the model, that I wanted to upload here to show the differences.

But, in the minimal program, both versions give the same result. I think that the error does not come from different installed sbml versions, but from my side.
I need to take a closer look at the program and I apologize for the trouble.

Best,
Alex
Reply all
Reply to author
Forward
0 new messages