Hi Thomas

I made some progress on this in the last hour or so:

1. sys.platform is still "win32", even for 64 bit Python.

2. The sys.maxint check does not work on Windows - it returns the 32 bit max, even though I am definitely using Python 2.6 64bit. I have found other references to this on some messageboards. The suggested way to work around this is to check the 1st value returned by "platform.architecture()", which returns ('64bit', 'WindowsPE').

3. To link with the 64bit versions of the OCC libs, I made this change:
    if sys.platform=='win32':
        OCC_LIB = os.path.join(OCC_ROOT,'win%d'%bits,'lib')

4. I added the 64 bit flags, as you also suggested in your email:
    if bits==64:
        DEFINE_MACROS.append(('_OCC64',None))
        SWIG_OPTS.append('-D_OCC64')

However, I currently get this error:

C:\Python\pythonocc-0.5\src\wrapper\Visualization\Visualization.i(25) : Error: Unable to find '..\1\ExceptionCatcher.i'
error: command 'swig.exe' failed with exit status 1

Any idea where this could stem from?

- Frank

On 18/08/2011 12:12 PM, Thomas Paviot wrote:
2011/8/18 Frank Conradie <fr...@qfin.net <mailto:fr...@qfin.net>>

    I am wondering if anyone has tried to build pythonocc for 64bit
    Python on Win64? Looking at environment.py. there is no special
    case code for 64 bit builds on Windows yet, although there is for
    Linux and MacOS.

    - Frank


Hi Frank,

There's not any Win64 specific code because I did not have the opportunity to have a Win64 machine to test pythonocc with this platform. However I do think that the 64bit code for linux/darwin could be used as is for Win64.

The script environment.py first detects whether or not python is 64 bit (by querying sys.maxint). After that, according to the result (32 or 64bit), environment.py decides to set -D_OCC64 as a compiler define. That's all. If you just append ('_OCC64',None) to the DEFINE_MACROS list, you should have pythonocc compiled properly under Win64.

Just a question: under Win32, sys.platform returns the 'win32' string. Is 'win64' returned under win64?

I will create a branch named tp/win64-support (don't know if you're familiar with git). I will notify you when it's done so that you can test building pythonocc from github (https://github.com/tpaviot/pythonocc). I don't know if there are speficic things to be aware of when dealing with python and windows in 64 bit mode, feel free to send any suggestion.

Best Regards,

Thomas



_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users
_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to