[SciPy-user] lapack unresolved symbol question

Robert Kern robert.kern@gmail....
Tue Oct 16 15:29:32 CDT 2007

Karl Young wrote:
>  From googling around a bit it looks like I'm having an unresolved 
> symbol problem that was apparently typical at one point but also 
> apparently solved. But I can't quite pinpoint the fix so I figured I'd 
> check re. easy fixes before rebuilding libraries and the like.
> The issues seems to be that the symbol clapack_sgesv is missing from 
> /usr/lib/python2.4/site-packages/scipy/linalg/clapack.so
> - apparently confirmed via nm, i.e.
> nm /usr/lib/python2.4/site-packages/scipy/linalg/clapack.so | grep 
> clapack_sgesv
>                U clapack_sgesv
> 00012640 d doc_f2py_rout_clapack_sgesv
> 000094c0 t f2py_rout_clapack_sgesv

It would be good to know how you built scipy and whether you built against ATLAS
or not. Most likely, scipy got built against an ATLAS-accelerated LAPACK library
(which has the clapack_* symbols), but the LAPACK shared library that's getting
picked up at runtime does not have the accelerated LAPACK functions.

Check what shared libraries this extension module was built with using ldd(1):

[~]$ ldd $PYLIB/scipy-0.7.0.dev3435-py2.5-linux-x86_64.egg/scipy/linalg/clapack.so
        liblapack.so.3 => /usr/lib/atlas/liblapack.so.3 (0x00002aad3362f000)
        libf77blas.so.3 => /usr/lib/libf77blas.so.3 (0x00002aad33f87000)
        libcblas.so.3 => /usr/lib/libcblas.so.3 (0x00002aad348af000)
        libatlas.so.3 => /usr/lib/libatlas.so.3 (0x00002aad351d4000)
        libgfortran.so.1 => /usr/lib/libgfortran.so.1 (0x00002aad35b3b000)
        libm.so.6 => /lib/libm.so.6 (0x00002aad35dd6000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00002aad36058000)
        libc.so.6 => /lib/libc.so.6 (0x00002aad36266000)
        libblas.so.3 => /usr/lib/atlas/libblas.so.3 (0x00002aad365b8000)
        libg2c.so.0 => /usr/lib/libg2c.so.0 (0x00002aad36f56000)
        /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)

Check whichever liblapack library you have for the clapack_sgesv symbol. The .so
is often stripped of symbols, but if you have a liblapack.a file that goes with
it, you can check that, instead:

[~]$ nm /usr/lib/atlas/liblapack.so.3 | grep clapack_sgesv
nm: /usr/lib/atlas/liblapack.so.3: no symbols
[~]$ nm /usr/lib/atlas/liblapack.a | grep clapack_sgesv
0000000000000000 T clapack_sgesv

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

More information about the SciPy-user mailing list