[MMTK] Error compiling Pyrex modules in ForceField folder

vanitha at cs.wisc.edu vanitha at cs.wisc.edu
Wed Nov 23 20:05:08 CET 2005

I have installed Pyrex and I'm trying to compile the .pyx file in the
Examples/ForceField/ElectricField/Pyrex but I run into the following

python2.4 $HOME/bin/pyrexc MMTK_electric_field.pyx

ield/Pyrex/MMTK_electric_field.pyx:8:0: 'MMTK/forcefield.pxi' not found

ield/Pyrex/MMTK_electric_field.pyx:28:19: Syntax error in C variable

I'm not sure what the problem is. Also, I'm not sure how to go about
compiling a Pyrex file and invoke it from within Python. These are the
steps that I have written down from what I've gathered from resources on
the web:

1) Create file file.pyx
2) python2.4 $HOME/bin/pyrexc file.pyx - creates file.c
3) gcc -c -fPIC -I/$HOME/python2.4/ file.c - creates file.o
4) gcc -shared file.o <optional library> file.so

I've never used a .so file before. What do I do with this? If I need to
import the functions (compiled using Pyrex) within Python, what extension
would it look for?


- Vanitha

More information about the mmtk mailing list