On 18/11/14 23:10, Pauli Virtanen wrote:

> The second question is whether F2py actually *needs* to check the
> dtype-size alignment, or is just something like sizeof(double) enough
> for Fortran compilers.


The Fortran standard does not specify an ABI so this is likely compiler 
dependent.

The only safe way of calling Fortran from C is through a proxy Fortran 
routine exported to C using Fortran 2003 ISO C bindings. That is what 
f2py should do behind the scenes now that the Fortran 77 limitation is 
lifted from SciPy.

With this method we can just pass an arbitrary C pointer to Fortran and 
construct a Fortran array pointer with c_f_function. The Fortran 
compiler will make an aligned copy of the array referenced by the 
pointer if required. No special coding will be required to ensure 
correct alignment.


Sturla

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to