Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Python on AIX

46 views
Skip to first unread message

marco

unread,
Nov 22, 2001, 5:37:30 PM11/22/01
to

Hi all,

We just recently compiled Python 2.2b2 under AIX 4.3.3
using gcc 2.8.1. I'll just post our experience in case
anybody finds it helpful. The original configure command
was:

./configure \
--prefix=/usr/local/python-2.2b2

This uses cc_r (v. 5), and while this more or less worked,
there were many of the following warnings:

cc_r: 1501-210 command option t contains an incorrect subargument

Later there were other problems but these were not
really compiler-related (I did not know this at the time,
though). Furthermore cc_r did not seem to have the threads
problem I later encountered with gcc (and which are documented
in the README). So, in summary, cc_r would have probably worked --
perhaps better than with gcc -- but we didn't go down
that road. Instead, we used the following:

./configure \
--prefix=/usr/local/python-2.2b2 \
--with-gcc

and when trying to "make" got the following error:

In file included from /usr/include/sys/thread.h:45,
from /usr/include/sys/ptrace.h:28,
from /usr/include/sys/proc.h:48,
from /usr/include/sys/pri.h:29,
from /usr/include/sys/sched.h:38,
from /usr/include/sched.h:52,
from /usr/include/pthread.h:43,
from Python/thread_pthread.h:6,
from Python/thread.c:117:
/usr/include/sys/var.h:116: parse error before `__cptr64'
.
[snip a lot]
.
Python/thread_pthread.h:135: warning: implicit declaration of function `pthread_init'
make: 1254-004 The error code from the last command is 1.

As I mentioned above, this is documented in the README. We
got around it by using:

./configure \
--prefix=/usr/local/python-2.2b2 \
--with-gcc \
--with-threads=no

The "make" then died with the following error:

./Modules/makexp_aix Modules/python.exp "" libpython2.2.a; -Wl,-bE:Modules/python.exp -lld -o python Modules/python.o libpython2.2.a -ldl -lm
/bin/sh: -Wl,-bE:Modules/python.exp: not found.
make: 1254-004 The error code from the last command is 127.

Notice the space after the ";". Indeed, looking at the results
from the configure script we see:

checking LINKCC... ./configure[1417]: LINKCC: not found
$(srcdir)/Modules/makexp_aix Modules/python.exp "" $(LIBRARY);

Lines 1415 to 1417 of "configure" are as follows:

case $ac_sys_system in
AIX*)
LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp \"\" \$(LIBRARY); $(LINKCC)";;

The problem turned out to be extra parenthesis around $(LINKCC). It should
read:

AIX*)
LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp \"\" \$(LIBRARY); $LINKCC";;

The lines after that read:

dgux*)
LINKCC="LD_RUN_PATH=$libdir $(LINKCC)";;
Monterey64*)
LINKCC="$(LINKCC) -L/usr/lib/ia64l64";;
esac

Presumably these too have extra ()s.

Once that was fixed there were further complaints along the following
lines:

WARNING: building of extension "fcntl" failed: command '/usr/local/python-2.2a4/lib/python2.2/ld_so_aix' failed with exit status 1

There seemed to be some confusion between the source directory
and the installation directory (which was set with --prefix to be
/usr/local/python-2.2b2). The file it was looking for was in fact
under the "Modules" subdirectory within the Python source tree.
The simplest workaround was to copy the files it wanted to the
appropriate location. These were:

ld_so_aix
makexp_aix
python.exp

Once copied into /usr/local/python-2.2a4/lib/python2.2/ we
re-ran the configure ; make ; make install. The following failed:

/usr/local/src2/marco/Python-2.2b2/Modules/socketmodule.c: In function `PyH_Err':
/usr/local/src2/marco/Python-2.2b2/Modules/socketmodule.c:432: warning: implicit declaration of function `hstrerror'
WARNING: building of extension "_socket" failed: command 'gcc' failed with exit status 1

