Builing Python 2.6 on AIX 5.2

B

brasse

Hello!

I am having some trouble building Python 2.6 on AIX. The steps I have
taken are:

export PATH=/usr/bin/:/usr/vacpp/bin/
../configure --with-gcc=xlc_r --with-cxx=xlC_r --disable-ipv6
make

This is the error message I'm seeing:
../Modules/ld_so_aix xlc_r -bI:Modules/python.exp build/
temp.aix-5.2-2.6/home/mabr/Python-2.6/Modules/_multiprocessing/
multiprocessing.o build/temp.aix-5.2-2.6/home/mabr/Python-2.6/Modules/
_multiprocessing/socket_connection.o build/temp.aix-5.2-2.6/home/mabr/
Python-2.6/Modules/_multiprocessing/semaphore.o -L/usr/local/lib -o
build/lib.aix-5.2-2.6/_multiprocessing.so
ld: 0711-317 ERROR: Undefined symbol: .sem_timedwait
ld: 0711-317 ERROR: Undefined symbol: .CMSG_SPACE
ld: 0711-317 ERROR: Undefined symbol: .CMSG_LEN
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
*** WARNING: renaming "_multiprocessing" since importing it failed: No
such file or directory
error: No such file or directory
make: The error code from the last command is 1.

Have someone on this list had similar problems? Am I missing some
libraries? The configure script runs without errors, I would have
expected some kind of error there if I was missing something.

Regards,
Mattias
 
P

pruebauno

Hello!

I am having some trouble building Python 2.6 on AIX. The steps I have
taken are:

export PATH=/usr/bin/:/usr/vacpp/bin/
./configure --with-gcc=xlc_r --with-cxx=xlC_r --disable-ipv6
make

This is the error message I'm seeing:
./Modules/ld_so_aix xlc_r -bI:Modules/python.exp build/
temp.aix-5.2-2.6/home/mabr/Python-2.6/Modules/_multiprocessing/
multiprocessing.o build/temp.aix-5.2-2.6/home/mabr/Python-2.6/Modules/
_multiprocessing/socket_connection.o build/temp.aix-5.2-2.6/home/mabr/
Python-2.6/Modules/_multiprocessing/semaphore.o -L/usr/local/lib -o
build/lib.aix-5.2-2.6/_multiprocessing.so
ld: 0711-317 ERROR: Undefined symbol: .sem_timedwait
ld: 0711-317 ERROR: Undefined symbol: .CMSG_SPACE
ld: 0711-317 ERROR: Undefined symbol: .CMSG_LEN
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
*** WARNING: renaming "_multiprocessing" since importing it failed: No
such file or directory
error: No such file or directory
make: The error code from the last command is 1.

Have someone on this list had similar problems? Am I missing some
libraries? The configure script runs without errors, I would have
expected some kind of error there if I was missing something.

Regards,
Mattias

I don't know if it has anything to do with it. But I got that error
one time on AIX and it was a library compiled to 32 bit that could not
be linked to 64 bit python. Maybe in your case it is the other way
around.

I haven't tried compiling Py2.6 yet. I compile 64 bit with:

OPT=-O2 ./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64" --
disable-ipv6 AR="ar -X64"
 
P

pruebauno

Looks like AIX is missing sem_timedwait - see:http://bugs.python.org/issue3876

Please add your error to the bug report just so I can track it.

-jesse

FYI
I read that some people use:
HAVE_BROKEN_POSIX_SEMAPHORES in pyconfig.h.

for AIX, although I never do. Maybe I am not doing anything advanced
enough for problems related to semaphores to show up.
 
B

brasse

Looks like AIX is missing sem_timedwait - see:http://bugs.python.org/issue3876

Please add your error to the bug report just so I can track it.

-jesse

OK, I have now added my information to the bug tracker.

I would be quite happy if I could build Python on AIX without the
multiprocessing module. Is there some way I can skip some selected
modules when building Python. I tried with ./configure --without-
multiprocessing, but that didn't work.

:.:: mattias
 
B

brasse

Hello!

I am having some trouble building Python 2.6 on AIX. The steps I have
taken are:

export PATH=/usr/bin/:/usr/vacpp/bin/
./configure --with-gcc=xlc_r --with-cxx=xlC_r --disable-ipv6
make

This is the error message I'm seeing:
./Modules/ld_so_aix xlc_r -bI:Modules/python.exp build/
temp.aix-5.2-2.6/home/mabr/Python-2.6/Modules/_multiprocessing/
multiprocessing.o build/temp.aix-5.2-2.6/home/mabr/Python-2.6/Modules/
_multiprocessing/socket_connection.o build/temp.aix-5.2-2.6/home/mabr/
Python-2.6/Modules/_multiprocessing/semaphore.o -L/usr/local/lib -o
build/lib.aix-5.2-2.6/_multiprocessing.so
ld: 0711-317 ERROR: Undefined symbol: .sem_timedwait
ld: 0711-317 ERROR: Undefined symbol: .CMSG_SPACE
ld: 0711-317 ERROR: Undefined symbol: .CMSG_LEN
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
*** WARNING: renaming "_multiprocessing" since importing it failed: No
such file or directory
error: No such file or directory
make: The error code from the last command is 1.

