このスレッドは、64ビットcentosに32ビットpython用のpython readlineをインストールしているときに、同じ「LONGBIT」エラーの答えを探しているのを見つけました。リンクには直接の答えがないので、答えをさらにグーグルで検索する必要がありました(経験豊富なLinuxユーザー/開発者にとっては簡単かもしれません)。将来の参考のために、解決策はCFLAGS環境変数で「-m32」を使用して32ビットを強制することです。
bash-3.2$ easy_install readline
Searching for readline
Reading http://pypi.python.org/simple/readline/
Reading http://www.python.org/
Best match: readline 2.6.4
Downloading http://pypi.python.org/packages/source/r/readline/readline-2.6.4.tar.gz#md5=7568e8b78f383443ba57c9afec6f4285
Processing readline-2.6.4.tar.gz
Running readline-2.6.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-mqr9wH/readline-2.6.4/egg-dist-tmp-p3apfF
In file included from /usr/local/python2.6/include/python2.6/Python.h:58,
from Modules/readline.c:8:
/usr/local/python2.6/include/python2.6/pyport.h:685:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
error: Setup script exited with error: command 'gcc' failed with exit status 1
次に、CFLAGS=-m32で試してみました。
bash-3.2$ CFLAGS=-m32 easy_install readline
Searching for readline
Reading http://pypi.python.org/simple/readline/
Reading http://www.python.org/
Best match: readline 2.6.4
Downloading http://pypi.python.org/packages/source/r/readline/readline-2.6.4.tar.gz#md5=7568e8b78f383443ba57c9afec6f4285
Processing readline-2.6.4.tar.gz
Running readline-2.6.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-uauVci/readline-2.6.4/egg-dist-tmp-YY0tQa
In file included from /usr/include/features.h:352,
from /usr/include/limits.h:27,
from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:122,
from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:7,
from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:11,
from /usr/local/python2.6/include/python2.6/Python.h:19,
from Modules/readline.c:8:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
error: Setup script exited with error: command 'gcc' failed with exit status 1
最新のエラーは、32ビット用のglibc-develパッケージがないことが原因です(このスレッドに感謝します)。また、ncurses-devel.i386をインストールする必要があり、その後easy_installが実行され、ipythonがそれを認識しました。ipythonのためにこれを機能させるまで、私の人生は台無しに感じました。
bash-3.2$ CFLAGS=-m32 easy_install readline
Searching for readline
Reading http://pypi.python.org/simple/readline/
Reading http://www.python.org/
Best match: readline 2.6.4
Downloading http://pypi.python.org/packages/source/r/readline/readline-2.6.4.tar.gz#md5=7568e8b78f383443ba57c9afec6f4285
Processing readline-2.6.4.tar.gz
Running readline-2.6.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-dHly4D/readline-2.6.4/egg-dist-tmp-oIEDYl
Adding readline 2.6.4 to easy-install.pth file
Installed /home/hari/bin/python/lib/python2.6/site-packages/readline-2.6.4-py2.6-linux-x86_64.egg
Processing dependencies for readline
Finished processing dependencies for readline