[chimera-dev] Chimera/Python sparse matrices

Greg Couch gregc at cgl.ucsf.edu
Fri Aug 13 18:12:08 PDT 2010


  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



More information about the Chimera-dev mailing list