64-bit Python 2.3.latest on HP-UX 11.23: success

M

Matej Kenda

Hi all,

This message is to let you know that I have successfully compiled the latest
sources from the 2.3 branch on the abovementioned OS using the HP ansiC
compiler version 5.50.

Final status: success, it works fine

---

The procedure:

1. Get the latest sources of 2.3

cvs -z3 -d:pserver:[email protected]:/cvsroot/python co -r \
release23-maint python

2. Install the 64-bit OpenSSH downloaded from HP

3. Run configure script with additional CFLAGS

export CFLAGS="-Ae +DD64 -mt -O0 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
"
../configure --prefix=/usr/local/aCCPython


4. Edit Makefile to add support for 64-bit compilation and turn off
optimisation.

I got the hint to remove the optimisation in the README file. I didn't try
to turn the optimisation on, but it may work with the recent ansiC
compiler.

Diff between the generated Makefile and modified one:

# Compiler options
-OPT= -DNDEBUG -O
-BASECFLAGS=
+OPT= -O0
+BASECFLAGS= +DD64 -mt
CFLAGS= $(BASECFLAGS) $(OPT)
-CPPFLAGS= -I. -I$(srcdir)/Include
-LDFLAGS=
+CPPFLAGS= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I.
-I$(srcdir)/Include
+LDFLAGS= +DD64 -mt
-LINKFORSHARED= -Wl,-E -Wl,+s
+LINKFORSHARED= -Wl,-E -Wl,-s +DD64
# Extra C flags added for building the interpreter object files.
-CFLAGSFORSHARED=
+CFLAGSFORSHARED= +z

5. Edit the pyconfig.h file to enable posix threads

6. Edit the setup.py to avoid using installed 32-bit libraries

Index: setup.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/setup.py,v
retrieving revision 1.171.6.2
diff -u -r1.171.6.2 setup.py
--- setup.py 21 Oct 2003 20:01:21 -0000 1.171.6.2
+++ setup.py 24 Sep 2004 08:16:24 -0000
@@ -591,7 +591,8 @@

# The standard Unix dbm module:
if platform not in ['cygwin']:
- if find_file("ndbm.h", inc_dirs, []) is not None:
+# if find_file("ndbm.h", inc_dirs, []) is not None:
+ if None is not None:
# Some systems have -lndbm, others don't
if self.compiler.find_library_file(lib_dirs, 'ndbm'):
ndbm_libs = ['ndbm']
@@ -698,7 +699,8 @@
#
# You can upgrade zlib to version 1.1.4 yourself by going to
# http://www.gzip.org/zlib/
- zlib_inc = find_file('zlib.h', [], inc_dirs)
+# zlib_inc = find_file('zlib.h', [], inc_dirs)
+ zlib_inc = None
if zlib_inc is not None:
zlib_h = zlib_inc[0] + '/zlib.h'
version = '"0.0.0"'


7. run gmake all install

---

Issues:

1. The following line makes a lot of warnings when compiling, because it
looks like the HP compiler already sets this:

/* Define to activate features from IEEE Stds 1003.1-2001 */
#define _POSIX_C_SOURCE 200112L

2. Shared library extensions for modules

The ELF libraries on HP-UX should have the extension .so. I tries to change
the library extension from .sl to .so. However, the install scrips searched
for files with the .sl extension anyway. I didn't dig deep to solve this
issue, because the library extensions aren't that important for me at this
point.

---

I can send the Makefile and the pyconfig.h that I used to compile
the Python to anyone interested.


Best regards,

Matej
 
J

Jhy-Chun Wang

Matej,

Could you send me the Makefile and pyconfig.h you used for 64bit build?
although I will be trying it on Solaris, anything related to 64bit build
helps.

Thanks,

Jhychun Wang
(e-mail address removed)


Matej said:
Hi all,

This message is to let you know that I have successfully compiled the latest
sources from the 2.3 branch on the abovementioned OS using the HP ansiC
compiler version 5.50.

Final status: success, it works fine

---

The procedure:

1. Get the latest sources of 2.3

cvs -z3 -d:pserver:[email protected]:/cvsroot/python co -r \
release23-maint python

2. Install the 64-bit OpenSSH downloaded from HP

3. Run configure script with additional CFLAGS

export CFLAGS="-Ae +DD64 -mt -O0 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
"
./configure --prefix=/usr/local/aCCPython


4. Edit Makefile to add support for 64-bit compilation and turn off
optimisation.

I got the hint to remove the optimisation in the README file. I didn't try
to turn the optimisation on, but it may work with the recent ansiC
compiler.

Diff between the generated Makefile and modified one:

# Compiler options
-OPT= -DNDEBUG -O
-BASECFLAGS=
+OPT= -O0
+BASECFLAGS= +DD64 -mt
CFLAGS= $(BASECFLAGS) $(OPT)
-CPPFLAGS= -I. -I$(srcdir)/Include
-LDFLAGS=
+CPPFLAGS= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I.
-I$(srcdir)/Include
+LDFLAGS= +DD64 -mt
-LINKFORSHARED= -Wl,-E -Wl,+s
+LINKFORSHARED= -Wl,-E -Wl,-s +DD64
# Extra C flags added for building the interpreter object files.
-CFLAGSFORSHARED=
+CFLAGSFORSHARED= +z

5. Edit the pyconfig.h file to enable posix threads

6. Edit the setup.py to avoid using installed 32-bit libraries

Index: setup.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/setup.py,v
retrieving revision 1.171.6.2
diff -u -r1.171.6.2 setup.py
--- setup.py 21 Oct 2003 20:01:21 -0000 1.171.6.2
+++ setup.py 24 Sep 2004 08:16:24 -0000
@@ -591,7 +591,8 @@

# The standard Unix dbm module:
if platform not in ['cygwin']:
- if find_file("ndbm.h", inc_dirs, []) is not None:
+# if find_file("ndbm.h", inc_dirs, []) is not None:
+ if None is not None:
# Some systems have -lndbm, others don't
if self.compiler.find_library_file(lib_dirs, 'ndbm'):
ndbm_libs = ['ndbm']
@@ -698,7 +699,8 @@
#
# You can upgrade zlib to version 1.1.4 yourself by going to
# http://www.gzip.org/zlib/
- zlib_inc = find_file('zlib.h', [], inc_dirs)
+# zlib_inc = find_file('zlib.h', [], inc_dirs)
+ zlib_inc = None
if zlib_inc is not None:
zlib_h = zlib_inc[0] + '/zlib.h'
version = '"0.0.0"'


7. run gmake all install

---

Issues:

1. The following line makes a lot of warnings when compiling, because it
looks like the HP compiler already sets this:

/* Define to activate features from IEEE Stds 1003.1-2001 */
#define _POSIX_C_SOURCE 200112L

2. Shared library extensions for modules

The ELF libraries on HP-UX should have the extension .so. I tries to change
the library extension from .sl to .so. However, the install scrips searched
for files with the .sl extension anyway. I didn't dig deep to solve this
issue, because the library extensions aren't that important for me at this
point.

---

I can send the Makefile and the pyconfig.h that I used to compile
the Python to anyone interested.


Best regards,

Matej
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top