This
Note: You do need this file, even if you have download an objects distribution,
because the Python library is stored in 'pyth151.tgz'!
If possible, the PYVMS distribution (see below) will contain all
available patches. Please check the 'patches'
The Python documentation is there, too. Please access http://www.python.org/ for downloading.
The whole translation and compilation process took about 4 hours on
a VAXstation 3100/GPX!
27-MAR-1999 - the Posix part has not been tested / kept up to date.
You might need a patch to the DEC C RTL. Please see the description
of patch VAXACRT11_061
Uncomment the following lines in CONFIG.H
Uncomment the following line in PYTHON.OPT
(Re)compile all modules:
The following two modules need to be compiled, too
Link the executable
Test it
get the necessary software
the Python
distribution is available at:
ftp://ftp.python.org/ftp/python/src/pyth151.tgz
or from one of the mirror sites. Don't forget to do a 'binary' transfer!
Store the file as 'PYTHON1_5_1.TAR-GZ
' on your
OpenVMS system.
get the
PYVMS distribution from:
http://www.decus.de/~zessin/kits/pyvms1_5_1-v008src.zip
Don't forget to do a 'binary' transfer! Store the file as
'PYVMS1_5_1-V008SRC.ZIP
' on your
OpenVMS system.
you also need the following tools...
PYTHON1_5_1.TAR-GZ
'
and PYVMS1_5_1-V008SRC.ZIP
':
Sources are listed
create the root directory and restore the Python
distribution
This example assumes that the tree will be stored on a disk named
'DKA100:
'. It also assumes that the files
'PYTHON1_5_1.TAR-GZ
', 'PYVMS1_5_1-V008SRC.ZIP
' and
the necessary tools (GZIP.EXE, UNZIP.EXE + VMSTAR.EXE) have been stored at
'DKB100:[000000]
'.
$! -- create top-level directory
$ SET DEFAULT DKA100:[PYTHON]
$ CREATE /DIRECTORY /OWNER=[1,4] /PROTECTION=(G:RE,W:RE) /LOG []
$!
$! -- define foreign command for GZIP
$ gzip = "$DKB100:[000000]GZIP.EXE"
$!
$! -- extract/decompress TapeARchive from GZIPped file
$ DEFINE /USER_MODE SYS$OUTPUT DKB100:[000000]PYTHON1_5_1.TAR
$ gzip -d -c DKB100:[000000]PYTHON1_5_1.TAR-GZ
$!
$! -- remove definition
$ DELETE /SYMBOL/LOCAL gzip
$!
$! -- define foreign command for VMSTAR
$ vmstar = "$DKB100:[000000]VMSTAR.EXE"
$!
$! -- list contents of TapeARchive
$ DEFINE /USER_MODE SYS$OUTPUT PYTHON1_5_1.LIS
$ vmstar tf DKB100:[000000]PYTHON1_5_1.TAR
$!
$! -- extract files from TapeARchive and restore directory tree
$ SET PROTECTION= (S:RWED,O:RWED,G:RE,W:RE) /DEFAULT
$ DEFINE /USER_MODE SYS$OUTPUT PYTHON1_5_1.UNTAR
$ vmstar xvf DKB100:[000000]PYTHON1_5_1.TAR
$!
$! -- remove definition
$ DELETE /SYMBOL/LOCAL vmstar
$!
$! -- delete the TapeARchive - please keep PYTHON1_5_1.TAR-GZ
$ DELETE /LOG DKB100:[000000]PYTHON1_5_1.TAR;*
$!
$! -- make all files readable to all users
$ SET FILE /PROTECTION=(G:RE,W:RE) /OWNER=[1,4] [PYTHON...]*.* /LOG
$!
$! -- Note: some versions of VMSTAR restore the tree as:
$! -- [PYTHON.PYTHON-1.5.1...] instead of [PYTHON.PYTHON-1_5_1]
$! -- The fix is to enter the following two commands:
$ rename [PYTHON.PYTHON-1.5]1.DIR [PYTHON]PYTHON-1_5_1
$ delete [PYTHON.PYTHON-1]5.DIR;1,[PYTHON]PYTHON-1.DIR;1
$!
$! -- correct file specifications in output file
$ edit/edt [PYTHON]PYTHON1_5_1.UNTAR
* substitute/PYTHON.PYTHON-1.5.1/PYTHON.PYTHON-1_5_1/%whole/notype
* exit
$ purge [PYTHON]PYTHON1_5_1.UNTAR
$!
create additional directories
The intention is to keep the original directories as much unchanged as possible.
$ SET DEFAULT DKA100:[PYTHON.PYTHON-1_5_1.VMS]
$ CREDIR = "CREATE/DIRECTORY/OWNER=[1,4]/PROTECTION=(G:RE,W:RE)/LOG"
$!
$ CREDIR []
$ CREDIR [.O_ALPHA.MODULES]
$ CREDIR [.O_ALPHA.OBJECTS]
$ CREDIR [.O_ALPHA.PARSER]
$ CREDIR [.O_ALPHA.PYTHON]
$ CREDIR [.O_ALPHA.VMS]
$ CREDIR [.O_ALPHA.VMS_TOOLS]
$ CREDIR [.O_VAX.MODULES]
$ CREDIR [.O_VAX.OBJECTS]
$ CREDIR [.O_VAX.PARSER]
$ CREDIR [.O_VAX.PYTHON]
$ CREDIR [.O_VAX.VMS]
$ CREDIR [.O_VAX.VMS_TOOLS]
$ CREDIR [.TMP]
$!
All other directories will automatically be created during the restore of the
PYVMS distribution.
decompress+extract the PYVMS distribution
$! -- create a temporary directory tree
$ set DEFAULT DKA100:[PYVMS_TMP]
$ CREATE /DIRECTORY /OWNER=[1,4] /PROTECTION=(G:RE,W:RE) /LOG []
$!
$! -- define foreign command for UNZIP
$ unzip = "$DKB100:[000000]UNZIP.EXE"
$!
$! -- list contents of .ZIP file
$ DEFINE /USER_MODE SYS$OUTPUT [PYTHON]PYVMS1_5_1-V008SRC.LIS
$ unzip -l DKB100:[000000]PYVMS1_5_1-V008SRC.ZIP
$!
$! -- extract/decompress files/directories from ZIPped file
$ SET PROTECTION= (S:RWED,O:RWED,G:RE,W:RE) /DEFAULT
$ DEFINE /USER_MODE SYS$OUTPUT DKB100:[000000]PYVMS1_5_1-V008SRC.UNZIP
$ unzip -e DKB100:[000000]PYVMS1_5_1-V008SRC.ZIP
$!
$! -- remove definition
$ DELETE /SYMBOL/LOCAL unzip
$!
$! -- make all files readable to all users
$ SET FILE /PROTECTION=(G:RE,W:RE) /OWNER=[1,4] [PYVMS_TMP...]*.* /LOG
$!
copy PYVMS tools from temp-tree
Some tools from the PYVMS distribution are needed now.
$ BACKUP DKA100:[PYVMS_TMP...]UNTAR2DATESET.C*, FILE_SET_DATE*.C* -
DKA100:[PYTHON...] /BY_OWNER=[1,4] /LOG
$!
build tool FILE_SET_DATE
$ set DEFAULT DKA100:[PYTHON.PYTHON-1_5_1.VMS.TOOLS]
$ @ FILE_SET_DATE-BUILD.COM
$!
set original date + time on files
... from the Python distribution
$ set DEFAULT [PYTHON.PYTHON-1_5_1.VMS]
$!
$! -- create command procedure to make calls to FILE_SET_DATE
$ @[.TOOLS]UNTAR2DATESET [PYTHON]PYTHON1_5_1.UNTAR -
[PYTHON.PYTHON-1_5_1.VMS.TMP]PYTHON1_5_1-DATESET.COM
$!
$ !+
$ ! check the output file which should look like:
$ ! [...]
$ ! $ SET VERIFY
$ ! $ FSD = "$ [...]
$ ! $ FSD [PYTHON.PYTHON-1.5B2]BUGS "10-APR-1995 11:47:32.00"
$ ! [...]
$ !
$ ! otherwise you have to change UNTAR2DATESET.COM ...
$ !-
$!
$! -- run created procedure to change files' date + time
$! -- save output for later inspection
$ @[.TMP]PYTHON1_5_1-DATESET.COM /OUTPUT= [.TMP]PYTHON1_5_1-DATESET.LOG
$!
$! -- check for any problems
$ SEARCH [.TMP]PYTHON1_5_1-DATESET.LOG "%" /WINDOW=(1,4)
$!
$! -- delete files
$ delete /LOG [.TMP]PYTHON1_5_1-DATESET.COM;*, -
[.TMP]PYTHON1_5_1-DATESET.LOG;*
$!
save some original files
These files will be replaced with modified ones from the PYVMS distribution.
A copy is made for easy access to the original files. BACKUP is used because
it retains the creation and revision date + time of the files.
The following type extensions are used:
*.*$O - original file, superceeded by a new one with changes for PYVMS
*.*$P - original file, superceeded by a new one with Python patches
*.*$OP - original file, superceeded by a new one with Python patches
AND changes for PYVMS
$ set DEFAULT [PYTHON.PYTHON-1_5_1.LIB]
$ BACKUP GZIP.PY, IMAPLIB.PY, SGMLLIB.PY, SOCKETSERVER.PY, -
STRING.PY, URLLIB.PY *.PY$P /BY_OWNER=ORIGINAL /LOG
$!
$ set DEFAULT [PYTHON.PYTHON-1_5_1.MODULES]
$ BACKUP MAIN.C, SELECTMODULE.C, SIGNALMODULE.C, SOCKETMODULE.C, -
_LOCALEMODULE.C *.C$O /BY_OWNER=ORIGINAL /LOG
$ BACKUP TIMEMODULE.C *.C$OP /BY_OWNER=ORIGINAL /LOG
$ BACKUP TIMING.H *.H$O /BY_OWNER=ORIGINAL /LOG
$ BACKUP PARSERMODULE.C, PYPCRE.C, STROPMODULE.C, ZLIBMODULE.C, -
_TKINTER.C *.C$P /BY_OWNER=ORIGINAL /LOG
$ BACKUP PCRE-INT.H, PCRE.H *.H$P /BY_OWNER=ORIGINAL /LOG
$!
$ set DEFAULT [PYTHON.PYTHON-1_5_1.OBJECTS]
$ BACKUP CLASSOBJECT.C, FILEOBJECT.C, LONGOBJECT.C, OBJECT.C, -
STRINGOBJECT.C *.C$P /BY_OWNER=ORIGINAL /LOG
$!
$ set DEFAULT [PYTHON.PYTHON-1_5_1.PYTHON]
$ BACKUP BLTINMODULE.C, CEVAL.C *.C$P /BY_OWNER=ORIGINAL /LOG
$ BACKUP IMPORT.C *.C$OP /BY_OWNER=ORIGINAL /LOG
$!
$ set DEFAULT [PYTHON.PYTHON-1_5_1.TOOLS.FREEZE]
$ BACKUP FREEZE.PY *.PY$P /BY_OWNER=ORIGINAL /LOG
$!
move PYVMS files
This copies the entire PYVMS distribution 'over' the Python directory tree.
$! -- delete tools from previous steps - will be recreated
$ set DEFAULT [PYTHON.PYTHON-1_5_1.VMS]
$ delete /LOG [...]UNTAR2DATESET.*;*, FILE_SET_DATE*.*;*
$!
$! -- copy PYVMS tree
$ SET DEFAULT [PYTHON]
$ BACKUP [PYVMS_TMP...]*.*; -
[PYTHON...]*.* /BY_OWNER=[1,4] /LOG /TRUNCATE /NEW_VERSION
$!
$! -- delete temporary directory tree
$ set FILE /PROTECTION=(O:RWED,W:RWED) -
[000000]PYVMS_TMP.DIR;, [PYVMS_TMP...]*.*;*
$ delete /log [PYVMS_TMP...]*.*;*, ;, ;, ;, ;, ;, ;, ;, ;
$ delete /log [000000]PYVMS_TMP.DIR;
$!
$! -- save everything (optional)
$ BACKUP [000000]PYTHON.DIR;,[PYTHON...]*.*;* -
DKB100:[000000]PYVMS.BCK /SAVE_SET /GROUP=0 /VERIFY
$!
translate and compile ...
The PYVMS distribution does not contain any pre-translated or pre-compiled
files in order to save space.
translate VMSDEF modules
These modules contain OpenVMS version information, item-codes, bitmasks and
constants:
$ SET DEFAULT DKA100:[PYTHON.PYTHON-1_5_1.VMS]
$ show TIME
$ @ VMSDEF2MAR-ALL ! calls VMSDEF2MAR.COM
$ show TIME
$ @ VMSDEF_BLDDIR2MAR.COM
$ show TIME
$ @ VMSVER2MAR.COM VMSDAT_VMSVER.DAT
$ show TIME
Run the MACRO source files that have just been created through the MACRO
assembler and put the resulting object files in the object library
VMS_MACRO.OLB.
$!! @ DMACRO_VMS
@@ not necessary, here -- DMACRO_VMS is called from DCC-ALL
compile for the DCL environment
$ @ DCC-ALL
$!
$ @ LINKD_PY
$!
$ @ LINKD_PGEN
compile for the POSIX environment
$ @ PCC-ALL
$!
$ @ LINKP_PY
@@ No attempt has been made to build 'PGEN' for POSIX - I haven't even used it
in the DCL environment...
setup and go
Python on OpenVMS needs some symbols:
@@maintenance note: Symbol list could be moved to a different chapter.
$ @SETUP
convert documentation to RUNOFF format
pyvms1_5_1-v008doc.tlb
',
'pyvmsstartgde.txt
',
'pyvmsgenman.txt
' or
'pyvmsrefman.txt
' from the Internet
if you have the 'PYVMS source distribution' and access to this
$ set DEFAULT [PYTHON.PYTHON-1_5_1.VMS.DOC.GENMAN]
$ @ CVT_DOC
$!
$ set DEFAULT [PYTHON.PYTHON-1_5_1.VMS.DOC.REFMAN]
$ @ CVT_DOC
$!
$ set DEFAULT [PYTHON.PYTHON-1_5_1.VMS.DOC.STARTGDE]
$ @ CVT_DOC
run tests
One of the files contains a file specification that is invalid for the ODS-2
filesystem and needs to be fixed:
$ SET DEFAULT [PYTHON.PYTHON-1_5_1.LIB.TEST]
$ BACKUP TEST_SUPPORT.PY; *.PY$O /OWNER=ORIGINAL /LOG
$ edit/edt TEST_SUPPORT.PY
*substitute/@test/test.test/%whole
exit
$
Run the tests:
$ python
Python 1.5.1 (V008, Mar 27 1999, 14:02:14) [DECC] on vms
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
portions Copyright 1996-1998 Uwe Zessin
>>> import test.autotest
test_grammar
test_opcodes
test_operations
test_builtin
test_exceptions
test_types
All 6 tests OK.
>>>
Note: this (and other tests) (currently) do not work with the POSIX version.
thread support
A short test to make threads available for the DCL variant of the Python
interpreter has been done on OpenVMS VAX V6.1. Here are the instructions:
#define WITH_THREAD 1
#define _POSIX_THREADS 1
SYS$SHARE:CMA$OPEN_RTL.EXE /SHAREABLE ! thread support
$ @ DCC-ALL
$ @ DCC_MODULES THREADMODULE
$ @ DCC_PYTHON THREAD
$ @ LINKD_PY
$ @ SETUP
$ SET DEFAULT [.DEMO]
$ PYTHON
[...]
>>> import thread1.py