[Pyrex] Pyrex on Mac OS X
Bob Ippolito
bob at redivi.com
Tue Nov 23 08:19:32 CET 2004
On Nov 23, 2004, at 6:58 AM, Justin Walker wrote:
> Thanks for the reply; it helped...
>
> On Nov 22, 2004, at 0:03, Bob Ippolito wrote:
>
>>
>> On Nov 22, 2004, at 9:44 AM, Justin Walker wrote:
>>> On Nov 21, 2004, at 23:09, Bob Ippolito wrote:
> [snip]
>>> Yeah; most of this was just cobbled together from someone else's
>>> work on Linux. I'm jumping into the middle, without much knowledge
>>> of the whole process.
>>>
>>> I should have mentioned that I noticed the refs to distutils in the
>>> earlier discussion, and I just located some discussion on the Python
>>> website. However that doc is oriented to putting together a
>>> distribution; I just want to compile :-}. Is there specific
>>> information on this floating around, or should I spend some time
>>> looking at <http://www.python.org/doc/current/dist/dist.html>?
>>
>> There's no difference between "just compiling" and putting together a
>> distribution. Constructing a distutils setup.py is rather trivial so
>> long as you have simple requirements. Pyrex even ships with a
>> distutils extension for taking pyx files "directly" to Python
>> extensions. See The Pyrex Guide <http://ldots.org/pyrex-guide/> for
>> examples.
>
> The guide was good. I misread the other doc. I hacked together a
> setup script, and ran it without incident. However, there's something
> I'm missing:
>
> >>> prof.matmul()
> Traceback (innermost last):
> File "<stdin>", line 1, in ?
> File "/SandBox/sb/PyrexTest/PyHecke/prof.py", line 11, in matmul
> t1 = T1.timeit(tries)
> File
> "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
> python2.3/timeit.py", line 158, in timeit
> return self.inner(it, self.timer)
> File "<timeit-src>", line 3, in inner
> ImportError: Inappropriate file type for dynamic loading
>
> My setup script sez:
> from distutils.core import setup
> from distutils.extension import Extension
> from Pyrex.Distutils import build_ext
> setup(
> name = "mult2",
> ext_modules=[
> Extension("mult2", ["mult2.pyx"])
> ],
> cmdclass = {'build_ext':build_ext}
> )
>
> Are there other arguments to setup that I should know about?
Uh.. the argument to uninstall whatever non-standard compiler you have
installed, that's taking precedence over Xcode?
-obb
More information about the Pyrex
mailing list