[Pyrex] Pyrex on Mac OS X

Justin Walker justin at mac.com
Mon Nov 22 06:19:22 CET 2004


Hi, all,

I am new to Python/Pyrex, and I use Mac OS X (10.3.6).  I have some  
fairly simple code as a starting point for using Pyrex, and I'm not  
getting very far.  I found a related discussion on the list about a  
year back in the archives, but I'm missing something.

I have a small chunk of Python code that implements matrix  
multiplication, and an small chunk of Pyrex code that does the same.   
When I try to run the latter, I get this complaint:

 >>> 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


This is the result of compiling the .c produced by pyrex on Mac OS X  
(I'm using WordTech's Eric, and MacPython):

$ gcc -bundle -framework Python -O3 -fPIC mult2.c -c -o mult2.so \
      
-I/System/Library/Frameworks/Python.framework//Versions/2.3/include/ 
python2.3
mult2.c:427: warning: initialization from incompatible pointer type
gcc: -framework: linker input file unused because linking not done
gcc: Python: linker input file unused because linking not done

This code (both python and pyrex) works on Linux (Redhat 9.x).

I can provide the code if it will shed light; I don't want to overwhelm  
the reader, right off.

Thanks for any help.

Regards,

Justin

--
Justin C. Walker, Curmudgeon-At-Large  *
Institute for General Semantics        |   When LuteFisk is outlawed
                                        |   Only outlaws will have
                                        |       LuteFisk
*--------------------------------------*-------------------------------*




More information about the Pyrex mailing list