[MMTK] Error compiling Pyrex modules in ForceField folder

vanitha at cs.wisc.edu vanitha at cs.wisc.edu
Fri Nov 25 14:06:34 CET 2005


I ran python setup.py build_ext --inplace and I got the following error:

running build_ext
building 'MMTK_electric_field' extension
Traceback (most recent call last):
  File "setup.py", line 31, in ?
    cmdclass = {'build_ext': build_ext}
  File "/afs/cs.wisc.edu/u/v/a/vanitha/lib/python2.4/distutils/core.py",
line 149, in setup
    dist.run_commands()
  File "/afs/cs.wisc.edu/u/v/a/vanitha/lib/python2.4/distutils/dist.py",
line 946, in run_commands
    self.run_command(cmd)
  File "/afs/cs.wisc.edu/u/v/a/vanitha/lib/python2.4/distutils/dist.py",
line 966, in run_command
    cmd_obj.run()
  File
"/afs/cs.wisc.edu/u/v/a/vanitha/lib/python2.4/distutils/command/build_ext.py",
line 279, in run
    self.build_extensions()
  File
"/afs/cs.wisc.edu/u/v/a/vanitha/lib/python2.4/distutils/command/build_ext.py",
line 405, in build_extensions
    self.build_extension(ext)
  File
"/afs/cs.wisc.edu/u/v/a/vanitha/lib/python2.4/distutils/command/build_ext.py",
line 442, in build_extension
    sources = self.swig_sources(sources, ext)
TypeError: swig_sources() takes exactly 2 arguments (3 given)

- Vanitha



> On 23.11.2005, at 20:05, vanitha at cs.wisc.edu wrote:
>
>> 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
>> error:
>>
>> python2.4 $HOME/bin/pyrexc MMTK_electric_field.pyx
>>
>> /afs/cs.wisc.edu/u/v/a/vanitha/private/MMTK-2.5.11/Examples/
>> Forcefield/ElectricField/Pyrex/MMTK_electric_field.pyx:8:0:
>> ield/Pyrex/MMTK_electric_field.pyx:8:0: 'MMTK/forcefield.pxi' not
>> found
>
> You need to specify the include path for MMTK:
>
> pyrexc -I ../../../Include MMTK_electric_field.pyx
>
>> 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
>
> All it takes is
>
> 	python setup.py build_ext --inplace
>
> to run all the steps.
>
>> 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?
>
> The .so file is the compiled Python module, and its name is the
> module name. You can put it anywhere on $PYTHONPATH, just like a
> Python module, and import it.
>
> Konrad.
> --
> ------------------------------------------------------------------------
> -------
> Konrad Hinsen
> Laboratoire Leon Brillouin (CEA-CNRS), CEA Saclay,
> 91191 Gif-sur-Yvette Cedex, France
> Tel.: +33-1 69 08 79 25
> Fax: +33-1 69 08 82 61
> E-Mail: khinsen at cea.fr
> ------------------------------------------------------------------------
> -------
>
>
>





More information about the mmtk mailing list