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 harripasanen
Recipients
Date 2004-11-23.10:30:50
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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 
 
 
 
History
Date User Action Args
2007-08-23 14:27:45adminlinkissue1071597 messages
2007-08-23 14:27:45admincreate