Pyrex on Win7-64

Lynn Oliver <[email protected]> Sun, 8 Apr 2012 16:01:59 -0700
Newsgroups gmane.comp.python.pyrex
Message-ID <[email protected]>
--===============0905731587==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_01771F38-84CB-42B8-BC77-45DF382E6E65"


--Apple-Mail=_01771F38-84CB-42B8-BC77-45DF382E6E65
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

I'm using Pyrex to build PyPortMidi.  I was able to get it to work on OS =
X 10.7.3; on win32 (Windows XP) I didn't manage to get Pyrex to work, =
but I was able to get the PyPortMidi library built by copying in the =
output (pypm.c) from OS X.  That didn't work on win64 (Windows 7).

Working on win64, I tried two different ways to install Pyrex-0.9.9:=20
Downloaded Pyrex-0.9.9.win32.exe and ran it.
Downloaded Pyrex-0.9.9.zip, unpacked it and ran "python setup.py =
install" =20
With either installation, when I try to build PyPortMidi I get the same =
error:

pyrexc pypm.pyx --> pypm.c
C:\Users\Lynn Oliver\Desktop\pyPortMidi\pypm.pyx:357:21: Type 'PmError' =
not acceptable as a boolean
building 'pypm' extension
C:\Python27\Scripts\gcc.exe -mno-cygwin -mdll -O -Wall -DMS_WIN64 =
-IC:\Python27\include -IC:\Python27\PC -c pypm.c -o bu
ild\temp.win-amd64-2.7\Release\pypm.o
pypm.c:1:2: error: #error Do not use this file, it is the result of a =
failed Pyrex compilation.
error: command 'gcc' failed with exit status 1

This error didn't occur on OS X.  I'm not a C  programmer so it's not =
clear to me what caused the error; here is the declaration for PmError: =20=


    ctypedef enum PmError:
        pmNoError =3D 0,
        pmHostError =3D -10000,
        pmInvalidDeviceId, #/* out of range or output device when input =
is requested or vice versa */
        pmInsufficientMemory,
        pmBufferTooSmall,
        pmBufferOverflow,
        pmBadPtr,
        pmBadData, #/* illegal midi data, e.g. missing EOX */
        pmInternalError,
        pmBufferMaxSize, #/* buffer is already as large as it can be */

And here is the section of code where the error was flagged, I think...:

        cdef PmEvent buffer[1]
        cdef PmError err
       =20
        Pm_SetFilter(self.midi, filters)
        if err < 0: raise Exception, Pm_GetErrorText(err)
 357    while(Pm_Poll(self.midi)):
            err =3D Pm_Read(self.midi,buffer,1)
            if err < 0: raise Exception, Pm_GetErrorText(err)


The error was generated at: ExprNodes.py:590
Here are some of the local variables at the point the error was posted:

