PARTIAL SOLUTION: Compiling Python 2.2 with GCC in HPUX 10.20 does not work
pekka niiranen
krissepu at vip.fi
Fri Mar 8 03:27:08 EST 2002
First of all, thank you guys for your help.
I managed to compile Python 2.2 in HP-UX 10.20 with the following hacks:
1) I downloaded and installed from http://hpux.connect.org.uk/ the
following
dynamically linked precompiled software depots:
binutils 2.11.2
gcc 3.0.1
make 3.79.1
These all installed automatically into /opt -directory, since I used
"swinstall -s" -command:
swinstall -s make-3.79.1-sd-10.20.depot make
2) I also downloaded from http://hpux.connect.org.uk/ HP's sources
for ncurses-5.2
HP-UX Source Code (gzipped) [HTTP] [FTP]
(Size: 1.74 MB, Archived: 12 Jan 2001, View contents)
and unzipped+tared it to a temporary directory.
3) I removed HP's default compiler's location /usr/css/bin from my
/etc/PATH -file
and changed the link in /usr/bin to point to installed gmake:
/usr/bin/make@ -> /opt/make/bin/gmake
I also added /opt/make/bin and /opt/gcc/bin to my PATH.
4) I configured ncurses with the following script:
#! /usr/bin/sh
unset LANG
TERM=vt100
gmake distclean
CC=gcc ./configure --with-gcc --with-shared --without-cxx
--prefix=/usr/local --without-ada --without-debug
5) I edited the resulting Makefile in subdirectory
ncurses-5.2/ncurses by adding the -fpic variable to line 96:
CFLAGS_SHARED = $(CCFLAGS) -fPIC -fpic
6) I compiled and installed ncurses with commands:
make
make install
My /usr/local/lib/ -directory:
libcurses.sl@ -> libncurses.sl
104294 Mar 8 08:41 libform.a
102955 Mar 8 08:41 libform.sl*
52572 Mar 8 08:41 libmenu.a
49377 Mar 8 08:41 libmenu.sl*
531110 Mar 8 08:41 libncurses.a
595297 Mar 8 08:41 libncurses.sl*
20948 Mar 8 08:41 libpanel.a
20538 Mar 8 08:41 libpanel.sl*
terminfo@ -> ../share/terminfo
My /usr/local/include/ -directory:
60691 Mar 8 08:41 curses.h
2825 Mar 8 08:41 eti.h
16091 Mar 8 08:41 form.h
10951 Mar 8 08:41 menu.h
ncurses.h@ -> curses.h
3434 Mar 8 08:41 panel.h
3168 Mar 8 08:41 termcap.h
36954 Mar 8 08:41 term.h
2957 Mar 8 08:41 unctrl.h
7) Python-2.2 source I edited by adding line "int h_errno;" to
Modules/socketmodule.c at line 161 just above the
'#ifndef RISCOS' block:
int h_errno;
#ifndef RISCOS
#include <fcntl.h>
#else
#include <sys/fcntl.h>
#define NO_DUP
int h_errno; /* not used */
#endif
#else
8) I configured python with script:
#! /usr/bin/sh
unset LANG
gmake distclean
CC=gcc ./configure --with-gcc --with-threads=no --without-cxx
--prefix=/opt/python
gmake
9) When running "gmake test", I still get error:
test test_fpformat failed -- Traceback (most recent call last):
File "./Lib/test/test_fpformat.py", line 51, in test_reasonable_values
self.checkFix(realVal, d)
File "./Lib/test/test_fpformat.py", line 28, in checkFix
self.assertEquals(result, expected)
File
"/osasto/home/niirape/python_softa/Python-2.2/Lib/unittest.py", line
286, in failUnlessEqual
raise self.failureException, \
AssertionError: '-0' != '0'
And summary looks like:
1 test failed: test_fpformat
33 tests skipped:
test_al test_asynchat test_bsddb test_cd test_cl test_curses
test_dl test_fork1 test_gdbm test_gl test_gzip test_imgfile
test_largefile test_linuxaudiodev test_locale test_minidom
test_nis test_ntpath test_openpty test_pyexpat test_sax
test_socket_ssl test_socketserver test_sunaudiodev test_thread
test_threaded_import test_threadedtempfile test_threading
test_unicode_file test_winreg test_winsound test_zipfile test_zlib
Ask someone to teach regrtest.py about which tests are
expected to get skipped on hp-ux10.
make: *** [test] Error 1
10) After gmake install python starts OK. Maybe it is OK now ;).
-pekka-
More information about the Python-list
mailing list