[SciPy-User] Install Scipy Errors: ImportError: /path_to/liblapack.so: undefined symbol: ztbsv_

Johnny dbigbear at gmail.com
Sun Aug 28 02:16:06 EDT 2011


Hi all,

I am installing lapack, atlas, numpy, scipy on my LINUX for TEN times,
but always encountering the problem:

[work <at> XXX]$ python -c 'import scipy.optimize;
scipy.optimize.test()'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/
scipy/optimize/__init__.py", line 11, in <module>
    from lbfgsb import fmin_l_bfgs_b
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/
scipy/optimize/lbfgsb.py", line 28, in <module>
    import _lbfgsb
ImportError: /home/work/local/lib/liblapack.so: undefined symbol:
ztbsv_

I can pass some other tests like:


[work <at> XXX:~/local]$ python -c 'import scipy.ndimage;
scipy.ndimage.test()'
Running unit tests for scipy.ndimage
NumPy version 1.6.1
NumPy is installed in /home/work/local/python-2.7.1/lib/python2.7/site-
packages/numpy
SciPy version 0.9.0
SciPy is installed in /home/work/local/python-2.7.1/lib/python2.7/site-
packages/scipy
Python version 2.7.1 (r271:86832, Jan 13 2011, 22:17:56) [GCC 3.4.5
20051201 (Red Hat 3.4.5-2)]
nose version 1.1.2
.........S.................................................................................................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 411 tests in 1.247s

OK (SKIP=1)

The problem seems due to the lib of Lapack. So I tried the solutions
posted on the internet before.

1) The liblapack.so may be not complete...SO I tried this:
    # integrate lapack with atlas:
    cd lib/
    mkdir tmp
    cd tmp/
    ar x ../liblapack.a
    cp ~/path_to/lapack-3.1.1/lapack_LINUX.a ../liblapack.a
    ar r ../liblapack.a *.o
    cd ../..
    make check
    make ptcheck
    cp include/* ~/include/
    cp lib/*.a ~/lib/

That is, after installing atlas, there is another liblapack.a (in
addition to the lapack_LINUX.a after Lapack) in its lib, but it is
about 500k, so I integrate it with the lapack_LINUX.a from installing
Lapack. The final liblapack.a is about 9.3m, The liblapack.so is about
5m

2) re-install Lapack and atlas many times....No use

3) I found there is a lapack.so under scipy/lib, and it is about 500K,
but I think it may be not the problem, becaues the failure is
"ImportError: /home/work/local/lib/liblapack.so: undefined symbol:
ztbsv_". Scipy seemed to import liblapack.so in my general lib
directory...

4) One thing  I am not sure is that I used gcc 4.7 and gfortran to
compile lapack and atlas, but my python 2.7 was built using gcc
3.4.5.....Is this a problem?


Anyone can help?
_______________________________________________________________
My configuration of the installation:

* ATLAS 3.8.4
* lapack 3.3.1
* numpy 1.6.1
* SciPy version 0.9.0
* dateutil 1.5
* Python version 2.7.1 (r271:86832, Jan 13 2011, 22:17:56) [GCC 3.4.5
20051201 (Red Hat 3.4.5-2)]
* nose version 1.1.2
* gcc (GCC) 4.7.0 20110820 (experimental)
* LINUX: Linux XXX 2.6.9_5-9-0-0 #1 SMP Wed Jun 23 14:03:19 CST 2010
x86_64 x86_64 x86_64 GNU/Linux

site.cfg of Scipy:

[DEFAULT]
library_dirs = /home/work/local/lib
include_dirs = /home/work/local/include
[lapack_opt]
libraries = lapack, f77blas, cblas, atlas

site.cfg of Numpy:

[DEFAULT]
library_dirs = /home/work/local/lib
include_dirs = /home/work/local/include
[lapack_opt]
libraries = lapack, f77blas, cblas, atlas


In addition, there are failures as well when test Numpy:

>>> import numpy
>>> numpy.test('1')
Running unit tests for numpy
NumPy version 1.6.1
NumPy is installed in /home/work/local/python-2.7.1/lib/python2.7/site-
packages/numpy
Python version 2.7.1 (r271:86832, Jan 13 2011, 22:17:56) [GCC 3.4.5
20051201 (Red Hat 3.4.5-2)]
nose version 1.1.2
======================================================================
FAIL: Test basic arithmetic function errors
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/
numpy/testing/decorators.py", line 215, in knownfailer
    return f(*args, **kwargs)
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/
numpy/core/tests/test_numeric.py", line 367, in
test_floating_exceptions_power
    np.power, ftype(2), ftype(2**fi.nexp))
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/
numpy/core/tests/test_numeric.py", line 271, in assert_raises_fpe
    "Type %s did not raise fpe error '%s'." % (ftype, fpeerr))
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/
numpy/testing/utils.py", line 34, in assert_
    raise AssertionError(msg)
AssertionError: Type <type 'numpy.float64'> did not raise fpe error
'overflow'.

======================================================================
FAIL: Test generic loops.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/
numpy/core/tests/test_ufunc.py", line 86, in test_generic_loops
    assert_almost_equal(fone(x), fone_val, err_msg=msg)
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/
numpy/testing/utils.py", line 448, in assert_almost_equal
    raise AssertionError(msg)
AssertionError:
Arrays are not almost equal to 7 decimals PyUFunc_F_F
 ACTUAL: array([ 0.+0.j,  0.+0.j,  0.+0.j,  0.+0.j,  0.+0.j],
dtype=complex64)
 DESIRED: 1

======================================================================
FAIL: test_umath.TestComplexFunctions.test_loss_of_precision(<type
'numpy.complex64'>,)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/nose/
case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/
numpy/core/tests/test_umath.py", line 931, in check_loss_of_precision
    check(x_basic, 2*eps/1e-3)
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/
numpy/core/tests/test_umath.py", line 901, in check
    'arcsinh')
AssertionError: (0, 0.0010023052, 0.9987238, 'arcsinh')

======================================================================
FAIL: test_umath.TestComplexFunctions.test_precisions_consistent
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/nose/
case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/
numpy/core/tests/test_umath.py", line 812, in
test_precisions_consistent
    assert_almost_equal(fcf, fcd, decimal=6, err_msg='fch-fcd %s'%f)
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/
numpy/testing/utils.py", line 448, in assert_almost_equal
    raise AssertionError(msg)
AssertionError:
Arrays are not almost equal to 6 decimals fch-fcd <ufunc 'arcsin'>
 ACTUAL: 2.3561945j
 DESIRED: (0.66623943249251527+1.0612750619050355j)

======================================================================
FAIL: test_kind.TestKind.test_all
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/nose/
case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/
numpy/f2py/tests/test_kind.py", line 30, in test_all
    'selectedrealkind(%s): expected %r but got %r' %  (i,
selected_real_kind(i), selectedrealkind(i)))
  File "/home/work/local/python-2.7.1/lib/python2.7/site-packages/
numpy/testing/utils.py", line 34, in assert_
    raise AssertionError(msg)
AssertionError: selectedrealkind(19): expected -1 but got 16

----------------------------------------------------------------------
Ran 3552 tests in 29.977s

FAILED (KNOWNFAIL=3, failures=5)
<nose.result.TextTestResult run=3552 errors=0 failures=5>



More information about the SciPy-User mailing list