Compiling Python 2.7a2 on AIX6.1 (also pycrypto)

knipknap knipknap at gmail.com
Wed Jan 13 12:13:22 CET 2010


Hi,

I have just successfully compiled Python 2.7a2 on AIX6.1, using the
IBM XL compiler (no gcc). I am documenting this here in case somebody
needs it:

#######
First, I installed the following dependencies:

1. readline-6.1;
2. tcl8.4.19/unix/
3. tk8.4.19/unix/
4. zlib-1.2.3

All of these compiled without a problem using

  ./configure && make && make install

#######
Second, the Python installation procedure. Here is the patch, see
below for comments:

http://pastebin.com/f1569d184

1. cd Python-2.7a2

2. cp Modules/Setup.dist Modules/Setup

3. vi Modules/Setup
   - Edit the path flags to the tcl and tk libraries (see the below
patch for an example)
   - Add the following flags: -ltk8.4 -ltcl8.4 -lld -lX11

4. Apply the below patch to "configure". This adds AIX6 support.

5. vi Modules/ld_so_aix: Set the following CCOPT variable
     CCOPT="$CCOPT -Wl,-bM:SRE -Wl,-T512 -Wl,-H512 -Wl,-brtl -Wl,-
bnortllib -lm -lbsd -o $objfile"
   Note that the alternate CCOPT variable that is mentioned in the
comments of that file does NOT work, so just use this instead.

6. ./configure && make && make install

Done. Caveats: The following modules did not work:

   _bsddb _ctypes bz2 gdbm.

However, since we do not need them I did not attempt to debug them.

#######
Third, we also needed pycrypto. Here are the instructions:

 - cd pycrypto-2.0.1
 - In src/SHA256.c, remove all lines starting with "//".
 - python2.7 setup.py build && python2.7 setup.py install --prefix /
usr/local

Hope this helps,
-Samuel



More information about the Python-list mailing list