[SciPy-user] SciPy builds and installs but won't import due to f2c

Robert Kern robert.kern@gmail....
Wed Jul 23 17:45:23 CDT 2008

On Wed, Jul 23, 2008 at 17:21, Selwyn-Lloyd McPherson
<smcphers@stanford.edu> wrote:
> Unfortunately, scipy doesn't seem to want to build without LAPACK -- I've
> tried lots of different LAPACK distributions. I've tried using ATLAS with
> LAPACK and ATLAS without LAPACK (built LAPACK standalone) with lots of
> different flags but nothing seems to work. I've tried rebuilding the f2c
> libraries but it still comes up with the "undefined symbol" MAIN__ error.
> I've read here that inserting a
> int MAIN__( )
> { return(0);
> }
> in the codebase somewhere might fix the problem but I'm not sure where it
> could go.
> Is there any reason that scipy / lapack needs f2c? Can't it just use f2py?

It doesn't use f2c to convert the Fortran code to C. However, some
Fortran compilers use libf2c as a runtime library. Without more
details about how you built things, I don't really know why you are
having linking problems. One thing to consider is that using the
environment variable LDFLAGS replaces all link flags when building
Fortran extension modules. So if you are using $LDFLAGS, then you may
have removed important link flags.

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