Issues compiling 2.6.5 on AIX 6.1

Dan Stromberg drsalists at gmail.com
Sat Jul 10 22:02:25 EDT 2010


On Fri, Jul 9, 2010 at 5:54 AM, Stopp, Bryan <Bryan.Stopp at argushealth.com>wrote:

> I checked, none of the files are symlinks. The install process never got
> to the point where it created sym-links for libraries (if it even does,
> I haven't gotten to that point in the install process.)
>
> -B
>
> -----Original Message-----
> From: python-list-bounces+cbds=argushealth.com at python.org
> [mailto:python-list-bounces+cbds <python-list-bounces%2Bcbds>=
> argushealth.com at python.org] On Behalf
> Of Thomas Jollans
> Sent: Friday, July 09, 2010 7:10 AM
> To: python-list at python.org
> Subject: Re: Issues compiling 2.6.5 on AIX 6.1
>
> On 07/08/2010 04:36 PM, Stopp, Bryan wrote:
> > building '_struct' extension
> >
> > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
> > -Wstrict-prototypes -I. -I/build/tools/src/Python-2.6.5/./Include
> > -I/build/tools/include -I. -IInclude -I./Include -I/usr/local/include
> > -I/build/tools/src/Python-2.6.5/Include
> -I/build/tools/src/Python-2.6.5
> > -c /build/tools/src/Python-2.6.5/Modules/_struct.c -o
> > build/temp.aix-6.1-2.6/build/tools/src/Python-2.6.5/Modules/_struct.o
> >
> > ./Modules/ld_so_aix gcc -pthread -bI:Modules/python.exp
> > build/temp.aix-6.1-2.6/build/tools/src/Python-2.6.5/Modules/_struct.o
> > -L/build/tools/lib -L/usr/local/lib -lpython2.6 -o
> > build/lib.aix-6.1-2.6/_struct.so
> >
> > collect2: library libpython2.6 not found
>
> What really stumps me (and you too, I expect) about this is the two
> different error messages. Above, it looks like collect2 simply doesn't
> find a -lpython2.6 anywhere. Adding . to LIBPATH does make sense.
>
> > building '_struct' extension
> >
> > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
> > -Wstrict-prototypes -I. -I/build/tools/src/Python-2.6.5/./Include
> > -I/build/tools/include -I. -IInclude -I./Include -I/usr/local/include
> > -I/build/tools/src/Python-2.6.5/Include
> -I/build/tools/src/Python-2.6.5
> > -c /build/tools/src/Python-2.6.5/Modules/_struct.c -o
> > build/temp.aix-6.1-2.6/build/tools/src/Python-2.6.5/Modules/_struct.o
> >
> > ./Modules/ld_so_aix gcc -pthread -bI:Modules/python.exp
> > build/temp.aix-6.1-2.6/build/tools/src/Python-2.6.5/Modules/_struct.o
> > -L/build/tools/lib -L/usr/local/lib -lpython2.6 -o
> > build/lib.aix-6.1-2.6/_struct.so
> >
> > ld: 0706-006 Cannot find or open library file: -l python2.6
> >
> >         ld:open(): No such file or directory
> >
> > collect2: ld returned 255 exit status
>
> But what on earth is this? It looks like collect2 found the library, and
> told it's mate ld, which can't open it. collect2 thinks it find a file,
> ld hits "No such file or directory" on the same file.
>
> Maybe it's a dead symlink? Looking for a file with the right name and
> location would find it, while opening it would hit a dead end, and
> probably return "No such file "
>
>
It's been a while since I've used AIX, but is it possible you're mixing 32
bit and 64 bit operations?  AIX shared libraries:
1) Are closer to windows dll's than *ix .so's - unsurprising given that
Windows shares a heritage with OS/2, and both OS/2 and AIX are from IBM.
2) A .a can hold both 32 bit and 64 bit objects.
3) If you have a .a with 32 objects in it, and try to link against it in 64
bit mode, the file is sort of there and sort of not - ls will see it, but
the linker will not.
4) 32 bit libraries suffer from a "loader domain" issue - the first part of
$LIBPATH optionally specifies a loader domain, which is a namespace into
which shared libraries are loaded
5) 64 bit libraries are supposed to be cleaner than 32 bit
6) Make sure that if you're building for 64 bit (for example) that ld is
doing the same when it's called from collect2 or whatever.
7) You can test what kind of shared library you're looking at (and sometimes
.a's are _shared_ on AIX - yes, it's weird, yes, it's true) with ar -X - see
the man page for more.

HTH.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100710/bddac08e/attachment-0001.html>


More information about the Python-list mailing list