/usr/local/src2/marco/Python-2.2b2/Modules/_cursesmodule.c:2348: too few arguments to function `tparm'
WARNING: building of extension "_curses" failed: command 'gcc' failed with exit status 1

/usr/local/src2/marco/Python-2.2b2/Modules/_curses_panel.c:17: panel.h: No such file or directory
WARNING: building of extension "_curses_panel" failed: command 'gcc' failed with exit status 1

However, we can live for now without the socket and curses modules. Other
than that Python seems to be OK. Note that precompiled Python binaries (in
RPM form) are available for AIX at:
http://www-1.ibm.com/servers/aix/products/aixos/linux/download.html

We haven't tried those, though. Still, we hope this is helpful for
people trying to perform the compilation on their own, and to the
Python developers by letting them know about the glitches we encountered.

Cheers!

--
md...@altavista.net
Gunnm: Broken Angel
http://reimeika.ca/

Martin von Loewis

unread,
Nov 23, 2001, 10:29:10 AM11/23/01
to
marco <md...@altavista.net> writes:

> We haven't tried those, though. Still, we hope this is helpful for
> people trying to perform the compilation on their own, and to the
> Python developers by letting them know about the glitches we
> encountered.

Unfortunately, it doesn't help Python developers much. What *would*
help is to have an expert on AIX with much time at his hands, who
understands all the problems and proposes a fix. That fix, ideally,
would work on all versions of AIX or clearly identify the versions it
does work for, and not interfere with the build procedure on other
systems (or generalize that so that AIX comes out as an instance of
the general procedure, instead of being a special case on its own).

Regards,
Martin

marco

unread,
Nov 23, 2001, 12:53:45 PM11/23/01
to
Martin von Loewis <loe...@informatik.hu-berlin.de> writes:

> Unfortunately, it doesn't help Python developers much. What *would*
> help is to have an expert on AIX with much time at his hands, who
> understands all the problems and proposes a fix. That fix, ideally,
> would work on all versions of AIX or clearly identify the versions it
> does work for, and not interfere with the build procedure on other
> systems (or generalize that so that AIX comes out as an instance of
> the general procedure, instead of being a special case on its own).

I agree. However, I don't think that the extra () in the AIX case
statement of the Makefile is really OS-dependent, and it's easy
enough to fix (but of course I may be wrong :). It's a small glitch,
but these things do take time to figure out, and every bit helps.

The more complicated compilation problems are indeed of a different
nature altogether. Given AIX's niche position it's hard to achieve
the critical mass of experts/users required to weed out all (or most)
of the problems. But that's just the way it is, I guess...

Anyway, at the very least one can try to document the problems for
future generations, which was the main point of my post.

Cheers,

marco

unread,
Nov 23, 2001, 12:59:19 PM11/23/01
to
marco <md...@altavista.net> writes:

> Once copied into /usr/local/python-2.2a4/lib/python2.2/ we
> re-ran the configure ; make ; make install. The following failed:

Sorry, that should have read:

/usr/local/python-2.2b2/lib/python2.2/

instead of /usr/local/python-2.2a4/lib/python2.2/.

Cheers,

M.-A. Lemburg

unread,
Nov 26, 2001, 11:06:55 AM11/26/01
to

Some tips:
* Make sure that you always use GNU make on AIX -- the one shipped
with AIX is braindead.
* AIX is a mixed 32-bit/64-bit platform -- this results in a whole
bunch of problems; one thing to make sure is that you always use
the same bit-length for the interpreter, the extensions and the libs
you link against. Tip: use the same compiler, make and optimization
options for all parts of the product build process.
* Try to compile Python using
./configure --without-gcc
make CC=cc_r OPT="-O2 -qmaxmem=4000" install

Please upload your findings to the Python bug tracker; the socket
module should definitely build on AIX, not sure about fcntl and
curses.

BTW, does anyone know how well Python runs on the new AIX 5L ?

--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Consulting & Company: http://www.egenix.com/
Python Software: http://www.lemburg.com/python/


0 new messages