Builing Python 2.6 on AIX 5.2

brasse thebrasse at gmail.com
Tue Oct 7 06:24:22 EDT 2008


On Oct 6, 10:16 am, brasse <thebra... at gmail.com> wrote:
> 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



More information about the Python-list mailing list