[Pyrex] Newbie Question (problems with GCC)

Voidspace mike at pcblokes.com
Fri Apr 16 15:03:13 CEST 2004


Phillip J. Eby wrote:

> At 08:54 AM 4/16/04 +0100, Voidspace wrote:
>
>> In actual the reply from Greg might contain the answer to my further 
>> difficulties :-)
>>
>> However - below are the resutls of my *failed* experiments last 
>> night.............
>>
>> I thought I'd followed the instructions in :
>> http://randomthoughts.vandorp.ca/syncato/WK/blog/758_Simple_instructions_to_compile_python_C_extensions_in_windows.item 
>>
>> to the letter !
>> (Thanks for the replies by the way - both Phillip and Greg).
>>
>> Now the 'random thoughts' page says that after installing MinGW 
>> successfully and adding a disutils.cfg file (which didn't exist 
>> already).... I ought to be able to compile extensions from disutils 
>> automagically.................
>>
>> However it seems that maybe :
>>
>>  python setup.py build_ext --compiler=mingw32
>>
>> is the right way instead.... (I'll try it when I get home)
>
>
> Where did you put the distutils.cfg?  It has to go in your 
> Python2X\Lib\distutils directory.  Mine looks like this: 

Yup.. that's where it is.


>
>
> [build]
> compiler=mingw32

And that's what it looks like - it's a text file, and that's all it is - 
called disutils.cfg and in the right place.
My guess is that disutils still isn't picking up on it - or a related 
problem.

>
> If you have that in place, you should never need the --compiler flag.  
> In the two years I've had that file, I've never needed --compiler or -c.
>
> Second, did you actually build a 'libpython2x.a' file?  You didn't 
> mention that.  If you didn't do that, you're not going to be able to 
> actually build a .pyd.  See step 2 on this page:
>
> http://sebsauvage.net/python/mingw.html
>
>
> (By the way, whenever I refer to "python2x" I mean e.g. python22 or 
> python23, as appropriate for what version you're using.)

:-)

Yes - that part was as straightforward as the web page says.
MinGW now has the pexports exe with it - which is a different size (and 
therefore a different version) to the one available for download at that 
site. (I used the downloaded one - just so that I had followed the 
instructions :-)

>
>
>> F:\Python Projects\c>gcc -shared primes.o -o primes.so
>
>
> That won't work.  Windows uses '.pyd' files, not '.so' files.  And, 
> you've got no -L here to specify where your libpython is at.
>
Hmm.. thought it wouldn't - that was following the instructions for for 
a Linux install.

--

I've just done it (with setup.py) again and got the same result....

'Python was built with visual studio 6.. blah blah blah'

When Pyrex is installed using it's :
setup.py install

method - is the modification needed to disutils made automatically ?

I'll try a reboot now that I'm *sure* i've followed all the instructions.
Is the setup file ok ? I just edited one in the tutorial for building 
the XSOD one....

Thanks

Michael

>
>
>
>

-- 

http://www.Voidspace.org.uk 
The Place where headspace meets cyberspace. Online resource site - covering science, technology, computing, cyberpunk, psychology, spirituality, fiction and more. 

---
http://www.atlantibots.org.uk
http://groups.yahoo.com/group/atlantis_talk/
Atlantibots - stomping across the worlds of Atlantis.
Building with Python - programming language that rules the world.
---
http://www.fuchsiashockz.co.uk   
http://groups.yahoo.com/group/void-shockz
---

Everyone has talent. What is rare is the courage to follow talent
 to the dark place where it leads. -Erica Jong
Ambition is a poor excuse for not having sense enough to be lazy.
         -Milan Kundera







More information about the Pyrex mailing list