Need help configuring pyrex for primes.pyx example

John Hunter jdhunter at ace.bsd.uchicago.edu
Thu Aug 1 23:38:31 EDT 2002


>>>>> "David" == David Lees <debl2nonospamykwamm at bellatlantic.net> writes:

    David> [debl at whiplash Demos] gcc -shared primes.o -o primes.so
    David> [debl at whiplash Demos] primes.so Segmentation fault (core

    David> I assume my problem is in the linking, because I am
    David> clueless as to what the '-lxosd' on the command line of his
    David> link is.

Well, your post makes no other reference to -lxosd ... but it means:
links with the library libxosd.[so|a]

But if the session you pasted is accurate, you problem is that you are
trying to execute a library, and that makes makes no sense.

Where you typed primes.so in the text above, do instead
# python
>>> load primes

What is happening is that you are compiling an extension to the python
library (primes.so).  This is a C library.  It cannot be executed (what
you in effect tried to do by typing primes.so).  But it can be loaded
into python.

Or I'm very confused.  Definitely one or the other.

John Hunter




More information about the Python-list mailing list