[ python-Bugs-1071597 ] configure problem on HP-UX 11.11
SourceForge.net
noreply at sourceforge.net
Wed Jan 5 15:46:21 CET 2005
Bugs item #1071597, was opened at 2004-11-23 10:30
Message generated for change (Comment added) made by harripasanen
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1071597&group_id=5470
Category: Build
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Harri Pasanen (harripasanen)
Assigned to: Nobody/Anonymous (nobody)
Summary: configure problem on HP-UX 11.11
Initial Comment:
Python 2.4c1 has this problem (but if I recall, so did 2.3.3)_
Using gcc 3.3.3 to build on HP-UX 11.11, the
configure out of the box is a bit off, resulting in a failed build, due
to missing thread symbols:
/usr/ccs/bin/ld: Unsatisfied symbols:
PyThread_acquire_lock (first referenced in
libpython2.4.a(import.o)) (code)
PyThread_exit_thread (first referenced in
libpython2.4.a(threadmodule.o)) (code)
PyThread_allocate_lock (first referenced in
libpython2.4.a(import.o)) (code)
PyThread_free_lock (first referenced in
libpython2.4.a(threadmodule.o)) (code)
PyThread_start_new_thread (first referenced in
libpython2.4.a(threadmodule.o)) (code)
PyThread_release_lock (first referenced in
libpython2.4.a(import.o)) (code)
PyThread_get_thread_ident (first referenced in
libpython2.4.a(import.o)) (code)
PyThread__init_thread (first referenced in
libpython2.4.a(thread.o)) (code)
collect2: ld returned 1 exit status
A workaround is to manually edit pyconfig.h, adding
#define _POSIX_THREADS
(The reason it is not picked up is that unistd.h on HP-UX has this
comment:
/************************************************************************
* The following defines are specified in the standard, but are not
yet
* implemented:
*
* _POSIX_THREADS can't be defined until all
* features are implemented
)
The implementation seems however to be sufficiently complete
to permit compiling and running Python with _POSIX_THREADS.
While I'm editing pyconfig.h, I also comment out
_POSIX_C_SOURCE definition, as it will result in lots of
compilation warnings, of the style:
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I../Python-2.4c1/Include
-DPy_BUILD_CORE -o
Objects/frameobject.o ../Python-2.4c1/Objects/frameobject.c
In file included from ../Python-2.4c1/Include/Python.h:8,
from ../Python-2.4c1/Objects/frameobject.c:4:
pyconfig.h:835:1: warning: "_POSIX_C_SOURCE" redefined
<command line>:6:1: warning: this is the location of the
previous definition
------------
So, to recapitulate: After configure, add
#define _POSIX_THREADS
and comment out
#define _POSIX_C_SOURCE 200112L
That will give you a Python working rather well,
with "make test" producing:
251 tests OK.
1 test failed:
test_pty
38 tests skipped:
test_aepack test_al test_applesingle test_bsddb
test_bsddb185
test_bsddb3 test_cd test_cl test_codecmaps_cn
test_codecmaps_hk
test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw
test_curses
test_dl test_gdbm test_gl test_imgfile test_largefile
test_linuxaudiodev test_locale test_macfs test_macostools
test_nis
test_normalization test_ossaudiodev test_pep277 test_plistlib
test_scriptpackages test_socket_ssl test_socketserver
test_sunaudiodev test_tcl test_timeout test_urllib2net
test_urllibnet test_winreg test_winsound
1 skip unexpected on hp-ux11:
test_tcl
----------------------------------------------------------------------
>Comment By: Harri Pasanen (harripasanen)
Date: 2005-01-05 14:46
Message:
Logged In: YES
user_id=77088
_POSIX_C_SOURCE appears to come from the gcc driver, along with a
few other macros.
If I add "-v" to compilation, the output expands to:
Reading specs
from /usr/local/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.3.3/specs
Configured
with: /scratch/zack/pkgbuild/3.3.1/hpux-11/gcc-3.3.3/configure
--enable-languages=c,c++ --enable-threads=posix --disable-nls
--with-gnu-as --without-gnu-ld --with-as=/usr/local/bin/as
--prefix=/usr/local
Thread model: posix
gcc version 3.3.3
/usr/local/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.3.3/cc1 -quiet -v -I.
-I./Include -D__GNUC__=3 -D__GNUC_MINOR__=3
-D__GNUC_PATCHLEVEL__=3 -D_REENTRANT -D_THREAD_SAFE
-D_POSIX_C_SOURCE=199506L -DNDEBUG -DPy_BUILD_CORE
Modules/python.c -quiet -dumpbase python.c -auxbase-strip
Modules/python.o -g -O3 -Wall -Wstrict-prototypes -version
-fno-strict-aliasing -o /var/tmp//ccLnAhZ0.s
GNU C version 3.3.3 (hppa2.0w-hp-hpux11.11)
compiled by GNU C version 3.3.3.
GGC heuristics: --param ggc-min-expand=100 --param
ggc-min-heapsize=131072
ignoring nonexistent directory
"/usr/local/hppa2.0w-hp-hpux11.11/include"
#include "..." search starts here:
#include <...> search starts here:
.
Include
/usr/local/include
/usr/local/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.3.3/include
/usr/include
End of search list.
In file included from Include/Python.h:8,
from Modules/python.c:3:
pyconfig.h:835:1: warning: "_POSIX_C_SOURCE" redefined
<command line>:6:1: warning: this is the location of the previous
definition
/usr/local/bin/as --traditional-format -o
Modules/python.o /var/tmp//ccLnAhZ0.s
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2004-12-23 23:50
Message:
Logged In: YES
user_id=21627
Can you find out why gcc says that "_POSIX_C_SOURCE" is
defined on the command line? On the command line you
provide, it isn't.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1071597&group_id=5470
More information about the Python-bugs-list
mailing list