1

I am having trouble building a working version of Python with ctypes using the Intel Compiler (11.1). The trouble is, that libffi under the ctypes module does not work properly when interfacing with e.g. OpenGL.

Originally, libffi did not compile using the Intel Compilers as __int128_t is not defined, and I followed the work around that has been listed several places, namely by defining a new type:

typedef struct { int64_t m[2]; } __int128_t;

This follows a response as given by Intel : http://software.intel.com/en-us/forums/showthread.php?t=56652

The patch then suggests something like this:

typedef struct { int64_t m[2]; } __int128_t;
//and then change where the uint64_t is assigned to this to be:
sse[x].m[0] = *(uint64_t*) v;
sse[x].m[1] = 0;
//and where the uint32_t is assigned to:
sse[x].m[0] = *(uint32_t*) v;
sse[x].m[1] = 0;

Applying the patch, things compile, and ctypes becomes available for import, however, when interfacing with OpenGL, things do not work. Running PyQt's example program hellogl.py results in a blank view.

Is there a better, working way of doing this?

Dan;

Dan
  • 1,258
  • 1
  • 10
  • 22
  • It has been discussed as a Python bug : http://bugs.python.org/issue4130 – Dan Aug 17 '10 at 08:35
  • It can also be said that compiling Python (and libffi) with GCC works - but I'm interested in a full Intel solution. In the worst case, I will resort to having libffi be GCC-compiled only. – Dan Aug 17 '10 at 08:37

1 Answers1

3

I am the author of libffi. I recommend sending a note to libffi-discuss@sourceware.org containing all of this detail. I also recommend running the libffi testsuite on an intel-compiler built libffi. Make sure you send the results to libffi-discuss@sourceware.org and we can help figure out the problem.

Anthony Green
  • 643
  • 1
  • 4
  • 9
  • Hi Anthony - I've just seen your response now. We have gone away from using the Intel compiler (for other reasons), but appreciate your offer. If we take the Intel compiler up again, the Python version we'll compile will likely have changed (among many other things) - and we can take if from there, if that's ok. – Dan Feb 23 '11 at 22:17