wiki:Python

Python

Build a profile guided optimization version of Python (0-30% better performance) with:
LD_LIBRARY_PATH=$(pwd) make profile-opt

blfs: svn-20070331

make test failed until this configure was used: LDFLAGS="-L." ./configure --prefix=/usr --enable-shared

Multilib Instructions

Patch for Multilib Support http://www.linuxfromscratch.org/patches/downloads/Python/Python-2.4.2-multilib-1.patch

32 Bit

Add the following before configure to build as 32 bit
For Most Architectures use CC="gcc -m32" CXX="g++ -m32"
For MIPS use CC="gcc -mabi=32" CXX="g++ -mabi=32"

Follow the instructions from the BLFS Book
http://www.linuxfromscratch.org/blfs/view/cvs/general/python.html

N32 - MIPS only

patch -Np1 -i ../Python-2.4.2-multilib-1.patch &&
sed -i -e "s:@@MULTILIB_DIR@@:lib32:g" \
        Lib/distutils/command/install.py \
        Lib/distutils/sysconfig.py \
        Lib/site.py \
        Makefile.pre.in \
        Modules/Setup.dist \
        Modules/getpath.c \
        setup.py

Add the following before configure to build as N32
For MIPS use CC="gcc -mabi=n32" CXX="g++ -mabi=n32"

To complete follow instructions from the BLFS Book
Follow the instructions from the BLFS Book
http://www.linuxfromscratch.org/blfs/view/cvs/general/python.html

64 Bit

patch -Np1 -i ../Python-2.4.2-multilib-1.patch &&
sed -i -e "s:@@MULTILIB_DIR@@:lib64:g" \
        Lib/distutils/command/install.py \
        Lib/distutils/sysconfig.py \
        Lib/site.py \
        Makefile.pre.in \
        Modules/Setup.dist \
        Modules/getpath.c \
        setup.py

Add the following before configure to build as 64 bit
For Most Architectures use CC="gcc -m64" CXX="g++ -m64"
For MIPS use CC="gcc -mabi=64" CXX="g++ -mabi=64"

To complete follow instructions from the BLFS Book
Follow the instructions from the BLFS Book
http://www.linuxfromscratch.org/blfs/view/cvs/general/python.html

Python 2.7.2 Test Suite

  • Additional tests that are skipped by "make test" can be run by doing "make testall".
  • tests should be run as root otherwise you will get some failures

Python 2.7.2 and GDBM

  • If you are building with LFS 7.1, you will get a test failure in test_anydbm is easy due to this bug http://bugs.python.org/issue13007. The fix is to add 3 numbers to one file.
  • Assuming that you don't ndbm installed then according to http://bugs.python.org/issue9420, the sed used in the BLFS book is wrong. The sed will force dbm module to be built using ndbm, when in reality it should be built by gdbm.

Up
Top

Last modified 9 years ago Last modified on 04/08/2012 06:46:44 PM
Note: See TracWiki for help on using the wiki.