Have someone on this list had similar problems? Am I missing some
libraries? The configure script runs without errors, I would have
expected some kind of error there if I was missing something.

Regards,
Mattias

OK. I have made some changes in the source that lets me build on AIX
5.2. I thought I could post the patch here and perhaps someone can
tell me if I am on the wrong track or if this is an OK fix on AIX.

Basically I have changed setup.py to define HAVE_SEM_TIMED_WAIT=0 on
aix. I have also defined CMESG_SPACE and CMESG_LEN in terms of
_CMSG_ALIGN (see http://homepage.mac.com/cjgibbons/rubyonaixhowto/x72.html)
in multipocessing.c. (I realise that this breaks some other platforms,
but right now I just need to build on AIX).

Here is a patch:

diff -Naur Python-2.6/Modules/_multiprocessing/multiprocessing.c
Python-2.6-clean-patch/Modules/_multiprocessing/multiprocessing.c
--- Python-2.6/Modules/_multiprocessing/multiprocessing.c
2008-06-14 00:38:33.000000000 +0200
+++ Python-2.6-clean-patch/Modules/_multiprocessing/
multiprocessing.c 2008-10-07 12:23:55.000000000 +0200
@@ -8,6 +8,13 @@

#include "multiprocessing.h"

+#ifndef CMSG_SPACE
+#define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) +
_CMSG_ALIGN(len))
+#endif
+#ifndef CMSG_LEN
+#define CMSG_LEN(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+#endif
+
PyObject *create_win32_namespace(void);

PyObject *pickle_dumps, *pickle_loads, *pickle_protocol;
diff -Naur Python-2.6/setup.py Python-2.6-clean-patch/setup.py
--- Python-2.6/setup.py 2008-09-30 02:15:45.000000000 +0200
+++ Python-2.6-clean-patch/setup.py 2008-10-07 12:23:34.000000000
+0200
@@ -1277,6 +1277,14 @@
)
libraries = []

+ elif platform.startswith('aix'):
+ macros = dict(
+ HAVE_SEM_OPEN=1,
+ HAVE_SEM_TIMEDWAIT=0,
+ HAVE_FD_TRANSFER=1
+ )
+ libraries = ['rt']
+
else: # Linux and other
unices
macros = dict(
HAVE_SEM_OPEN=1,

Perhaps this should go to some other list?

:.:: mattias
 
M

M.-A. Lemburg

OK. I have made some changes in the source that lets me build on AIX
5.2. I thought I could post the patch here and perhaps someone can
tell me if I am on the wrong track or if this is an OK fix on AIX.

Thanks. Please post the patch on the Python bug tracker, so we can
include this patch in Python 2.6.1:

http://bugs.python.org/issue?@template=item
Basically I have changed setup.py to define HAVE_SEM_TIMED_WAIT=0 on
aix. I have also defined CMESG_SPACE and CMESG_LEN in terms of
_CMSG_ALIGN (see http://homepage.mac.com/cjgibbons/rubyonaixhowto/x72.html)
in multipocessing.c. (I realise that this breaks some other platforms,
but right now I just need to build on AIX).

Here is a patch:

diff -Naur Python-2.6/Modules/_multiprocessing/multiprocessing.c
Python-2.6-clean-patch/Modules/_multiprocessing/multiprocessing.c
--- Python-2.6/Modules/_multiprocessing/multiprocessing.c
2008-06-14 00:38:33.000000000 +0200
+++ Python-2.6-clean-patch/Modules/_multiprocessing/
multiprocessing.c 2008-10-07 12:23:55.000000000 +0200
@@ -8,6 +8,13 @@

#include "multiprocessing.h"

+#ifndef CMSG_SPACE
+#define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) +
_CMSG_ALIGN(len))
+#endif
+#ifndef CMSG_LEN
+#define CMSG_LEN(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+#endif
+
PyObject *create_win32_namespace(void);

PyObject *pickle_dumps, *pickle_loads, *pickle_protocol;
diff -Naur Python-2.6/setup.py Python-2.6-clean-patch/setup.py
--- Python-2.6/setup.py 2008-09-30 02:15:45.000000000 +0200
+++ Python-2.6-clean-patch/setup.py 2008-10-07 12:23:34.000000000
+0200
@@ -1277,6 +1277,14 @@
)
libraries = []

+ elif platform.startswith('aix'):
+ macros = dict(
+ HAVE_SEM_OPEN=1,
+ HAVE_SEM_TIMEDWAIT=0,
+ HAVE_FD_TRANSFER=1
+ )
+ libraries = ['rt']
+
else: # Linux and other
unices
macros = dict(
HAVE_SEM_OPEN=1,

Perhaps this should go to some other list?

:.:: mattias

--
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source (#1, Oct 07 2008)________________________________________________________________________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::


eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top