I need to wrap a simply fortran90 code with f2py. The fortran module "test.f90" is
module util
contains
FUNCTION gasdev(idum)
implicit none
INTEGER(kind=4), intent(inout) :: idum
REAL(kind=8) :: gasdev, ran2
print*,idum
gasdev = ran2(idum)
return
END FUNCTION
FUNCTION ran2(idum)
implicit none
INTEGER(kind=4), intent(inout) :: idum
REAL(kind=8) :: ran2
print*,idum
ran2=2.D0
return
END FUNCTION
end module util
and then I wrap it with
f2py -m test -c test.f90
but when I import it in python
In [2]: import test
it prompted me with error saying
ImportError: ./test.so: undefined symbol: ran2_
Any ideas on how to fix it? Thanks.