[Python-bugs-list] [ python-Bugs-232637 ] can't compile modules on AIX 4.2.1 (for real this time)

nobody nobody@sourceforge.net
Wed, 28 Feb 2001 20:52:43 -0800


Bugs #232637, was updated on 2001-02-15 15:59
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=232637&group_id=5470

Category: Build
Group: None
Status: Open
Priority: 5
Submitted By: Benjamin Collar
Assigned to: A.M. Kuchling
Summary: can't compile modules on AIX 4.2.1 (for real this time)

Initial Comment:
Hi,

CC=cc_r CFLAGS="-O2 -qmaxmem=6000" ./configure --prefix=/development/utils --without-gcc
make CC=cc_r OPT="-O2 -qmaxmem=6000".

I'm building 2.1a2 with patch 103679 applied (necessary for makexp_aix and ld_so_aix to be found earlier in the process). Here's some output (it's the same for all modules):

building '_tkinter' extension
/development/utils/lib/python2.1/config/ld_so_aix cc -bI:/development/utils/lib/python2.1/config/python.exp build/temp.aix-2-000310094C00-2.1/_tkinter.o build/temp.aix-2-000310094C00-2.1/tkappinit.o -L/usr/X11/lib -L/usr/local/lib -ltk8.0 -ltcl8.0 -lld -lX11 -o build/lib.aix-2-000310094C00-2.1/_tkinter.so
unable to execute /development/utils/lib/python2.1/config/ld_so_aix: No such file or directory
WARNING: building of extension "_tkinter" failed: command '/development/utils/lib/python2.1/config/ld_so_aix' failed with exit status 1

There are TWO things I notice here:

1) ld_so_aix is in Modules, not in /development/utils/lib/python2.1/config. In fact, there is no directory called /development/utils/lib/python2.1.

2) (copied from above)
"/development/utils/lib/python2.1/config/ld_so_aix cc"

Note it says cc, not cc_r, which is how I configured and ran make. cc_r is darn important, since python will blow up if it's configured with threads but you don't run cc_r.

Previously this problem was mentioned in bug #129991, which was closed when I submitted some patches I thought solved the problem...well they were incomplete. I don't know exactly what to patch for the above problems...


----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr.
Date: 2001-02-28 20:52

Message:
Logged In: YES 
user_id=3066

This relates to the move to distutils, but may have already been fixed.  Andrew?

----------------------------------------------------------------------

Comment By: Benjamin Collar
Date: 2001-02-22 11:47

Message:
I got today's snapshot and ran the same configure and make I've been doing. Lo and behold everything worked GREAT. No problems building modules at all.
NOTE: this is using GNU make.

Good job Neil!

However, when I used AIX's make, there were a few errors while building Modules:

./Modules/ld_so_aix cc -bI:Modules/python.exp build/temp.aix-2-000310094C00-2.1/dlmodule.o -L/usr/local/lib -o build/lib.aix-2-000310094C00-2.1/dl.so
ld: 0711-317 ERROR: Undefined symbol: .dlopen
ld: 0711-317 ERROR: Undefined symbol: .dlerror
ld: 0711-317 ERROR: Undefined symbol: .dlsym
ld: 0711-317 ERROR: Undefined symbol: .dlclose
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.

./Modules/ld_so_aix cc -bI:Modules/python.exp build/temp.aix-2-000310094C00-2.1/_cursesmodule.o -L/usr/local/lib -lcurses -ltermcap -o build/lib.aix-2-000310094C00-2.1/_curses.so
ld: 0706-006 Cannot find or open library file: -l termcap
        ld:open(): A file or directory in the path name does not exist.

While GNU make during the Module builds used "ld_so_aix cc_r" ... you'll note that AIX's make used cc.

Shall we continue with this? Or is it sufficient to say "Please use GNU make if you're on AIX"?

----------------------------------------------------------------------

Comment By: M.-A. Lemburg
Date: 2001-02-16 01:51

Message:
Just reading through the checkins today I fonud that Neil has
been fiddling with that code. Perhaps you ought to grab the latest
CVS snapshot and rerun the install ?!

----------------------------------------------------------------------

Comment By: M.-A. Lemburg
Date: 2001-02-16 01:45

Message:
Ok, here we go again :-)

1)  distutils assumes Python to be already installed on the machine
and thus it looks for the AIX tools in the config dir -- unfortunately,
setup.py is run before these files are installed, so it cannot find
them. Perhaps we ought to add a special case to distutils
which allows finding them anyway ?!

2) It seems as if your make doesn't copy the command line
variables into the OS environment. The setup.py file contains
explicit code which uses the OS environment variables to
choose a compiler and linker:

# When you run "make CC=altcc" or something similar, you really want
# those environment variables passed into the setup.py phase. Here's
# a small set of useful ones.
 compiler = os.environ.get('CC')
 linker_so = os.environ.get('LDSHARED')

Not sure what to do about this. It hints at another problem though:
distutils uses the settings from the Makefile per default. It seems
that in your case it is having trouble parsing that file.

BTW, why does sys.platform return for you ? (There is a switch
in distutils.sysconfig which switches on 'aix4' -- could be that
this causes the problem)

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=232637&group_id=5470