This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Jason.Vas.Dias
Recipients Jason.Vas.Dias, georg.brandl, r.david.murray
Date 2011-04-30.13:22:15
SpamBayes Score 2.7425534e-08
Marked as misclassified No
Message-id <1304169737.07.0.129174618244.issue11946@psf.upfronthosting.co.za>
In-reply-to
Content
OK, the last two comment contained complete instructions for setting
up a working dual 64-bit + 32-bit python installation.

Final, working /usr/bin/python :

$ cat /usr/bin/python
#!/bin/sh
ME=$0
ME=${ME##*/}
VERSION=${ME#python}
VERSION=${VERSION:-2.7}
ARCH=`uname -m`
case $ARCH in
  i686)
     exec /usr/bin/32/${ME} $*
     ;;
  *)
     exec /usr/bin/python${VERSION} $*
     ;;
esac

So now, in a native 64-bit env :

$ python
Python 2.7.1 (r271:86832, Apr 30 2011, 11:55:52)
[GCC 4.6.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
^D
$ setarch i686
$ python
Python 2.7.1 (r271:86832, Apr 30 2011, 13:29:12)
[GCC 4.6.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

See the build times, they are different executables !

And final, complete working /usr/include/python2.7/pyconfig.h :

$ echo '#include <python2.7/pyconfig.h>' > pyc.c
$ cpp pyc.c
$ cpp pyc.c
# 1 "pyc.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "pyc.c"
# 1 "/usr/include/python2.7/pyconfig.h" 1 3 4



# 1 "/usr/include/python2.7/64/pyconfig.h" 1 3 4
# 5 "/usr/include/python2.7/pyconfig.h" 2 3 4
# 1 "pyc.c" 2
$ cpp -m32 pyc.c
# 1 "pyc.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "pyc.c"
# 1 "/usr/include/python2.7/pyconfig.h" 1 3 4

# 1 "/usr/include/python2.7/32/pyconfig.h" 1 3 4
# 3 "/usr/include/python2.7/pyconfig.h" 2 3 4
# 1 "pyc.c" 2


$ cat /usr/include/python2.7/pyconfig.h
#ifdef __i386__
#include <python2.7/32/pyconfig.h>
#else
#include <python2.7/64/pyconfig.h>
#endif
History
Date User Action Args
2011-04-30 13:22:17Jason.Vas.Diassetrecipients: + Jason.Vas.Dias, georg.brandl, r.david.murray
2011-04-30 13:22:17Jason.Vas.Diassetmessageid: <1304169737.07.0.129174618244.issue11946@psf.upfronthosting.co.za>
2011-04-30 13:22:16Jason.Vas.Diaslinkissue11946 messages
2011-04-30 13:22:15Jason.Vas.Diascreate