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.

Title: configure problem on HP-UX 11.11
Type: Stage:
Components: Build Versions:
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: cbeatley, georg.brandl, harripasanen, loewis, sf-robot
Priority: normal Keywords:

Created on 2004-11-23 10:30 by harripasanen, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (7)
msg23274 - (view) Author: Harri Pasanen (harripasanen) Date: 2004-11-23 10:30
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  
(The reason it is not picked up is that unistd.h on HP-UX has this 
 * The following defines are specified in the standard, but are not 
 * 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  
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  
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: 
38 tests skipped: 
    test_aepack test_al test_applesingle test_bsddb 
    test_bsddb3 test_cd test_cl test_codecmaps_cn 
    test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw 
    test_dl test_gdbm test_gl test_imgfile test_largefile 
    test_linuxaudiodev test_locale test_macfs test_macostools 
    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: 
msg23275 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-12-23 23:50
Logged In: YES 

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.
msg23276 - (view) Author: Harri Pasanen (harripasanen) Date: 2005-01-05 14:46
Logged In: YES 

_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 
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 
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 
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 
ignoring nonexistent directory 
#include "..." search starts here: 
#include <...> search starts here: 
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 
 /usr/local/bin/as --traditional-format -o 
Modules/python.o /var/tmp//ccLnAhZ0.s 
msg23277 - (view) Author: Harri Pasanen (harripasanen) Date: 2005-01-06 11:01
Logged In: YES 

Note that the _POSIX_C_SOURCE is also defined for gcc 3.4.3 on 
HP-UX 11.23 (Itanium).   I don't know if it defined for all the gcc 
platforms, as it would only show up if the definition in pyconfig.h is 
different from what the gcc driver uses. 
msg23278 - (view) Author: Cameron Beatley (cbeatley) Date: 2005-06-15 20:18
Logged In: YES 

I have the same problems. When I edit the pyconfig.h file as 
described and run Make again, I get the following

Traceback (most recent call last):
  File "./", line 1184, in ?
  File "./", line 1178, in main
    scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
  File "/CVS/apps/Python-2.4.1/Lib/distutils/", line 
123, in setup
  File "/CVS/apps/Python-2.4.1/Lib/distutils/", line 339, 
in parse_config_files
    filenames = self.find_config_files()
  File "/CVS/apps/Python-2.4.1/Lib/distutils/", line 302, 
in find_config_files
  File "/CVS/apps/Python-2.4.1/Lib/distutils/", line 155, 
in check_environ
    import pwd
ImportError: No module named pwd
*** Error exit code 1

any idea what THIS is?
msg23279 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-02-20 10:27
Logged In: YES 

cbeatley: your problem should be fixed as the pwd module is
now builtin.

OP: do you still have problems with recent releases?
msg23280 - (view) Author: SourceForge Robot (sf-robot) Date: 2006-03-07 03:25
Logged In: YES 

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
Date User Action Args
2022-04-11 14:56:08adminsetgithub: 41215
2004-11-23 10:30:50harripasanencreate