Building things with setup.py

James Stroud jstroud at mbi.ucla.edu
Fri Sep 22 05:35:04 EDT 2006


Robert Kern wrote:
> James Stroud wrote:
>> I did build my own python 2.5, yesterday, requiring me to rebuild all 
>> extensions.
> 
> Do other extensions build correctly? If so, it's beginning to look like 
> a problem in numpy.distutils .

It seems that every thing has built without incident (numarray, numeric, 
mxtexttools, pil, reportlab, just to name a few), with the exception, 
strangely enough, of python2.5 itself. Python required hiding previous 
python installations.

>> Everything I do is compiled by hand as joe-user. I'm in a situation 
>> where I can't do RPM (and I don't have root on my work machine 
>> (theoretically ;-)) so, to be a good joe-user, everything I add goes 
>> into the prefix:
>>
>> $HOME/Programs
>>
>> This is the listing from $HOME/Programs/lib/python2.5/config:
>>
>> euler 6% ls
>> total 4092
>>     8 config.c       12 install-sh*       44 Makefile       8 python.o 
>>     8 Setup.config
>>     8 config.c.in  3960 libpython2.5.a    12 makesetup*    24 Setup 
>>     8 Setup.local
>>
>> The build process, by the way, required my copying libpython2.5.a to 
>> $HOME/Programs/lib.
> 
> Hmm. That doesn't quite sound right, but it's been a while since I 
> compiled the interpreter from source.

Sorry. To clarify, making libpython2.5a available in a $LD_LIBRARY_PATH 
was necessary to build numpy and scipy.

>> The text files Setup.config and Setup.local do not seem to have 
>> terribly specific information in them. Which file in particular should 
>> I inspect?
> 
> Makefile has most of that information. You can verify that distutils is 
> finding it like so:
> 
>  >>> from distutils import sysconfig
>  >>> sysconfig.get_makefile_filename()
> '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/config/Makefile' 
> 
>  >>> d = sysconfig.parse_makefile(_)
>  >>> import pprint
>  >>> pprint.pprint(d)
> {'AR': 'ar',
>  ...
> }

This output from the check is here:
http://www.jamesstroud.com/build-scipy-logs/distutil-check.txt

I'm not sure if this is relevant to what you see in the check, but I 
installed scipy_distutils AFTER installing scipy.

>> I did not capture output from the build and I could not find a file 
>> with the word "log" in it that appears to be a build log. The jist of 
>> the problem is that first it can't find symbols from libpython2.5, 
>> then from   libthread, etc. Then, it complains about no "MAIN__" when 
>> linking the .so files with g77 and no "main" with gcc (which is 
>> curious), so I must include the -shared flag, after including 
>> -llibrary type flags for all of the libraries it doesn't know about.
> 
> What versions of gcc and g77 are you using?

euler 2% g77 -v
Reading specs from 
/auto_nfs/data10/users/jstroud/Programs/bin/../lib/gcc/i686-pc-linux-gnu/3.4.2/specs
Configured with: ./configure --prefix=/data1/users/jstroud/Programs : 
(reconfigured) ./configure --prefix=/data1/users/jstroud/Programs
Thread model: posix
gcc version 3.4.2
euler 3% gcc -v
Reading specs from 
/auto_nfs/data10/users/jstroud/Programs/bin/../lib/gcc/i686-pc-linux-gnu/3.4.2/specs
Configured with: ./configure --prefix=/data1/users/jstroud/Programs : 
(reconfigured) ./configure --prefix=/data1/users/jstroud/Programs
Thread model: posix
gcc version 3.4.2

>> If its necessary, I can run setup.py build again and send the output 
>> to a file and post that to scipy-dev if you think it might be helpful.
> 
> Yes, that is what I intended.
> 

This is posted here:
http://www.jamesstroud.com/build-scipy-logs/build-scipy-py2.5-euler.txt

For symmetry, similar output for numpy is posted here:
http://www.jamesstroud.com/build-scipy-logs/build-numpy-py2.5-euler.txt

Please let me know if I can be of any further help with these issues.

James



More information about the Python-list mailing list