[SciPy-User] Undefined symbols in _flinalg.so
Norm Wood
nbwood at lamar.colostate.edu
Tue Aug 3 19:48:42 EDT 2010
Hi,
I'd run into a problem with determinants last October while trying to
use the kernel density estimation package in (at that time) SciPy 0.7.0
and 0.7.1. In scipy/linalg/basic.py, the determinant code has the
lines:
fdet, = get_flinalg_funcs(('det',),(a1,))
a_det,info = fdet(a1,overwrite_a=overwrite_a)
and the second line was producing a TypeError:
TypeError: 'NoneType' object is not callable
I never resolved this with SciPy 0.7, but I've managed to dig further
while trying to install 0.8.0.
get_flinalg_funcs() is in sciyp/linalg/flinalg.py. The problem is
occurring when flinalg.py tries to import _flinalg.so. An ImportError
is raised, causing _flinalg to be set to None, and this in turn causes
get_flinalg_funcs() to return None for fdet.
If I go into my site-packages/scipy/linalg directory, start a python
shell and try to import _flinalg.so, I get:
>>> import _flinalg
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: ./_flinalg.so: undefined symbol: ddet_c_
The routine ddet_c() is in scipy/linalg/src/det.f and appears mainly to
be a wrapper which calls LAPACK's dgetrf to compute the LU factorization,
then computes the determinant.
I'd appreciate any suggestions about where to look further to resolve
this. Running nm on _flinalg.so shows for ddet_c:
U ddet_c_
0000bed0 T ddet_c__
indicating ddet_c_ is undefined. dgetrf_ appears in _flinalg.so, but also has
the symbol type "U" (undefined). Running ldd on _flinalg.so shows that
it is linked to the liblapack.so and libatlas.so that I just built
(Atlas 3.8.0). dgetrf_ shows up as a defined symbol (type "T") in
liblapack.so.
Note that the code for doing determinants in numpy (in
numpy/linalg/linalg.py) also uses dgetrf, but imports it from a
different shared object file, lapack_lite.so, and seems to work fine.
Thanks for any assistance. I've attached below a summary of my system
and build info. It's slightly different from that in my earlier message
(newer numpy and scipy). I've also given a link to that October
thread.
Regards,
Norm
The previous thread:
http://old.nabble.com/scipy.linalg.det-TypeError-td26100345.html
and my current system and build info:
These results are using LAPACK 3.1.1, Atlas 3.8.0, numpy 1.5.0b1, and
SciPy 0.8.0, all built with gcc 3.3.6 and g77. Python is 2.4..1 built
with gcc 3.3.5. I'm running Slackware 10.2 with kernel 2.4.31.
Here's partial output from system_info.py:
ATLAS version 3.8.0 built by norm on Tue Aug 3 13:09:42 MDT 2010:
UNAME : Linux wombat 2.4.31-1 #1 SMP Wed Dec 7 16:52:41 MST 2005 i686 unknown unknown GNU/Linux
INSTFLG : -1 0 -a 1
ARCHDEFS : -DATL_OS_Linux -DATL_ARCH_P4E -DATL_CPUMHZ=3014 -DATL_SSE3 -DATL_SSE2 -DATL_SSE1 -DATL_GAS_x8632
F2CDEFS : -DAdd__ -DF77_INTEGER=int -DStringSunStyle
CACHEEDGE: 1048576
F77 : g77, version GNU Fortran (GCC) 3.3.6
F77FLAGS : -O -fPIC -m32
SMC : gcc, version gcc (GCC) 3.3.6
SMCFLAGS : -fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -fPIC -m32
SKC : gcc, version gcc (GCC) 3.3.6
SKCFLAGS : -fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -fPIC -m32
success!
removing: _configtest.c _configtest.o _configtest
FOUND:
libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas']
library_dirs = ['/home/norm/lusr/atlas/lib']
language = f77
define_macros = [('ATLAS_INFO', '"\\"3.8.0\\""')]
include_dirs = ['/home/norm/lusr/atlas/include']
atlas_blas_info:
libraries f77blas,cblas,atlas not found in /usr/local/lib
FOUND:
libraries = ['f77blas', 'cblas', 'atlas']
library_dirs = ['/home/norm/lusr/atlas/lib']
language = c
include_dirs = ['/home/norm/lusr/atlas/include']
More information about the SciPy-User
mailing list