473,324 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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

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:an*******@cvs.sourceforge.net:/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

--
Matej Kenda, HERMES SoftLab d.d., Slovenia
Jul 18 '05 #1
1 1909
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
wa*******@yahoo.com
Matej Kenda wrote:
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:an*******@cvs.sourceforge.net:/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

--
Matej Kenda, HERMES SoftLab d.d., Slovenia


Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Hugo | last post by:
I have a dual boot machine, runs Win XP pro and Win XP Pro 64, XP boots from C and XP 64 boots from D. They both have VS 2005 Beta 2 installed. I have a webapp developed in Win XP (32) which...
56
by: Dave Vandervies | last post by:
I just fixed a bug that some of the correctness pedants around here may find useful as ammunition. The problem was that some code would, very occasionally, die with a segmentation violation...
0
by: Hugo | last post by:
I have a dual boot machine, runs Win XP pro and Win XP Pro 64, Win XP boots from C and Win XP 64 boot from D. They both have VS 2005 Beta 2 installed. I have a webapp developed in Win XP (32)...
10
by: krunalb | last post by:
Hi, I am trying to shift unsigned long long value by 64 bits and this is what i get #include <stdio.h> int main() { unsigned short shiftby= 64;
1
by: =?Utf-8?B?UGF1bCBQaGlsbGlwcw==?= | last post by:
I have read many things about this but I haven't got a clear vision on what to do if anything about this. I have a system that tries to find holes in my web site. One of the things it has...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.