Building 64-bit VPython on MacOS X

Steven Butterworth <bworth-JAjqph6Yjy8fbXvGcxQkLSwD8/[email protected]> Tue, 24 Jul 2012 21:29:26 -0400
Newsgroups gmane.comp.python.visualpython.user
Message-ID <[email protected]>
Greetings Fellow VPython Users,

We are using Python fairly extensively in Physics courses here and so far 
32-bit limitations have not been much of a problem on either Windows or 
MacOS X. However, that seems unlikely to be true in the not very distant 
future (especially given Apple's penchant for forced obsolescence of both 
hardware and software.)

Recently, I have been trying to put together a 64-bit suite of tools for 
the MacOS X users in our student body and the final obstacle is the visual 
module. (Actually VPython was the final obstacle on Windows as well, but 
we were able to take advantage of packages built by Christoph Gohlke at 
http://www.lfd.uci.edu/~gohlke/pythonlibs/#vpython)

It is clear that the "native" port (via Carbon) is impossible because it 
is only 32-bit; so the target is X11 graphics.

I am working on a MacPorts Portfile that now successfully fetches 
visual_5.74_release.tar.bz2, unpacks it, runs configure with flags that 
appear to permit all of the libraries and include files to be found and 
then runs make. While building, I encounter problems in gl_extensions.cpp.

    ./core/util/gl_extensions.cpp: In member function 'void 
cvisual::gl_extensions::init(cvisual::display_kernel&)':
./core/util/gl_extensions.cpp:50: error: invalid conversion from 'void 
(*)(GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, 
GLenum, const GLvoid*)' to 'void (*)(GLenum, GLint, GLenum, GLsizei, 
GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*)'

Truncating signatures we have:
(a)  enum, int, int,  sizei, sizei, int, enum, enum, void*
(b)  enum, int, enum, sizei, sizei, int, enum, enum, void*

So, the third arguments are inconsistent. While I have a substantial 
amount of programming experience, but I am not a developer and I have not 
touched C++ since before it was an ANSI standard; so I am having a devil 
of a time interpreting what I am seeing in the source files.

It appears that the cvisual constructor that takes a display_kernel 
address as an argument is finding that it has received an object that 
doesn't conform with signature expectations. Given that this code must be 
working on other platforms, do we have an enum/int casting incompatibility 
that is exclusive to 64-bit Mac OS X? Perhaps int is an int64 while enum 
is an int32?

Any hints on how to fix this issue would be appreciated.

Thanks.

-- 
Steve Butterworth, Manager   | If you make people think they're thinking,
Physics Computing Services   | they'll love you; but if you really make
McLennan Labs 805            | them think, they'll hate you. -- Don
Phone: 416-978-2746          | Marquis
<bworth-JAjqph6Yjy8fbXvGcxQkLSwD8/[email protected]> |

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/