-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime conflicts between libsbml wheels and other packages #22
Comments
Some more background in opencobra/cobrapy#1056. This is the issue I mentioned at HARMONY @fbergmann. |
I've tried it with manylinux2010, but am actually getting crashes immediately when importing libsbml after symengine. @cdiener or @Midnighter, could you try whether this issue occurs as well, when libSBML is installed via conda-forge? https://github.com/conda-forge/python-libsbml-feedstock thanks |
From conda-forge it indeed works for me. Python 3.9.2 | packaged by conda-forge | (default, Feb 21 2021, 05:02:46)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import symengine
>>> import libsbml
>>> doc = libsbml.readSBML("iJO1366.xml.gz")
>>> doc.getModel().getReaction("R_LDH_D").getSBOTermID()
'SBO:0000375'
|
This is weird. I would think it works with conda since that guaranteed the same version in libc etc. So symbols won't conflict. But this should be the same case if both use the same manylinux image. Maybe it installed the 2014 version for symengine? We only observed the error on Python 3.9 so it could be an issue with the manylinux2014 image specifically. |
I also ran the manylinux2014 container and built it there. There pip would install the manylinux2010 version of symengine. But the crash is also happening. |
Okay, thanks for checking! |
As far as I can tell, there are 72 symbols with the same name available from the libsbml and symengine shared libraries. I've dumped outputs and a quick notebook looking at them in this gist. |
This is a shot in the dark but could this be a bug? I looked at https://github.com/sbmlteam/libsbml/blob/947560213b8f22fe6c64919b6d1abb1a018b7d64/src/sbml/SBO.cpp. And saw the following: bool
SBO::checkTerm (const std::string& sboTerm) // <- signature requires string
{
string::size_type size = sboTerm.size();
bool okay = (size == 11);
char sbo[4] = {83, 66, 79, 58};
unsigned int n = 0;
while (okay && n < 4)
{
okay = (sboTerm[n] == sbo[n]);
n++;
}
for (n = 4; okay && n < size; ++n) okay = isdigit(sboTerm[n]);
return okay;
}
...
string
SBO::intToString (int sboTerm)
{
string result = "";
if ( checkTerm(sboTerm) ) // <- see here, sboTerm is an int
{
ostringstream stream;
stream << "SBO:";
stream << setw(7) << setfill('0') << sboTerm;
result = stream.str();
}
return result;
} Maybe there is some undefined behavior involved because of the implicit cast? |
there is an overload with int too:
the issue is more likely related to one of the library linking statically against the c++ library. and some static string members being freed. |
As indicated on that project, it compiles with |
This has been fixed in symengine 0.7.1 now. Thanks for your help with this!
|
Hi,
we noticed that some other wheels can break libsbml behavior. For instance on Python 3.9 with liSBML=5.19.0:
Removing the symengine import will change the output to:
Could be related to libc or llvm issues.
I also noticed that you are using a fairly old manylinux version for Python 3.9 (see the table at https://github.com/pypa/manylinux).
The text was updated successfully, but these errors were encountered: