Re: [f2py] integers = 2226756?
[email protected] Thu, 24 Mar 2011 19:48:03 +0000
| Newsgroups | gmane.comp.python.f2py.user |
|---|---|
| Message-ID | <[email protected]> |
Try integer*8, intent(in) :: N On , Michael Colonno <mcolonno-FGKo4X94FMn2fBVCVOL8/[email protected]> wrote: > Thanks for the help and strange indeed. After some more research this > appears to be platform dependent. I'm using f2py on Win 7 64-bit (which > seems to be its least favorite platform) with the Intel compiler suite > (12.0) and VS 2010. Using the same compilers on the same system in Linux > (CentOS 5.5) the test module works fine, integers are passed with the > correct value. I did have to do a bit of hacking in the mscv9compiler.py > and intel.py files to get the flags to match up for proper linking, but > none of the flags I tweaked should, as far as I can tell, impact the > passing of basic data types (almost all linker flags). I did switch > the !f2py directive in and out with no effect. My first thought was a > 32-bit / 64-bit setting somewhere in the maze of dependencies between VS > and the Intel compilers on 64-bit platforms but so far no luck. I will > run the test suggested and report results. Thanks, ~Mike C. From: > f2py-users-bounces-Y4l6ocDipWCuvFJfX82//[email protected] [mailto:f2py-users-bounces-Y4l6ocDipWCuvFJfX82//[email protected]] On > Behalf Of [email protected] > Sent: Wednesday, March 23, 2011 11:26 PM > To: For users of the f2py program > Subject: Re: [f2py] integers = 2226756? This is strange. I'm not able to > reproduce it with gfortran=4:4.5.2-2 python-numpy=1:1.4.1-5 in Debian. It > can put in int8-int64 without problems. What compiler are you using? What > version of f2py? It might be worthwhile looking at the automatically > generated C code (what you get running f2py without -c) to see what's > happening. > The "f2py_rout_test_test" in particular would be of interest. > Kevin > On , Michael Colonno mcolonno-FGKo4X94FMn2fBVCVOL8/[email protected]> wrote: > > > > Hi ~ > > > > I have what I hope is a very simple issue with integers. My extremely > simple F90 code: > > > > subroutine test(N) > > > > implicit none > > > > !f2py integer, intent(in) :: N > > integer :: N > > > > print *, "N = ", N > > > > end subroutine > > > > I compile this with F2PY and get in Python: > > > > >>> import test > > >>> test.test(13) > > N = 2226756 > > >>> N = 7 > > >>> test.test(N) > > N = 2226756 > > > > I get the same value for any value I input. If I change the argument N > to a real, I get the correct value. Is there some kind of incompatibility > re: integers from Python? Please let me know if I'm going crazy. > > > > Thanks, > > ~Mike C. > > > > _______________________________________________ f2py-users mailing list f2py-users-Y4l6ocDipWCuvFJfX82//[email protected] http://cens.ioc.ee/mailman/listinfo/f2py-users