Re: [chimera-dev] Chimera/Python sparse matrices

On 8/13/2010 12:06 PM, Forbes J. Burkowski wrote:
What are the steps that need to be taken if the Python used in Chimera is to have the ability to import functions from SciPy or PySparse?
Thanks for any advice that you can provide.
Cheers, Forbes Burkowski
If you want to use prebuilt SciPy binaries with chimera, you need one that is compatible with the version of chimera that chimera is using. Chimera 1.4.x uses Python 2.5, and the daily builds use Python 2.7. You would add those packages to chimera by either (1) given the '--pypath dir' command line option, (2) setting your CHIMERAPTH environment variable (instead of PYTHONPATH, PYTHONPATH is ignored so chimera won't be accidentally broken by other installed Pythons), or (3) add the installation directory to sys.path in Python. If you're not using a daily build on Linux, then you should edit CHIMERA/share/chimeraInit.py and comment out or remove the part that sets the RTLD_GLOBAL flag -- it appears to be no longer needed and its presence breaks SciPy. If you're going to compile from source, which you'll need to do if you're using a daily build, I'd recommend trying PySparse first, since it is a smaller package. Python packages that incorporate C (or C++ or Fortran) code are more difficult than prebuilt binaries because (a) you need a compiler, and (b) if the code calls the Python C API, you need a compatible compiler, ideally the same one as what the rest of Chimera was build with. PySparse needs BLAS and LAPACK libraries and optionally wants UMFPACK and/or SuperLU. On on Redhat and Fedora Linux, you can get the first three libraries by installing the blas-devel, lapack-devel, and suitesparse-devel packages. Chances are you'll be able to install PySparse into chimera's python by running "CHIMERA/bin/pythonXXX setup.py install" in the pysparse source tree (where CHIMERA is the path to where chimera was installed). On Linux, you might have to set the LD_LIBRARY_PATH environment variable to CHIMERA/lib. On Mac OS X, the path to the chimera binary is CHIMERA/Contents/Resources/bin/pythonXXX and the environment variable is DYLD_LIBRARY_PATH. Or you could install PySparse into another Python and use the --pypath/CHIMERAPATH/sys.path approach as given above. Hope this helps, Greg

Hello, I want to use scipy with Chimera because the QR factorization in numpy does not give a square Q matrix. However, Chimera does not allow scipy to be imported. The only discussion of scipy I see is a post where you talk about prebuilding Scipy. These instructions are not helpful as I do not know where to set these variables. Can you provide me some more detailed instructions on how to use scipy with Chimera. I am using Ubuntu linux. Best, XBL

Here is how to install a Python package for use with Chimera is described in mailing list message http://www.cgl.ucsf.edu/pipermail/chimera-dev/2013/000914.html Since Chimera includes its own Python to ensure version compatibility with the dozens of compiled Python modules it uses, you need to install Scipy into the Chimera Python. This means you can't install a binary distribution with "sudo apt-get …". Instead you need to get the Scipy source code and build it specifically for the Chimera version of Python. This is a pain. I have not tried installing Scipy in Chimera so I don't know how many problems you will encounter. Tom On Dec 3, 2013, at 8:08 AM, Xiao-Bo Li <x22li@cs.uwaterloo.ca> wrote:
Hello,
I want to use scipy with Chimera because the QR factorization in numpy does not give a square Q matrix.
However, Chimera does not allow scipy to be imported. The only discussion of scipy I see is a post where you talk about prebuilding Scipy. These instructions are not helpful as I do not know where to set these variables. Can you provide me some more detailed instructions on how to use scipy with Chimera.
I am using Ubuntu linux.
Best,
XBL _______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev

hi xbl, i've a running version of chimera built from the chimera svn source with scipy 0.13.1 included in ../foreign/scipy. unfortunatly this build only runs on scientific linux 6.4 because of (my builds?) library incompabilities with ubuntu. e.g. when starting my distribution version on ubuntu (i cannot install development stuff on this server) from numpy.linalg import lapack_lite ImportError: liblapack.so.3: cannot open shared object file: No such file or directory this is the main problem since scipy depends on numpy and numpy can be compiled with various different optimizing libraries e.g. blas, atlas, ... (.numpy-site.cfg?). in addition scipy has a lot of native code (e.g. fortran). i'm not aware how this will be handled by the chimera python installer as in the previous message. so if you have a sl6.4, i can build you an installable version with scipy. or if you have a developer at hand, i can give you the source patches to the current chimera svn version to build your own chimera distribution. fyi: the following files have to be patched mk/foreign.make foreign/GNUmakefile new files: foreign/scipy/GNUmakefile foreign/scipy/scipy-0.13.1.tar.gz (original download from the scipy website) cheers, wolfgang On 12/04/2013 03:57 AM, Tom Goddard wrote:
Here is how to install a Python package for use with Chimera is described in mailing list message
http://www.cgl.ucsf.edu/pipermail/chimera-dev/2013/000914.html
Since Chimera includes its own Python to ensure version compatibility with the dozens of compiled Python modules it uses, you need to install Scipy into the Chimera Python. This means you can't install a binary distribution with "sudo apt-get …". Instead you need to get the Scipy source code and build it specifically for the Chimera version of Python. This is a pain. I have not tried installing Scipy in Chimera so I don't know how many problems you will encounter.
Tom
On Dec 3, 2013, at 8:08 AM, Xiao-Bo Li <x22li@cs.uwaterloo.ca> wrote:
Hello,
I want to use scipy with Chimera because the QR factorization in numpy does not give a square Q matrix.
However, Chimera does not allow scipy to be imported. The only discussion of scipy I see is a post where you talk about prebuilding Scipy. These instructions are not helpful as I do not know where to set these variables. Can you provide me some more detailed instructions on how to use scipy with Chimera.
I am using Ubuntu linux.
Best,
XBL _______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev
-- Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Christian Gerloff (Vertreter des Vorsitzenden), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING
participants (4)
-
Greg Couch
-
Tom Goddard
-
Wolfgang Lugmayr
-
Xiao-Bo Li