[SciPy-user] BLAS and srotgm

Donna Calhoun calhoun@amath.washington....
Fri Sep 14 05:55:14 CDT 2007


Robert Kern <robert.kern <at> gmail.com> writes:

----------------------------------------------------------------------------
>> .............(lots cut out here)..........................

> >> line 14, in <module>
> >>      from scipy.linalg import fblas
> >> ImportError: 
> >> /usr/local/Python-2.5-with_tk/lib/python2.5/site-packages/scipy/linalg/
> > fblas.so: 
> >> undefined symbol: srotmg_
> >> ----------------------------------------------------------------------------

 
> Can you give us the contents of your site.cfg, the locations of all of the
> libblas's on your system, the output from your build, and the g77 command that
> worked? That might help us to explain the problem at least, if not fix it.
> 

Yes, here is the short answer to your question.  Here is the offending g77
command : 

# Original command :

long_dir  = build/temp.linux-i686-2.5/build/src.linux-i686-2.5

g77 -shared -L/usr/lib -lutil -lc -lpthread -L/usr/local/tk/lib -ltk8.4
-L/usr/local/tcl/lib -ltcl8.4
$long_dir/build/src.linux-i686-2.5/Lib/lib/blas/fblasmodule.o
$long_dir/fortranobject.o
$long_dir/Lib/lib/blas/fblaswrap.o
$long_dir/build/src.linux-i686-2.5/Lib/lib/blas/fblas-f2pywrappers.o
-L/usr/local/lapack-3.1.1 -L/usr/local/Python-2.5-with_tk/lib
-L/usr/local/Python-2.5-with_tk/lib/python2.5/lib-dynload
-Lbuild/temp.linux-i686-2.5 -lblas -lblas -lpython2.5 -lz -lg2c -o
build/lib.linux-i686-2.5/scipy/lib/blas/fblas.so

I have several 'libblas' on my system (and most of them are old)

/usr/lib/libblas.a
/usr/lib/libblas.so
/usr/lib/libblas.so.3
/usr/lib/libblas.so.3.0
/usr/lib/libblas.so.3.0.3
/usr/local/lapack-3.1.1/libblas.a
/usr/local/lapack-3.1.1/libblas.so

and the scipy build found the first one.  This is first in the g77 command, and
so g77 quit looking for any other libraries.  That library didn't have 
'srotmg' in it.    (As to WHY I had libc, etc in my link path, that will have
to wait for a longer post!)  

I removed the library flags to libc, and libutil and the build picked up the
correct blas library. 

My site.cfg file was (I believe, although I don't have exactly the one I used) 
was 

    [DEFAULT]
    library_dirs = /usr/local/Python-2.5/lib
    libraries = python2.5

    [fftw3]
    include_dirs = /usr/local/fftw-3.1.2/include
    library_dirs = /usr/local/fftw-3.1.2/lib
    libraries = fftw3

    [blas]
    library_dirs = /usr/local/lapack-3.1.1
    libraries = blas

    [lapack]
    library_dirs = /usr/local/lapack-3.1.1
    libraries = lapack


scipy found the libraries : 

      lapack_info:
        FOUND:
          libraries = ['lapack', 'lapack']
          library_dirs = ['/usr/local/lapack-3.1.1']
          language = f77

       blas_info:
         FOUND:
           libraries = ['blas', 'blas']
           library_dirs = ['/usr/local/lapack-3.1.1']
           language = f77


but they just ended up in the wrong place in the g77 command. 

Thanks again for your help, 

Donna



































More information about the SciPy-user mailing list