Open kirichoi opened 8 years ago
I don't know about the Antimony issue but I can now use the python bindings via either PYTHONPATH or setup.py install
, so I'm marking this solved.
The issue is almost fixed. Some smaller troubles remain:
[1]
The library is installed under the wrong name: libsbml2matlab
instead of sbml2matlab
. See below and log attached. Consequently, I cannot do
ìmport sbml2matlab
[ 37%] Built target libsbml2matlab
[ 50%] Built target libsbml2matlab-static
...
-- Installing: /usr/local/lib/python2.7/site-packages/sbml2matlab/_libsbml2matlab.so
-- Installing: /usr/local/lib/python2.7/site-packages/libsbml2matlab.pth
[2] The package should be installed via pip (analoque to antimony and phrasedml). I.e. not a pip package, but the python bindings have to be installed via pip. This resolves the issues with having to set PYTHONPATH variables manually.
The package itselfs seems to work, i.e. could translate simple sbml to matlab after importing the libsbml2matlab
package.
I renamed all the instances of libsbml2matlab
to sbml2matlab
, installed in a clean virtual environment (via python setup.py install
), and made sure I could run sbml2matlab as follows:
import sbml2matlab
with open('path/to/sbml.xml') as f:
sbmlstr = f.read()
sbml2matlab.sbml2matlab(sbmlstr)
The above code works and produces the Matlab output, so I think the issue with the module name is fixed. Please let me know if you still run into trouble with this.
Perfect. Working now.
One last remark. If one doesn't set the CMAKE_INSTALL_PREFIX the default is set to /usr/local
which results in files being written in very general locations. For instance you write README.txt in /usr/local.
All files should be written in a sbml2matlab folder.
The following should be written in /usr/local/lib/python2.7/site-packages/sbml2matlab
-- Up-to-date: /usr/local/./README.txt
-- Up-to-date: /usr/local/./LICENSE.txt
-- Up-to-date: /usr/local/./NOTICE.txt
-- Up-to-date: /usr/local/./help/help.zip
Also the following files are written directly in /usr/local/lib/python2.7/site-packages/ instead of a sbml2matlab folder
-- Installing: /usr/local/lib/python2.7/site-packages/setup.py
-- Up-to-date: /usr/local/lib/python2.7/site-packages/MANIFEST.in
-- Installing: /usr/local/lib/python2.7/site-packages/meta.yaml
-- Installing: /usr/local/lib/python2.7/site-packages/build.sh
-- Installing: /usr/local/lib/python2.7/site-packages/bld.bat
It is clobbering the installation directory a little too much. Let's get some input from other team members to standardize where to put the installation files across our various projects. @hsauro, @luciansmith, @kirichoi can we take a look at our options and pick one?
setup.py
?
Users need to be able to run python setup.py install
to install the Python bindings. Roadrunner and Antimony both support this. Antimony actually runs it as part of the cmake build process by default. I don't think we should do it that way because 1) you can't zip up the installation directory, send it to someone, and tell them to run the included setup.py, 2) making conda packages is much easier if you can just run setup.py yourself, and 3) some users will get really annoyed if they find out a package installed itself to their system Python without their explicit permission. If I've missed any subtleties in the Antimony build system, @luciansmith please clarify.So, I think that setup.py should go somewhere in the installation directory. Roadrunner puts it in the root of the installation directory, and I'm okay with that, but let's get everyone's input. This does imply that setup.py will get written to /usr/local/setup.py
by default.
Whatever we do, we should try to stick to it across all our projects so our users know how to run setup.py for any package.
/usr/local
by default. This doesn't impact the functionality of the software, it's just a preference.
via @matthiaskoenig in sys-bio/tellurium#71:
Hi all, sorry for being of topic, but somehow sbml2matlab https://github.com/sys-bio/sbml2matlab has no issue tracker where I could post issues. Please open an issue tracker there.
[1] Link in description of the project is broken -> An SBML to MATLAB Converter http://stanley-gu.github.com/sbml2matlab/
[2] The python bindings are broken in linux, i.e. they are registered under a wrong name and not linked properly. The installed files are:
The naming is libsbml2matlab and sbml2matlab mixed, which breaks on linux.
Trying to import in python results than in
This is identical to the python binding issue for antimony that @luciansmith fixed. It would help a lot if this could also be fixed in sbml2matlab. Currently, the python bindings to sbml2matlab cannot be used under linux.