I tried to write my own prova2.pyf and this is it:

----------------------------------------------------------------

!    -*- f90 -*-
! Note: the context of this file is case sensitive.

python module prova

interface

  function incr(x)
    real, dimension(2), intent(c) :: incr
    real, dimension(2), intent(c,in) :: x
  end function incr

  function incr0(x)
    integer intent(c) :: incr0
    integer intent(c,in) :: x
  end function incr0

  subroutine incr1(x)
    intent(c) :: incr1
    integer intent(c,in,out) :: x
  end subroutine incr1

end interface

end python module prova

! This file was auto-generated with f2py (version:2_3473).
! See http://cens.ioc.ee/projects/f2py2e/

----------------------------------------------------------------


Unfortunately, only the function incr0 works.
incr1 gives a segmentation fault and incr does not return an array (or
better a struct) as I would...
any hints?

thank you!
L.





On 5/24/07, Pierre GM <[EMAIL PROTECTED]> wrote:

Lorenzo,
you can indeed use f2py to write extensions around some C code:

http://cens.ioc.ee/projects/f2py2e/usersguide/index.html
http://www.scipy.org/Cookbook/f2py_and_NumPy

I think you should also be able to find some actual examples in the scipy
sources...
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to