[SciPy-User] Correctly compiling SciPy with UMFPACK support?

Ioan-Alexandru Lazar alexlz@lmn.pub...
Sun Aug 29 00:42:16 CDT 2010


Hello everyone,

A while ago I posted a problem I had -- namely both the scipy and the
scikits UMFPACK interface failing to work when I was trying to compile
them by hand with UMFPACK also being compiled by hand. A couple of
friendly folks over here gave me a hand but even with their advice, I
wasn't able to do much.

I postponed it for a while (it wasn't really urgent -- now it is, but it's
also solved), so I though I'd post here just in case someone bumps against
the same issue.

There are two problems, one that is mentioned in most instructions and one
that seems not to be, namely:

1. When building, SciPy (and the Scikits umfpack kit) both assume that
UFconfig.h is also in the include directory -- so umfpack and amd's won't
suffice.

2. The umfpack interface module needs the shared umfpack and amd
libraries. However, SuiteSparse does *not* compile them as such; as many C
programs actually expect to end up being statically linked with
SuiteSparse's library, it's not such a good idea to tweak UFconfig.mk so
as to build them all as shared libraries. It's best to manually compile
AMD and UMFPACK as shared libraries (with gcc -shared -Wl and remembering
to link the math library and whatever blas you're using with umfpack) and
place them in the libraries folder defined in site.cfg, and add that path
to LD_LIBRARY_PATH.

I hope this helps. I hope I haven't made an ass of myself by not reading
the docs correctly -- in any case, I haven't seen it mentioned at
http://http://www.scipy.org/Installing_SciPy/Linux

--- Slightly less interesting section following ---

By the way -- I think I could have figured this out slightly faster; when
I looked at it again, I only needed a morning of quick hacking. The
culprit was actually here:

try: # Silence import error.
    import _umfpack as _um
except:
    _um = None

(
http://svn.scipy.org/svn/scikits/trunk/umfpack/scikits/umfpack/umfpack.py
, but this is how it currently looks in SciPy as well)

Unfortunately, the error message that appears when _um = None is simply
that SciPy was compiled with umfpack support in scipy, or that the symbol
UMFPACK_CONTROL is undefined. However, this can be misleading -- in my
particular case, the import error initially pointed to a symbol in cholmod
(!) not being defined, and after sume further digging, to umfpack.so
simply not being found.

The deadline for the paper I'm working on is in about three weeks and I'm
kind of entagled right now (you know how academics is...) but as soon as
I'm done with it, I'll try to provide a fix for this (a more particular
error message) and update the docs if anyone else thinks this is useful.
Since direct umfpack support is going to be deprecated in SciPy, I assume
I should do this in the scikits version, right?

Thank you all for your help and your time.

Alexandru Lazar

Numerical Modeling Laboratory, Politehnica University of Bucharest


More information about the SciPy-User mailing list