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

Robert Kern robert.kern@gmail....
Sat Oct 4 18:34:38 CDT 2008

On Sat, Oct 4, 2008 at 06:56, Barry Olddog <oldcanine@yahoo.com> 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 "<stdin>", line 1, in <module>
>  File "/usr/local/lib/python2.5/site-packages/scipy/stats/__init__.py", line 7,
> in <module>
>    from stats import *
>  File "/usr/local/lib/python2.5/site-packages/scipy/stats/stats.py", line 192,
> in <module>
>    import scipy.linalg as linalg
>  File "/usr/local/lib/python2.5/site-packages/scipy/linalg/__init__.py", line 8
> , in <module>
>    from basic import *
>  File "/usr/local/lib/python2.5/site-packages/scipy/linalg/basic.py", line 17,
> in <module>
>    from lapack import get_lapack_funcs
>  File "/usr/local/lib/python2.5/site-packages/scipy/linalg/lapack.py", line 17,
> in <module>
>    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

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

"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