[Tutor] extentions and osX

Tom Beale Thomas.Beale at manchester.ac.uk
Mon Oct 17 14:46:37 CEST 2005

I have a problem with a c++ extension into a python program.

I am trying to run a program written by someone else.   It has been  
written and tested on linux/intel but I don't have access to a linux  
machine at the moment, so I am attempting to run it on osX (G4).

When the program runs I get a segmentation fault.   This happens when  
it reaches the line

import _contributionForPixel

which has previously been created by setup.py which is as follows:

#!/usr/bin/env python
# To use:
#       python setup.py install
import os, sys, string, re
from glob import glob

import distutils

import distutils
from distutils.command.install import install
from distutils.core import setup, Extension
# except:
#    raise SystemExit, "Distutils problem, see Numeric README."

headers = glob (os.path.join ("Include","*.h") )
header = headers + glob (os.path.join ("Include/Numeric","*.h") )

# The version is set in Lib/numeric_version.py

setup (name = "extension",
        description = " Extension to Python",
        ext_modules = [Extension('_contributionForPixel',
'contribution_wrap.cxx' ]
         ,       include_dirs  = ['./']  ),


Can someone point me in the right direction?   Is it likely there is  
a problem with the original contribution.cc file (even though setup  
python build) runs fine, or is there some problem with the way it is  
linked.   I am using python 2.4.1 on osX 10.4



More information about the Tutor mailing list