self.pos		('c:\\Users\\Lynn =
Oliver\\Desktop\\pyPortMidi\\pypm.pyx', 357, 21)

type.__doc__		None
type.__module__		'Pyrex.Compiler.PyrexTypes'
type.cname		'PmError'
type.from_py_function	'PyInt_AsLong'
type.is_enum		1
type.name		'PmError'
type.rank		-1
type.signed		1
type.to_py_function	'PyInt_FromLong'
type.typedef_flagis	1
type.values		[]
self.pos		('c:\\Users\\Lynn =
Oliver\\Desktop\\pyPortMidi\\pypm.pyx', 357, 21)
type.is_int		0
type.is_error		0

Can anyone suggest what I need to do to get this working?

Thanks,
LMO


--Apple-Mail=_01771F38-84CB-42B8-BC77-45DF382E6E65
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'm =
using Pyrex to build PyPortMidi. &nbsp;I was able to get it to work on =
OS X 10.7.3; on win32 (Windows XP) I didn't manage to get Pyrex to work, =
but I was able to get the PyPortMidi library built by copying in the =
output (pypm.c) from OS X. &nbsp;That didn't work on win64 (Windows =
7).<div><br></div><div>Working on win64, I tried two different ways to =
install Pyrex-0.9.9:&nbsp;</div><ol><li>Downloaded Pyrex-0.9.9.win32.exe =
and ran it.</li><li>Downloaded Pyrex-0.9.9.zip,&nbsp;unpacked it and ran =
"python setup.py install" &nbsp;</li></ol><div>With either installation, =
when I try to build PyPortMidi I get the same =
error:</div><div><br></div><div><div style=3D"font-size: 13px; "><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'">pyrexc pypm.pyx --&gt; =
pypm.c</font></div><div style=3D"font-size: 13px; "><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'">C:\Users\Lynn =
Oliver\Desktop\pyPortMidi\pypm.pyx:357:21: Type 'PmError' not acceptable =
as a boolean</font></div><div style=3D"font-size: 13px; "><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'">building 'pypm' =
extension</font></div><div style=3D"font-size: 13px; "><font =
class=3D"Apple-style-span" face=3D"'Andale =
Mono'">C:\Python27\Scripts\gcc.exe -mno-cygwin -mdll -O -Wall -DMS_WIN64 =
-IC:\Python27\include -IC:\Python27\PC -c pypm.c -o bu</font></div><div =
style=3D"font-size: 13px; "><font class=3D"Apple-style-span" =
face=3D"'Andale =
Mono'">ild\temp.win-amd64-2.7\Release\pypm.o</font></div><div =
style=3D"font-size: 13px; "><font class=3D"Apple-style-span" =
face=3D"'Andale Mono'">pypm.c:1:2: error: #error Do not use this file, =
it is the result of a failed Pyrex compilation.</font></div><div =
style=3D"font-size: 13px; "><font class=3D"Apple-style-span" =
face=3D"'Andale Mono'">error: command 'gcc' failed with exit status =
1</font></div></div><div style=3D"font-size: 13px; "><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'"><br></font></div><div =
style=3D"font-size: 13px; "><span class=3D"Apple-style-span" =
style=3D"font-size: 14px; ">This error didn't occur on OS X. &nbsp;I'm =
not a C &nbsp;programmer so it's not clear to me what caused the error; =
here is the declaration for PmError: </span>&nbsp;</div><div =
style=3D"font-size: 13px; "><br></div><div style=3D"font-size: 13px; =
"><div style=3D"font-family: 'Andale Mono'; ">&nbsp; &nbsp; ctypedef =
enum PmError:</div><div style=3D"font-family: 'Andale Mono'; ">&nbsp; =
&nbsp; &nbsp; &nbsp; pmNoError =3D 0,</div><div style=3D"font-family: =
'Andale Mono'; ">&nbsp; &nbsp; &nbsp; &nbsp; pmHostError =3D =
-10000,</div><div style=3D"font-family: 'Andale Mono'; ">&nbsp; &nbsp; =
&nbsp; &nbsp; pmInvalidDeviceId, #/* out of range or output device when =
input is requested or vice versa */</div><div style=3D"font-family: =
'Andale Mono'; ">&nbsp; &nbsp; &nbsp; &nbsp; =
pmInsufficientMemory,</div><div style=3D"font-family: 'Andale Mono'; =
">&nbsp; &nbsp; &nbsp; &nbsp; pmBufferTooSmall,</div><div =
style=3D"font-family: 'Andale Mono'; ">&nbsp; &nbsp; &nbsp; &nbsp; =
pmBufferOverflow,</div><div style=3D"font-family: 'Andale Mono'; =
">&nbsp; &nbsp; &nbsp; &nbsp; pmBadPtr,</div><div style=3D"font-family: =
'Andale Mono'; ">&nbsp; &nbsp; &nbsp; &nbsp; pmBadData, #/* illegal midi =
data, e.g. missing EOX */</div><div style=3D"font-family: 'Andale Mono'; =
">&nbsp; &nbsp; &nbsp; &nbsp; pmInternalError,</div><div =
style=3D"font-family: 'Andale Mono'; ">&nbsp; &nbsp; &nbsp; &nbsp; =
pmBufferMaxSize, #/* buffer is already as large as it can be =
*/</div><div style=3D"font-family: 'Andale Mono'; "><br></div><div =
style=3D"font-size: 14px; ">And here is the section of code where the =
error was flagged, I think...:</div><div><br></div></div><div><div><span =
class=3D"Apple-style-span" style=3D"font-size: 13px;"><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'">&nbsp; &nbsp; &nbsp; =
&nbsp; cdef PmEvent buffer[1]</font></span></div><div><span =
class=3D"Apple-style-span" style=3D"font-size: 13px;"><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'">&nbsp; &nbsp; &nbsp; =
&nbsp; cdef PmError err</font></span></div><div><span =
class=3D"Apple-style-span" style=3D"font-size: 13px;"><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'">&nbsp; &nbsp; &nbsp; =
&nbsp;&nbsp;</font></span></div><div><span class=3D"Apple-style-span" =
style=3D"font-size: 13px;"><font class=3D"Apple-style-span" =
face=3D"'Andale Mono'">&nbsp; &nbsp; &nbsp; &nbsp; =
Pm_SetFilter(self.midi, filters)</font></span></div><div><span =
class=3D"Apple-style-span" style=3D"font-size: 13px;"><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'">&nbsp; &nbsp; &nbsp; =
&nbsp; if err &lt; 0: raise Exception, =
Pm_GetErrorText(err)</font></span></div><div><span =
class=3D"Apple-style-span" style=3D"font-size: 13px;"><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'">&nbsp;357 &nbsp; =
&nbsp;while(Pm_Poll(self.midi)):</font></span></div><div><span =
class=3D"Apple-style-span" style=3D"font-size: 13px;"><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'">&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; err =3D =
Pm_Read(self.midi,buffer,1)</font></span></div><div><span =
class=3D"Apple-style-span" style=3D"font-size: 13px;"><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'">&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; if err &lt; 0: raise Exception, =
Pm_GetErrorText(err)</font></span></div></div><div><span =
class=3D"Apple-style-span" style=3D"font-size: 13px;"><font =
class=3D"Apple-style-span" face=3D"'Andale =
Mono'"><br></font></span></div><div><span class=3D"Apple-style-span" =
style=3D"font-size: 13px;"><font class=3D"Apple-style-span" =
face=3D"'Andale Mono'"><div><br></div></font></span></div><div>The error =
was generated at: <font class=3D"Apple-style-span" face=3D"'Andale =
Mono'" style=3D"font-size: 13px; =
">ExprNodes.py:590</font></div><div><div><div style=3D"font-size: 15px; =
"><span class=3D"Apple-style-span" style=3D"font-size: 14px; ">Here are =
some of the local variables at the point the error was =
posted:</span></div><div style=3D"font-size: medium; "><span =
class=3D"Apple-style-span" style=3D"font-size: 13px; =
"><br></span></div><div style=3D"font-size: medium; "><span =
class=3D"Apple-style-span" style=3D"font-size: 13px; "><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'">self.pos<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">		=
</span></font></span><span class=3D"Apple-style-span" =
style=3D"font-family: 'Andale Mono'; font-size: 13px; ">('c:<a =
href=3D"smb://Users//Lynn">\\Users\\Lynn</a> =
Oliver\\Desktop\\pyPortMidi\\pypm.pyx', 357, =
21)</span></div></div><div><span class=3D"Apple-style-span" =
style=3D"font-size: 13px;"><font class=3D"Apple-style-span" =
face=3D"'Andale Mono'"><br></font></span></div><div><span =
class=3D"Apple-style-span" style=3D"font-size: 13px;"><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'">type.__doc__<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">		=
</span>None</font></span></div><div><span class=3D"Apple-style-span" =
style=3D"font-size: 13px;"><font class=3D"Apple-style-span" =
face=3D"'Andale Mono'">type.__module__<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">		</span></font></span><span =
class=3D"Apple-style-span" style=3D"font-family: 'Andale Mono'; =
font-size: 13px; ">'Pyrex.Compiler.PyrexTypes'</span></div><div><span =
class=3D"Apple-style-span" style=3D"font-size: 13px;"><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'">type.cname<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">		=
</span></font></span><span class=3D"Apple-style-span" =
style=3D"font-family: 'Andale Mono'; font-size: 13px; =
">'PmError'</span></div><div><span class=3D"Apple-style-span" =
style=3D"font-size: 13px;"><font class=3D"Apple-style-span" =
face=3D"'Andale Mono'">type.from_py_function<span class=3D"Apple-tab-span"=
 style=3D"white-space:pre">	</span></font></span><span =
class=3D"Apple-style-span" style=3D"font-family: 'Andale Mono'; =
font-size: 13px; ">'PyInt_AsLong'</span></div><div><span =
class=3D"Apple-style-span" style=3D"font-size: 13px;"><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'"><a =
href=3D"http://type.is">type.is</a>_enum<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">		</span></font></span><span =
class=3D"Apple-style-span" style=3D"font-family: 'Andale Mono'; =
font-size: 13px; ">1</span></div><div><span class=3D"Apple-style-span" =
style=3D"font-size: 13px;"><font class=3D"Apple-style-span" =
face=3D"'Andale Mono'">type.name<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">		</span></font></span><span =
class=3D"Apple-style-span" style=3D"font-family: 'Andale Mono'; =
font-size: 13px; ">'PmError'</span></div><div><span =
class=3D"Apple-style-span" style=3D"font-size: 13px;"><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'">type.rank<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">		=
</span></font></span><span class=3D"Apple-style-span" =
style=3D"font-family: 'Andale Mono'; font-size: 13px; =
">-1</span></div><div><span class=3D"Apple-style-span" style=3D"font-size:=
 13px;"><font class=3D"Apple-style-span" face=3D"'Andale =
Mono'">type.signed<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">		</span></font></span><span =
class=3D"Apple-style-span" style=3D"font-family: 'Andale Mono'; =
font-size: 13px; ">1</span></div><div><span class=3D"Apple-style-span" =
style=3D"font-size: 13px;"><font class=3D"Apple-style-span" =
face=3D"'Andale Mono'">type.to_py_function<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span></font></span><span =
class=3D"Apple-style-span" style=3D"font-family: 'Andale Mono'; =
font-size: 13px; ">'PyInt_FromLong'</span></div><div><span =
class=3D"Apple-style-span" style=3D"font-size: 13px;"><font =
class=3D"Apple-style-span" face=3D"'Andale =
Mono'">type.typedef_flagis<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span></font></span><span =
class=3D"Apple-style-span" style=3D"font-family: 'Andale Mono'; =
font-size: 13px; ">1</span></div><div><span class=3D"Apple-style-span" =
style=3D"font-size: 13px;"><font class=3D"Apple-style-span" =
face=3D"'Andale Mono'">type.values<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">		</span></font></span><span =
class=3D"Apple-style-span" style=3D"font-family: 'Andale Mono'; =
font-size: 13px; ">[]</span></div><div><span class=3D"Apple-style-span" =
style=3D"font-size: 13px;"><font class=3D"Apple-style-span" =
face=3D"'Andale Mono'">self.pos<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">		</span></font></span><span =
class=3D"Apple-style-span" style=3D"font-family: 'Andale Mono'; =
font-size: 13px; ">('c:<a href=3D"smb://Users//Lynn">\\Users\\Lynn</a> =
Oliver\\Desktop\\pyPortMidi\\pypm.pyx', 357, 21)</span></div><div><span =
class=3D"Apple-style-span" style=3D"font-size: 13px;"><font =
class=3D"Apple-style-span" face=3D"'Andale Mono'"><a =
href=3D"http://type.is">type.is</a>_int<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">		</span></font></span><span =
class=3D"Apple-style-span" style=3D"font-family: 'Andale Mono'; =
font-size: 13px; ">0</span></div><div><span class=3D"Apple-style-span" =
style=3D"font-size: 13px;"><font class=3D"Apple-style-span" =
face=3D"'Andale Mono'"><a href=3D"http://type.is">type.is</a>_error<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">		=
</span></font></span><span class=3D"Apple-style-span" =
style=3D"font-family: 'Andale Mono'; font-size: 13px; =
">0</span></div><div style=3D"font-size: 13px; =
"><br></div></div><div>Can anyone suggest what I need to do to get this =
working?</div><div><br></div><div>Thanks,</div><div>LMO</div><div =
style=3D"font-size: 13px; "><font class=3D"Apple-style-span" =
face=3D"'Andale Mono'"><br></font></div></body></html>=

--Apple-Mail=_01771F38-84CB-42B8-BC77-45DF382E6E65--


--===============0905731587==
Content-Type: text/plain; charset="iso-8859-1"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

_______________________________________________
Pyrex mailing list
[email protected]
http://lists.copyleft.no/mailman/listinfo/pyrex

--===============0905731587==--