[SciPy-dev] Absoft & Scipy

Pearu Peterson pearu at scipy.org
Thu Feb 3 06:01:10 CST 2005



On Wed, 2 Feb 2005, Stephen Walton wrote:

> Stephen Walton wrote:
>
>> In [1]: linalg.eigvals(rand(5,5))
>> exceptions.ImportError: 
>> /usr/lib/python2.3/site-packages/scipy/linalg/_flinalg.so: undefined 
>> symbol: ddet_c_
>
> Found a clue, but not the cause:  when specifying the Absoft compiler, f2py 
> is building _flinalgmodule.c in such a way that the external symbol ends in 
> only one underscore (ddet_c_ instead of ddet_c__).  The history here is that, 
> in a dumb design decision, g77 puts *two* underscores at the end of external 
> names which have an embedded underscore, and recent versions of Absoft, with 
> the appropriate compiler switch, emulate this behavior;  older versions did 
> not.  I have F2PY version 2.45.241_1926 installed if that's important.

f2py assumes that all fortran symbols have exactly one underscore at the 
end of external names. Therefore, scipy_distutils envokes gcc with
-fno-second-underscore option. Compilers of other vendors have similar
options and they are used by scipy_distutils. So, check Absoft compiler
manual if it provides options that forces external names to be appended 
with exactly *one* underscore, and try to modify 
scipy_distutils/absoftfcompiler.py accordingly.

If Absoft compiler does not have nor will in future such a switch then
another solution would be to introduce -DSECOND_UNDERSCORE_FORTRAN
support to f2py so that such compilers as Absoft could be fully supported.
But try first method first.

Pearu




More information about the Scipy-dev mailing list