[Numpy-discussion] numpy.distutils/f2py: forcing 8-bit reals

David Warde-Farley dwf@cs.toronto....
Tue Mar 30 15:35:32 CDT 2010


On 30-Mar-10, at 5:02 AM, Dag Sverre Seljebotn wrote:

> Well, you can pass -fdefault-real-8 and then write .pyf headers where
> real(8) is always given explicitly.

Okay, the answer (without setting the F77 environment variable) is  
basically to expect real-8's in the .pyf file and compile the whole  
package with

python setup.py config_fc --fcompiler=gnu95 --f77flags='-fdefault- 
real-8' --f90flags='-fdefault-real-8' build

Still not sure if there's a sane way to make this the default in my  
setup.py (I found some old mailing list posts where Pearu suggests  
modifying sys.argv but I think this is widely considered a bad idea).  
The right way might involve instantiating a GnuF95Compiler object and  
messing with its fields or something like that. Anyway, this works for  
now.

Thanks,

David


More information about the NumPy-Discussion mailing list