Baffling extension module compile problem

Robert Roy rjroy at takingcontrol.com
Fri May 11 23:04:02 CEST 2001


On Thu, 10 May 2001 14:50:23 +1200, Greg Ewing <see at my.signature>
wrote:

>I have a REALLY screwy problem.
>
>I'm working on a C extension module. If I issue
>my 'make' command from the shell, everything
>is fine.
>
>But if I use the 'make' command in Emacs, the
>resulting module causes a seg fault when I
>import it!

I have been having a similar problem. I am trying to build python on a
machine where I do not necessarily have access to /usr/local. Thus to
ensure I am using the desired copies of readline, tck/tk, gdbm etc...
I build them all and point to the appropriate places.

This can be a lengthy process so I decided to build a shell script to
build all the dependencies, then build python, then add in all of the
extra extensions I want. So far so good. But when I get to the python
build stage, the interpreter seems to build fine, but when it runs
setup.py, all h*** breaks loose. For each extension I get a huge list
of symbols and it gives me an error message squawking about
relocatable code. If I run make from the command line however all is
well.  Really bizzare.

I thought perhaps it was because my script was running under sh and
the command line under bash, but when I removed the #! it made no
difference.

After fighting with this for much longer than I care to admit, I ended
up having to settle for a three step process,  where I run one script
to build all of the dependencies and run configure, a manual step
where I make and make install the interpreter, and finally one more
script to build the extensions.


Strange...

Bob



More information about the Python-list mailing list