Re: (no subject)
Greg Ewing <[email protected]> Wed, 12 Feb 2014 21:44:24 +1300
| Newsgroups | gmane.comp.python.pyrex |
|---|---|
| Message-ID | <[email protected]> |
Kevin Conway wrote: > I can run the build for RSeQC, but it eventually produces this error: > = > ... > running build_ext > pyrexc lib/bx/bitset.pyx --> lib/bx/bitset.c > /home/####/to-be-installed/RSeQC-2.3.7/lib/bx/bitset.pyx:75:12: Syntax er= ror in C variable declaration > ... I just had a look at RSeQC, and discovered a few things: 1) It actually uses Cython, not Pyrex. This is probably the reason for the above error -- Cython adds quite a lot of extensions to Pyrex syntax. 2) You *shouldn't* need to have either Pyrex or Cython in order to install RSeQC, because the generated .c files are included in the source distribution. However... 3) The setup.py doesn't seem to make adequate provision for building without Cython. In particular, if you happen to have Pyrex installed, it tries to use it anyway, thereby clobbering the otherwise perfectly good .c files. I managed to get RSeQC to build by making the following changes to the setup.py: a) Comment out the following lines: # Use build_ext from Cython if found try: import Cython.Distutils command_classes['build_ext'] =3D Cython.Distutils.build_ext except: pass b) Replace all occurrences of ".pyx" with ".c". Then it seems to build okay using the existing .c files. Remember to restore a fresh copy of the RSeQC source to get back the .c files that were clobbered. (When the dust has settled, you might also like to contact the authors of RSeQC and point out that their setup.py file is broken. A setup.py intended for end users should never invoke Pyrex or Cython automatically, even if it happens to be installed.) -- = Greg