[Ironpython-users] IronPython always in 32-bit mode on 64bit machine even when running ipy64.exe

Markus Schaber m.schaber at codesys.com
Wed May 8 11:55:17 CEST 2013


Hi,

Just as a side note:

It seems that sys.float_info.min and epsilon are not correct in IronPython.

Activestate Python 2.7.2:
>>> sys.float_info.min
2.2250738585072014e-308
>>> sys.float_info.epsilon
2.220446049250313e-16

IronPython 2.7.3:
>>> sys.float_info.min
-1.7976931348623157e+308
>>> sys.float_info.epsilon
4.9406564584124654e-324

The python documentation says:
min

DBL_MIN

minimum positive normalized float

epsilon

DBL_EPSILON

difference between 1 and the least value greater than 1 that is representable as a float


For epsilon, it might be different in .NET compared to C, but the given value is rather optimistic given that the mantissa only has 15 digits / 53 bits. :)

So, it seems both values are incorrect for IronPython.


Best regards

Markus Schaber

CODESYS(r) a trademark of 3S-Smart Software Solutions GmbH

Inspiring Automation Solutions
________________________________
3S-Smart Software Solutions GmbH
Dipl.-Inf. Markus Schaber | Product Development Core Technology
Memminger Str. 151 | 87439 Kempten | Germany
Tel. +49-831-54031-979 | Fax +49-831-54031-50

E-Mail: m.schaber at codesys.com<mailto:m.schaber at codesys.com> | Web: codesys.com<http://www.codesys.com> | CODESYS store: store.codesys.com<http://store.codesys.com>
CODESYS forum: forum.codesys.com<http://forum.codesys.com>

Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915
Von: Ironpython-users [mailto:ironpython-users-bounces+m.schaber=codesys.com at python.org] Im Auftrag von Vernon D. Cole
Gesendet: Mittwoch, 8. Mai 2013 11:20
An: Chong, Petra (HARVEY NASH)
Cc: ironpython-users at python.org
Betreff: Re: [Ironpython-users] IronPython always in 32-bit mode on 64bit machine even when running ipy64.exe

I find that the following works (on all versions I have tested, including Jython):

import sys
def Python_is_64bit():
    if sys.platform == 'cli': #IronPython
        import System
        return System.IntPtr.Size == 8
    else:
        try:
            return sys.maxsize > 2147483647
        except AttributeError:
            return sys.maxint > 2147483647

--
Vernon Cole

On Wed, May 8, 2013 at 8:14 AM, Chong, Petra (HARVEY NASH) <Petra.Chong at uk.bp.com<mailto:Petra.Chong at uk.bp.com>> wrote:
I do indeed get output that looks like yours -

c:\Program Files (x86)\IronPython 2.7>c:\users\xxxxx\Downloads\corflags.exe ipy64.exe
Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  2.0.50727.42
Copyright (c) Microsoft Corporation.  All rights reserved.

Version   : v4.0.30319
CLR Header: 2.5
PE        : PE32
CorFlags  : 9
ILONLY    : 1
32BIT     : 0
Signed    : 1

And if I then run this:

c:\Program Files (x86)\IronPython 2.7>c:\users\xxxxx\Downloads\corflags.exe ipy.exe
Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  2.0.50727.42
Copyright (c) Microsoft Corporation.  All rights reserved.

Version   : v4.0.30319
CLR Header: 2.5
PE        : PE32
CorFlags  : 11
ILONLY    : 1
32BIT     : 1
Signed    : 1

Thanks,

PC


From: Curt Hagenlocher [mailto:curt at hagenlocher.org<mailto:curt at hagenlocher.org>]
Sent: 07 May 2013 17:46
To: Chong, Petra (HARVEY NASH)
Cc: ironpython-users at python.org<mailto:ironpython-users at python.org>
Subject: Re: [Ironpython-users] IronPython always in 32-bit mode on 64bit machine even when running ipy64.exe

Can you use corflags.exe to confirm that your ipy64.exe is actually not marked for 32-bit execution? Your output should look like this:

PS D:\Program Files\Sho\bin> corflags .\ipy64.exe
Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  3.5.30729.1
Copyright (c) Microsoft Corporation.  All rights reserved.
Version   : v2.0.50727
CLR Header: 2.5
PE        : PE32
CorFlags  : 9
ILONLY    : 1
32BIT     : 0
Signed    : 1


On Tue, May 7, 2013 at 9:34 AM, Chong, Petra (HARVEY NASH) <Petra.Chong at uk.bp.com<mailto:Petra.Chong at uk.bp.com>> wrote:
(I also asked this on StackOverflow - http://stackoverflow.com/questions/16422812/ironpython-always-in-32-bit-mode-on-64bit-machine-even-when-running-ipy64-exe - have copy pasted from there).



I am sure I am missing something simple but unfortunately a lot of searching hasn't thrown up what it is..

I am running Windows 7 64-bit (I verified this by looking at Control Panel > All Control Panel Items > System and seeing that it says 64-bit Operating System).

I have IronPython 2.7.3 installed from here (http://ironpython.codeplex.com/downloads/get/423690)

This has created the following shortcut (with no corresponding shortcut in C:\Program Files\IronPython 2.7...):

"C:\Program Files (x86)\IronPython 2.7\ipy64.exe"

If I run this, I get this prompt:





"c:\Projects>"C:\Program Files (x86)\IronPython 2.7\ipy64.exe"

IronPython 2.7.3 (2.7.0.40) on .NET 4.0.30319.296 (32-bit)

The docs from an older version of IronPython (2.6) athttp://ironpython.codeplex.com/releases/view/27350 say that:

"A very visible new feature added to this release is that ipy.exe is now strictly a 32-bit only assembly. That is, it gets executed as a 32-bit CLR process on both x86 and x64 operating systems. ipy64.exe, despite what its name might imply, is a platform agnostic assembly matching the old behavior of ipy.exe in the sense that it gets executed as a 32-bit process on 32-bit OSes and 64-bit on 64-bit OSes."

>From this, I infer that ipy64 should have started as a 64 bit process, but that's not what shows in the prompt.

Any ideas what I am doing wrong? Thanks in advance..

Edited to add: I have also tried running the following in the IronPython shell, which I found from another question on this site, to check whether the OS is 64 bit

>>> import System

>>> System.Environment.Is64BitOperatingSystem

True

... but then I ran the following which indicates that IronPython really is running in 32 bit mode.

>>> import System

>>> System.IntPtr.Size

4


I have tested that I have 64-bit .NET installed by creating a console application in Visual Studio with the line Console.WriteLn(System.IntPtr.Size) and verifying that the output is "8".

Thanks,

PC

_______________________________________________
Ironpython-users mailing list
Ironpython-users at python.org<mailto:Ironpython-users at python.org>
http://mail.python.org/mailman/listinfo/ironpython-users


_______________________________________________
Ironpython-users mailing list
Ironpython-users at python.org<mailto:Ironpython-users at python.org>
http://mail.python.org/mailman/listinfo/ironpython-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20130508/fdf578be/attachment.html>


More information about the Ironpython-users mailing list