[SciPy-user] undefined symbols when trying to import packages with linalg

Barry Olddog oldcanine at yahoo.com
Sun Oct 5 11:19:25 EDT 2008


----- Original Message ----

> From: Robert Kern <robert.kern at gmail.com>
> To: SciPy Users List <scipy-user at scipy.org>
> Sent: Saturday, October 4, 2008 7:34:38 PM
> Subject: Re: [SciPy-user] undefined symbols when trying to import packages with linalg
> 
> On Sat, Oct 4, 2008 at 06:56, Barry Olddog wrote:
> > I've been struggling with building scipy into python2.5 for a couple
> > days on a new Centos 5.2, 64-bit machine. I finally got everything
> > built. At first I installed the blas and lapack packages, and then
> > numpy, which seems ok, and finally scipy.
> >
> > The first problem
> > was getting scipy to find the blas and lapack libraries, and then
> > various build errors. I removed the packages, and built Atlas myself
> > with lapack. Now scipy builds, and importing just scipy alone is ok,
> > but it balks at importing some of the packages, including stats,
> > linalg, optimize. Here's the complete import error:
> >
> >>>> import scipy.stats
> > Traceback (most recent call last):
> >  File "", line 1, in 
> >  File "/usr/local/lib/python2.5/site-packages/scipy/stats/__init__.py", line 
> 7,
> > in 
> >    from stats import *
> >  File "/usr/local/lib/python2.5/site-packages/scipy/stats/stats.py", line 192,
> > in 
> >    import scipy.linalg as linalg
> >  File "/usr/local/lib/python2.5/site-packages/scipy/linalg/__init__.py", line 
> 8
> > , in 
> >    from basic import *
> >  File "/usr/local/lib/python2.5/site-packages/scipy/linalg/basic.py", line 17,
> > in 
> >    from lapack import get_lapack_funcs
> >  File "/usr/local/lib/python2.5/site-packages/scipy/linalg/lapack.py", line 
> 17,
> > in 
> >    from scipy.linalg import flapack
> > ImportError: /usr/local/lib/python2.5/site-packages/scipy/linalg/flapack.so: 
> und
> > efined symbol: _gfortran_st_write_done
> >
> > I
> > had thought that I was using g77 consistently. Earlier, I was able to
> > find references to conflicts betwen g77 and gfortran, which is why I
> > built my own atlas, etc. So the _gfortran_st_write_done error seems odd.
> >
> > Any
> > suggestions?
> 
> Use ldd on scipy/linalg/flapack.so to see what shared libraries it is
> trying to link with. It should also show you exactly which .so files
> it manages to find for the given library. You will probably see that
> scipy/linalg/flapack.so is looking for libgfortran but not finding it.
> If not, then keep using ldd on the found shared libraries until you
> find the culprit. That is the library that was accidentally built with
> gfortran.
> 
> If it's scipy/linalg/flapack.so, then look over your build log again
> (and rebuild if necessary). Look near the beginning where
> numpy.distutils is telling you what Fortran compilers it is finding.
> 
> -- 
> Robert Kern
> 

Thanks for the reply. It pointed me to a way out. I tried to track down the reference with ldd but never did. But I had compiled the full lapack library as a static library, and my only guess is that somewhere in there was the offending symbol. The config in lapack seemed to me to be clear about g77, but I took a drastic measure and solved the problem.

It may be inelegant, but I moved gfortran out of /usr/bin, leaving g77 as the only choice, and then rebuilt everything -- lapack with blas, atlas and finally scipy

Barry


      




More information about the SciPy-User mailing list