Python for OpenVMS -installation manual                         PAGE 1
  title page


                        __
                       |  \ |   |       _
                       |__/ |   |  -   / \   -O-
                       |     \ /    \_/   \_/
                       |      |
                                      ___  /
                                     / | \/ 
                                    /  | /\ 
                                   |- ( )--|
                                    \/    / 
                                    /\ | /  
                                   /  ---   



  Copyright, 1996 - 2000 by Uwe Zessin

  ------------------------------------------------------------------------
  Python for OpenVMS - Installation Manual

  August 2000

  This manual describes the installation of 'Python' on OpenVMS.


  Software Version:
          1.5.2-V007


  Uwe Zessin, Germany
  ------------------------------------------------------------------------
  14-AUG-2000 ZE.

  Python for OpenVMS -installation manual                         PAGE 2
  The Python copyright


  0.1  The Python Copyright

  (copied from MISC/COPYRIGHT.)


  Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
  The Netherlands.

                          All Rights Reserved

  Permission to use, copy, modify, and distribute this software and its
  documentation for any purpose and without fee is hereby granted,
  provided that the above copyright notice appear in all copies and that
  both that copyright notice and this permission notice appear in
  supporting documentation, and that the names of Stichting Mathematisch
  Centrum or CWI or Corporation for National Research Initiatives or
  CNRI not be used in advertising or publicity pertaining to
  distribution of the software without specific, written prior
  permission.

  While CWI is the initial source for this software, a modified version
  is made available by the Corporation for National Research Initiatives
  (CNRI) at the Internet address ftp://ftp.python.org.

  STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
  CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.

  ------------------------------------------------------------------------
  18-MAY-1998 ZE.

  Python for OpenVMS -installation manual                         PAGE 3
  The Python for OpenVMS copyright


  0.2  The Python for OpenVMS copyright


  Copyright 1996-2000, by Uwe Zessin

    This software is provided to you free of charge. Use at your own risk -
    if it doesn't work, I disclaim all responsibility.
    This software may be freely distributed as long as it is accompanied by
    the copyright notice. If you change this software, you may re-distribute
    it only if you keep the original notes AND an additional notice identifying
    you and indicating that you have changed it.

  ------------------------------------------------------------------------
  I have found this wording somewhere on  the  Internet  and  liked  it.
  Unfortunately  I  haven't  noted  the  author's  name so I cannot give
  credit.
  ------------------------------------------------------------------------
  11-JUN-2000 ZE.

  Python for OpenVMS -installation manual                         PAGE 4
  table of contents


                                     CONTENTS

          0.1       The Python Copyright . . . . . . . . . . . . . . . 2
          0.2       The Python for OpenVMS copyright . . . . . . . . . 3


  CHAPTER 1       Introduction

          1.1     Welcome  . . . . . . . . . . . . . . . . . . . . . 1-1


  CHAPTER 2       files from the Python distribution

          2.1     the Python core files  . . . . . . . . . . . . . . 2-1
          2.2     the Python documentation . . . . . . . . . . . . . 2-2


  CHAPTER 3       files from the Python for OpenVMS distribution

          3.1     the Python for OpenVMS source kit  . . . . . . . . 3-1
          3.2     the Python for OpenVMS documentation . . . . . . . 3-1
          3.3     precompiled object code  . . . . . . . . . . . . . 3-3
          3.4     tools to build Python on OpenVMS . . . . . . . . . 3-3


  CHAPTER 4       preparations

          4.1     disk space calculations  . . . . . . . . . . . . . 4-1
          4.2     select directory for the installation  . . . . . . 4-2
          4.3     logical names  . . . . . . . . . . . . . . . . . . 4-2
          4.4     create directories . . . . . . . . . . . . . . . . 4-4
          4.5     foreign commands . . . . . . . . . . . . . . . . . 4-4
          4.6     store software kits  . . . . . . . . . . . . . . . 4-4
          4.7     OpenVMS patches  . . . . . . . . . . . . . . . . . 4-4


  CHAPTER 5       installing and building

          5.1     restore the Python distribution  . . . . . . . . . 5-1
          5.2     create additional directories  . . . . . . . . . . 5-2
          5.3     save some original files . . . . . . . . . . . . . 5-2
          5.4     extract the Python for OpenVMS distribution  . . . 5-3
          5.5     configure for compilation  . . . . . . . . . . . . 5-4
          5.6     translate and compile or install objects . . . . . 5-4
          5.6.1     convert data files . . . . . . . . . . . . . . . 5-4
          5.6.2     translate VMSDEF modules . . . . . . . . . . . . 5-5
          5.6.3     translate configuration  . . . . . . . . . . . . 5-5
          5.6.4     compile for the DCL environment  . . . . . . . . 5-5
          5.6.5     install objects  . . . . . . . . . . . . . . . . 5-6
          5.6.6     LINK - create executables  . . . . . . . . . . . 5-6
          5.7     setup and go . . . . . . . . . . . . . . . . . . . 5-6
          5.8     compile Python files . . . . . . . . . . . . . . . 5-7
          5.9     run tests  . . . . . . . . . . . . . . . . . . . . 5-7
          5.10    convert documentation to RUNOFF format . . . . . . 5-9

  Python for OpenVMS -installation manual                         PAGE 5
  table of contents


          5.11    thread support . . . . . . . . . . . . . . . . .  5-10


  INDEX
                                                                 INDEX-1












                                CHAPTER 1

                               Introduction



                        __
                       |  \ |   |       _
                       |__/ |   |  -   / \   -O-
                       |     \ /    \_/   \_/
                       |      |
                                      ___  /
                                     / | \/ 
                                    /  | /\ 
                                   |- ( )--|
                                    \/    / 
                                    /\ | /  
                                   /  ---   



  1.1  Welcome

  to the Python programming language running on  the  OpenVMS  operating
  system.

                    This is the 'Installation Manual'.

  This manual tells you which software you need, where to  get  it  from
  and  the  steps  to get Python running on OpenVMS.  Please try to read
  the entire manual before you start.

  Descriptions of modules with their interface routines, defined symbols
  and VMS objects are in the 'Reference Manual'.

  Other information is in the 'General Manual'.

  More examples are in the 'Demoes Manual'.

  ------------------------------------------------------------------------
  11-APR-2000 ZE.












                                CHAPTER 2

                    files from the Python distribution



  2.1  the Python core files

  Beginning with 'Python for  OpenVMS'  version  1.5.2-V001  the  Python
  distribution  is  available in a repacked format which should make the
  installation process easier.
  You always need to download the file 'python1_5_2.zip' from:

        -  http://www.decus.de/~zessin/python/kits/python1_5_2.zip
           5086 blocks

  Note that the '.ZIP' archive contains an OpenVMS BACKUP saveset (20601
  blocks).  The reason is that this gave a better compression factor - a
  'ZIP' of the subdirectory resulted in a 6118 blocks '.ZIP' archive.

  A new version of the ZIP file has been created on 13-MAY-1999, because
  the  "-V"  option  was  ommitted  inadvertently during creation of the
  first one on 01-MAY-1999.  If you have downloaded the old version  you
  should  be  able  to  fix  the saveset after it was extracted from the
  ".ZIP"  archive.   See  'restore  the  Python  distribution'  in   the
  'installing and building' section.

  The  BACKUP  saveset  contains  the  complete  source  of   the   core
  interpreter  and  the  Python library.  Unpacking this file on OpenVMS
  creates about 1516 files with 19221 blocks.  On a  disk  with  cluster
  size 4 this allocates 21908 blocks.

  Even if you download precompiled object  code  (described  later)  for
  OpenVMS, you still need the library files from 'python1_5_2.zip'.

                                   ---
  For your information:  the original files were downloaded from:

        -  http://www.python.org/ftp/python/src/py152.tgz

           or


  Python for OpenVMS -installation manual                       PAGE 2-2
  files from the Python distribution


        -  ftp://ftp.python.org/ftp/python/src/py152.tgz

  (4948 blocks)

  ------------------------------------------------------------------------



  2.2  the Python documentation

  The  Python  documentation   is   decoupled   from   the   interpreter
  distribution.

  Start at:

        -  http://www.python.org/doc/

           or

        -  ftp://ftp.python.org/pub/python/doc/

  (This is the most recent documentation for Python V1.5.2  I  am  aware
  of)

  Note that  the  'Python  for  OpenVMS  documentation'  only  describes
  OpenVMS specifics.  You should download the Python documentation, too.

  A new version of the documentation was made available  shortly  before
  the  release  of  Python  for  OpenVMS  V1.5.2-V004.   This is usually
  announced     in     the     newsgroups      comp.lang.python      and
  comp.lang.python.announce.   You  might  check the addresses mentioned
  above from time to time if you can't follow the newsgroups.

  ------------------------------------------------------------------------
  08-OCT-1999 ZE.












                                CHAPTER 3

              files from the Python for OpenVMS distribution



  3.1  the Python for OpenVMS source kit

  You always need to download the 'source kit'.

        -  http://www.decus.de/~zessin/python/kits/
           python-1_5_2-v007src.zip
           about 2990 blocks

  It includes all OpenVMS specific files.

  You need these files even if you intend  not  to  compile  the  Python
  interpreter yourself, but download pre-compiled object code!

  ------------------------------------------------------------------------



  3.2  the Python for OpenVMS documentation

  The whole documentation has been updated for version 1.5.2-V007.

  The documentation is available in different forms:

  HTML documentation
          The '.HTML' files are distributed within the 'source kit' that
          was  mentioned above.  You can put these files on a web server
          or directly read  them  with  a  browser.   See  the  'General
          Manual' for more details.

          Keep the [.VMS.DOC] tree intact, because there are  hyperlinks
          between the 'manuals'.

  simple text format
          These are files that have been run through  a  text  formatter
          but  they  don't  contain any information about bold printing.
          The individual pages are  separated  by  FormFeed  characters.
          Maximum  page  size is 66 lines, but there are no empty filler
          lines before a FormFeed character.  You can send  these  files
          to  a  printer  that  doesn't  understand  that  or  read them
          directly with a text editor.

  Python for OpenVMS -installation manual                       PAGE 3-2
  files from the Python for OpenVMS distribution


          All four manuals are separately available:

           *  the 'Installation Manual' -
              http://www.decus.de/~zessin/python/doc/insman/insman.txt
              about 81 blocks

           *  the 'General Manual' -
              http://www.decus.de/~zessin/python/doc/genman/genman.txt
              about 254 blocks

           *  the 'Reference Manual' -
              http://www.decus.de/~zessin/python/doc/refman/refman.txt
              about 1450 blocks

           *  the 'Demoes Manual' -
              http://www.decus.de/~zessin/python/doc/demo/demo.txt
              about 62 blocks

  printer format
          These are files that have been run  through  the  RUNOFF  text
          formatter.   They  contain information for bold printing.  Two
          variants are available:

           *  A '.MEM' file for output on line printers.
              This file can be converted  to  the  'simple  text  format
              ('.TXT')' mentioned above.

           *  A '.LNI' file for output on  printers  understanding  ANSI
              sequences.

          All 4 manuals are stored in  an  OpenVMS  text  library.   The
          library  contains  another file (README_TLB.TXT) with detailed
          instructions how to extract the manuals from the library,  how
          to  convert  a '.MEM' file to a '.TXT' file to get the 'simple
          text format' mentioned above and how to re-apply  the  correct
          record attributes to the '.MEM' and '.TXT' files.

          Download:

           *  http://www.decus.de/~zessin/python/kits/
              python-1_5_2-v007doc.tlb
              about 2223 blocks

          After the download to an OpenVMS system do a:
          $ LIBRARY /EXTRACT= README_TLB.TXT -
                    /OUTPUT=  README_TLB.TXT -
                    PYTHON-1_5_2-V007DOC.TLB

          See file 'README_TLB.TXT' for further details.

  Note that the Python for  OpenVMS  documentation  only  describes  the
  OpenVMS  related parts.  You should download the Python documentation,
  too.

  Python for OpenVMS -installation manual                       PAGE 3-3
  files from the Python for OpenVMS distribution


  ------------------------------------------------------------------------



  3.3  precompiled object code

  For very specific configurations I MIGHT make precompiled object  code
  available.   They  may NOT work on your configuration!  I'm sorry, but
  that is the best you can expect from a 'hobby project'.

  Start at http://www.decus.de/~zessin/python/obj.html  to  see  if  and
  what versions are available.

  ------------------------------------------------------------------------



  3.4  tools to build Python on OpenVMS

  Beginning with version 1.5.2-V001 you only need the UNZIP tool that is
  used  to  extract  (and  decompress) a single or multiple files from a
  '.ZIP' archive.

  Explaining this tool in more  detail  is  beyond  the  scope  of  this
  manual,  sorry.  You should be able to get along with it if you follow
  the instructions in the 'installing  and  building'  section  of  this
  manual.

  I have made available executable files of the tools that I use.   They
  can be downloaded from:


        -  http://www.decus.de/~zessin/python/tools.html


  Of course, there is NO guarantee that they work for you.  The 'General
  Manual'  of  the  Python  for OpenVMS documentation has pointers where
  more up-to date versions (perhaps including source) can be found.

  ------------------------------------------------------------------------
  05-AUG-2000 ZE.












                                CHAPTER 4

                               preparations



  This section describes how the environment for  the  installation  and
  building process is to be prepared.
  ------------------------------------------------------------------------



  4.1  disk space calculations

  The following information should help you to calculate the  amount  of
  disk  space  required  during and after installation.  Sizes are taken
  from a disk with a cluster size of 4.

  PYTHON1_5_2.ZIP - 5086 blocks
          Can be stored anywhere, however this file should be saved  for
          future use.

  PYTHON1_5_2.BCK - 20601 blocks
          Resulting  from  decompression  of  PYTHON1_5_2.ZIP.   Can  be
          stored anywhere.  This space is only required until the Python
          directory tree is restored.

  [PYTHON.PYTHON-1_5_2...] - about 19478/22176 blocks
          The   original   Python   distribution   as   restored    from
          PYTHON1_5_2.BCK.   On  disks with a larger cluster factor more
          blocks are required.

  PYTHON-1_5_2-V007SRC.ZIP - about 2990 blocks
          Can be stored anywhere, however this file should be saved  for
          future use.

  [PYTHON.PYTHON-1_5_2.VMS...] - about 9663/10880 blocks
          The    OpenVMS    specific    parts    as    restored     from
          PYTHON-1_5_2-V007SRC.ZIP.    Some   files   outside   of  this
          directory tree are included in the size.

  translated documentation - about 7241/7672 blocks
          Is stored in the Python tree by running  CVT_DOC.COM  in  each
          subdirectory   of  [.VMS.DOC].   Required  only  if  the  HTML
          documentation in the source tree  is  translated  to  text  or
          printer  formats.   The  number  of blocks includes '.RNO' and

  Python for OpenVMS -installation manual                       PAGE 4-2
  preparations


          other RUNOFF temporary files.

  Alpha object code - about @@@@ blocks
          This amount is from compiling /DEBUG /noOPTIMIZE and  includes
          translated  data  files,  object modules, the object libraries
          and the executable.

  VAX object code - about 24601/24820 blocks
          This amount is from compiling /DEBUG /noOPTIMIZE and  includes
          translated  data  files,  object modules, the object libraries
          and the executable.

  compiled Python code - about 2670 blocks
          After building the interpreter the source code from the Python
          library should be pre-compiled.

  Python documentation
          Is not listed here.

  Total space used on OpenVMS VAX is about  63732/68508  blocks  (/DEBUG
  /noOPTIMIZE,  all modules enabled, threading enabled) on a disk with a
  cluster size of 4 blocks.

  These numbers  are  from  the  1.5.2-V007  version.   Updates  contain
  bugfixes  for existing files and new functionality in new files so the
  final disk space that is required is higher.



  4.2  select directory for the installation

  The top-level of the directory tree is assumed to be  named  [PYTHON].
  The  current  Python  environment  requires  6  directory levels.  All
  instructions so far assume that the  [PYTHON]  directory  is  directly
  stored  in  the  master  file  directory  ([000000])  of  a disk (e.g.
  DKA100:).  No tests have been done to use a concealed logical name for
  the 'disk'.

  Note that during first-time execution of the  procedure  SETUP.COM  it
  creates  a  subdirectory  named  [.PYTHON_TMP]  where the logical name
  SYS$SCRATCH points to.



  4.3  logical names

  Beginning with version 1.5.2-V001 logical names are used to  point  to
  certain directories within the build process.  The person who installs
  the software  should  be  able  to  type  in  the  commands  from  the
  instructions directly or use cut and paste without changes.


  Python for OpenVMS -installation manual                       PAGE 4-3
  preparations


  The following logical names are currently used:

  PYTHON_DISK
          Device on which the software is  to  be  installed.   Using  a
          concealed device might be possible, but has not been tested.

  PYTHON_DOC_DEMO
          Directory  of  the  'Demoes  Manual'.   It  is  used  by   the
          DEMO_EXTRACT.PY  script.   See  'extracting  demoes  from  the
          manual' in the 'Demoes Manual'.

  PYTHON_INCLUDE
          Python include directories  -  these  can  be  used  by  other
          modules  that  are  used to enhance Python, but do not live in
          it's directory tree.

  PYTHON_INS_TMP
          A  temporary  directory   for   scratch   space   during   the
          installation.

  PYTHON_INS_TOOLS
          A directory that contains executables  of  the  tools  (UNZIP)
          that are used during the installation.

  PYTHON_OLB
          Architecture-specific  (Alpha,  VAX)   directory   tree   that
          contains  object libraries and object files of the Python core
          interpreter, OpenVMS support and extensions.

  PYTHON_TOOLS
          Directory  for  tools  that  are  delivered  with  Python  for
          OpenVMS.

  PYTHON_VMS
          Almost all of the files from the port to OpenVMS are  in  this
          directory tree.

  Example:

  $ define  PYTHON_DISK       DKA100:
  $ define  PYTHON_DOC_DEMO   -
                PYTHON_DISK:[PYTHON.PYTHON-1_5_2.VMS.DOC.DEMO]
  $ define  PYTHON_INCLUDE    PYTHON_DISK:[PYTHON.PYTHON-1_5_2], -
                              PYTHON_DISK:[PYTHON.PYTHON-1_5_2.INCLUDE]
  $ define  PYTHON_INS_TMP    DKB100:[PYTHON_INSTMP]
  $ define  PYTHON_INS_TOOLS  PYTHON_DISK:[PYTHON.TOOLS]
  $!
  $ _ARCH = "ALPHA"
  $ if (F$GETSYI("CPU").le.127) then $ _ARCH = "VAX"
  $ define  PYTHON_OLB        -
                PYTHON_DISK:[PYTHON.PYTHON-1_5_2.VMS.O_'_ARCH']
  $ define  PYTHON_TOOLS      PYTHON_DISK:[PYTHON.PYTHON-1_5_2.VMS.TOOLS]
  $ define  PYTHON_VMS        PYTHON_DISK:[PYTHON.PYTHON-1_5_2.VMS]
  $!

  Python for OpenVMS -installation manual                       PAGE 4-4
  preparations


  $ delete /SYMBOL /LOCAL _ARCH




  4.4  create directories

  $ create /DIRECTORY /PROTECTION=(G:RE;W:RE) PYTHON_INS_TMP:
  $ create /DIRECTORY /PROTECTION=(G:RE;W:RE) PYTHON_INS_TOOLS:




  4.5  foreign commands

  Place the executable of the UNZIP tool  into  PYTHON_INS_TOOLS:.   The
  processor   architecture   should   be  part  of  the  filename,  e.g.
  UNZIP_ALPHA.EXE

  Define a foreign command for UNZIP.  The following example can be  put
  into a command procedure to work on Alpha and VAX systems.

  $ _ARCH = "ALPHA"
  $ if (F$GETSYI("CPU").le.127) then $ _ARCH = "VAX"
  $ UNZIP == "$PYTHON_INS_TOOLS:UNZIP_''_ARCH'.EXE"
  $ delete /SYMBOL /LOCAL _ARCH




  4.6  store software kits

  Store the files that you  have  downloaded  into  PYTHON_INS_TMP:   or
  download them now into that directory.



  4.7  OpenVMS patches

  See the 'patches' chapter in the 'General Manual'  whether  you  might
  have to apply one to your OpenVMS system.

  ------------------------------------------------------------------------
  05-AUG-2000 ZE.












                                CHAPTER 5

                         installing and building




  This chapter describes the steps to build Python on OpenVMS.

  Version 1.5.2-V007 comes as a complete kit with a new build mechanism.
  It  is  strongly  recommended  that  you do a new installation and not
  attempt an upgrade.
  ------------------------------------------------------------------------

  Specify an owner UIC to be assigned to the files:

  $ _O = "/OWNER=[1,4]"

  or use defaults:

  $ _O = ""



  5.1  restore the Python distribution

  $! -- temporary directory
  $ set DEFAULT PYTHON_INS_TMP:
  $!
  $! -- extract BACKUP saveset
  $ UNZIP -e PYTHON1_5_2.ZIP
  $!

  If you have downloaded the ".ZIP" file before  14-MAY-1999,  then  you
  need to apply the following command to the BACKUP saveset, because the
  "-V"  option  was  ommitted  inadvertently  during  the  creation   of
  PYTHON1_5_2.ZIP.

  $ set FILE /ATTRIBUTES=(RFM:FIX,LRL:32256) PYTHON1_5_2.BCK

  A new download should not be necessary.

  $! -- extract files from saveset
  $ backup PYTHON1_5_2.BCK /SAVE_SET -
           PYTHON_DISK:[*...] /TRUNCATE /VERIFY  '_O'
  $!

  Python for OpenVMS -installation manual                       PAGE 5-2
  installing and building


  $! -- list contents of saveset
  $ backup PYTHON1_5_2.BCK /SAVE_SET -
           /LIST= PYTHON_DISK:[PYTHON]PYTHON1_5_2.LIS
  $!
  $! -- delete saveset - please keep ZIP archive
  $ delete /log PYTHON1_5_2.BCK;*
  $!




  5.2  create additional directories

  The intention is to keep the original directories as much unchanged as
  possible.

  $ set DEFAULT PYTHON_VMS:
  $ CREDIR = "CREATE/DIRECTORY ''_O' /PROTECTION=(G:RE,W:RE)/LOG"
  $!
  $ CREDIR []
  $ CREDIR [.O_ALPHA]
  $ CREDIR [.O_VAX]
  $ CREDIR [.TMP]
  $ delete /SYMBOL /LOCAL CREDIR
  $!

  All other directories will automatically be created during the restore
  of the Python for OpenVMS distribution.



  5.3  save some original files

  These files will be replaced with modified ones from  the  Python  for
  OpenVMS  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
          OpenVMS
  *.*$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 OpenVMS

  $ set default PYTHON_DISK:[PYTHON.PYTHON-1_5_2.LIB]
  $ backup COMPILEALL.PY;1, FTPLIB.PY;1, GETPASS.PY;1, SITE.PY;1, -
           TEMPFILE.PY;1, USER.PY;1 *.PY$O;*   /OWNER=ORIGINAL /LOG
  $!
  $ set DEFAULT PYTHON_DISK:[PYTHON.PYTHON-1_5_2.LIB.TEST]
  $ backup TEST_RGBIMG.PY;1, TEST_SIGNAL.PY;1, TEST_SUPPORT.PY;1 -
           *.PY$O;* /OWNER=ORIGINAL /LOG

  Python for OpenVMS -installation manual                       PAGE 5-3
  installing and building


  $!
  $ set DEFAULT PYTHON_DISK:[PYTHON.PYTHON-1_5_2.LIB.TEST.OUTPUT]
  $ backup TEST_MIMEWRITER.;1 *.$O /OWNER=ORIGINAL /LOG
  $!
  $ set DEFAULT PYTHON_DISK:[PYTHON.PYTHON-1_5_2.MODULES]
  $ backup FCNTLMODULE.C,  MAIN.C, PYTHON.C, SELECTMODULE.C, -
           SIGNALMODULE.C, SOCKETMODULE.C, TIMEMODULE.C, -
          _LOCALEMODULE.C  *.C$O -
      /BY_OWNER=ORIGINAL /LOG
  $ backup TIMING.H  *.H$O  /BY_OWNER=ORIGINAL /LOG
  $!
  $ set DEFAULT PYTHON_DISK:[PYTHON.PYTHON-1_5_2.OBJECTS]
  $ backup FILEOBJECT.C  *.C$O  /BY_OWNER=ORIGINAL /LOG
  $!
  $ set DEFAULT PYTHON_DISK:[PYTHON.PYTHON-1_5_2.PYTHON]
  $ backup IMPORT.C  *.C$O /BY_OWNER=ORIGINAL /LOG
  $!




  5.4  extract the Python for OpenVMS distribution

  $! -- list contents of .ZIP file
  $ set DEFAULT PYTHON_DISK:[PYTHON]
  $!
  $ define /USER_MODE SYS$OUTPUT [PYTHON]PYTHON-1_5_2-V007SRC.LIS
  $ UNZIP -l PYTHON_INS_TMP:PYTHON-1_5_2-V007SRC.ZIP
  $!
  $! -- extract files/directories from ZIPped file
  $ set PROTECTION= (S:RWED,O:RWED,G:RE,W:RE) /DEFAULT
  $ define /USER_MODE SYS$OUTPUT -
           PYTHON_DISK:[PYTHON]PYTHON-1_5_2-V007SRC.UNZIP
  $ UNZIP -e -o PYTHON_INS_TMP:PYTHON-1_5_2-V007SRC.ZIP
  $!

  There are some files that have been saved with OpenVMS  specific  file
  attributes,  because  they contain lines with explicit <LF> characters
  which ZIP/UNZIP would otherwise corrupt.   (The  SRC  kit  is  created
  without the "-V" option).

  $ set DEFAULT PYTHON_VMS:
  $ set DEFAULT [.DOC]
  $!
  $ UNZIP -e CVT__RNO.ZIP
  $!
  $ delete CVT__RNO.ZIP;*
  $!


  Python for OpenVMS -installation manual                       PAGE 5-4
  installing and building


  5.5  configure for compilation

  If you intend to compile the source code yourself, please  review  the
  contents of file SETUP.COM

  The logical name  PYTHON_CFG_CXX  controls  whether  the  main  module
  PYTHON.C  is to be compiled with the DEC / Compaq C++ compiler and the
  CXXLINK command to be used to build the  executable.   This  does  NOT
  mean  that  you can build Python for OpenVMS with the DEC / Compaq C++
  compiler!!  This does NOT work, sorry, you need the  DEC  /  Compaq  C
  compiler.

  The logical name PYTHON_CFG_DEBUG controls whether object code  should
  be generated with /DEBUG/noOPTIMIZE.

  The logical name PYTHON_CFG_THREADS controls if the interpreter should
  be build with thread support.  You need to recompile ALL modules for a
  change - instructions are at the end of this chapter.

                                   ---

  Even if you don't compile yourself you need to run the procedure:

  $ set DEFAULT PYTHON_VMS:
  $ @ SETUP

  Note that during first-time execution of the  procedure  SETUP.COM  it
  creates  a  subdirectory  named  [.PYTHON_TMP]  where the logical name
  SYS$SCRATCH points to.

  There can be a problem if SYS$SCRATCH points to a logical name  search
  list.   The  'pkg' test fails for some reason that I have not tried to
  find out - please redefine SYS$SCRATCH in such a situation.



  5.6  translate and compile or install objects

  The source kit (SRC) of the Python for OpenVMS distribution  does  not
  contain  any  pre-translated  or  pre-compiled  files in order to save
  space.

  Pre-compiled objects kits might be available.

  The following commands  up  to  '@LINKD_PGEN'  are  also  combined  in
  procedure BUILD_PYTHON.COM which you can use instead.



  5.6.1  convert data files

  Some data files need to be converted to indexed sequential format:

  $! -- convert CONFIG_MODULES.TXT to CONFIG_MODULES.DAT

  Python for OpenVMS -installation manual                       PAGE 5-5
  installing and building


  $ @ PYTHON_TOOLS:CVT_CONFIG_MODULES.COM
  $!
  $! -- convert CONFIG_OLB.TXT to CONFIG_OLB.DAT
  $ @ PYTHON_TOOLS:CVT_CONFIG_OLB.COM
  $!
  $! -- convert VMSDAT_VMSVER.TXT to VMSDAT_VMSVER.DAT
  $ @ PYTHON_TOOLS:CVT_VMSDAT_VMSVER
  $!
  $! -- convert VMSDAT_VMSVER.TXT to VMSDAT_VMSVER.MAR
  $ @ PYTHON_VMS:VMSVER2MAR.COM VMSDAT_VMSVER.TXT




  5.6.2  translate VMSDEF modules

  These  modules  contain  OpenVMS  version  information,  item   codes,
  bitmasks and constants:

  $ set DEFAULT PYTHON_VMS:
  $!
  $ @ VMSDEF2MAR-ALL ! calls VMSDEF2MAR.COM
  $!
  $! -- create VMSDEF_DIRECTORY.MAR
  $ @ VMSDEF_BLDDIR2MAR.COM




  5.6.3  translate configuration

  Details of the configuration process are in the 'General Manual'.

  $ @ CONFIG_INITTAB2MAR  CONFIG.DAT

  Beginning with version  1.5.2-V007  CONFIG_INITTAB2MAR.COM  takes  the
  information  automatically  from  the  logical  names  that  have been
  established by SETUP.COM.

  $ @ MODULEMETHODS2MAR   PYVMS__METHODS.DAT    "."  "."
  $ @ MODULEMETHODS2MAR   VMS_LBR__METHODS.DAT  "."  "."
  $ @ MODULEMETHODS2MAR   VMS_LIB__METHODS.DAT  "."  "."
  $ @ MODULEMETHODS2MAR   VMS_SMG__METHODS.DAT  "."  "."
  $ @ MODULEMETHODS2MAR   VMS_SYS__METHODS.DAT  "."  "."




  5.6.4  compile for the DCL environment

  $ @ PYTHON_VMS:BLDRUN "$ALL"


  The whole translation and compilation process took about 1.5 hours  on

  Python for OpenVMS -installation manual                       PAGE 5-6
  installing and building


  a VAXstation 4000 modell 60.




  5.6.5  install objects

  If you can not compile yourself, but found a suitable objects kit  you
  might be able to do an installation like this:

  $ set DEFAULT PYTHON_DISK:[PYTHON]
  $ _ARCH = "ALPHA"
  $ if (F$GETSYI("CPU").le.127) then $ _ARCH = "VAX"
  $ UNZIP -e -o PYTHON_INS_TMP:PYTHON-1_5_2-V007OBJ_'_ARCH'.ZIP


  The object kit should come with  a  set  of  configuration  data  that
  matches  the  contents  of the object libraries.  Therefore you should
  run SETUP.COM again:

  $ @ PYTHON_VMS:SETUP

  You should  re-do  the  steps  'convert  data  files'  and  'translate
  configuration'.



  5.6.6  LINK - create executables

  Make sure you have already executed the procedure  SETUP.COM  so  that
  the  LINK procedures will pick up the correct object libraries.  It is
  unlikely that you ever need 'PGEN', but the procedure is there.

  $ @ PYTHON_VMS:LINK_PY
  $!
  $ @ PYTHON_VMS:LINKD_PGEN


  Beginning  with   Python   for   OpenVMS   version   1.5.2-V007   some
  configuration  changes  require  a  working Python executable.  Please
  consider saving this file so you have a fail back.



  5.7  setup and go

  Python for OpenVMS needs some symbols:

  PYTHON
          A foreign command pointing to the executable.
  PYTHONPATH
          Information where the library is.
  PYTHONSTARTUP
          Points to a file.  In VMS speak  this  is  an  'initialization

  Python for OpenVMS -installation manual                       PAGE 5-7
  installing and building


          file' that Python executes on startup.
  PYTHONUNBUFFERED
          Tell Python to use unbuffered I/O.

  @@maintenance note:   Symbol  list  could  be  moved  to  a  different
  chapter.

  The procedure defines them dynamically:

  $ @SETUP

  Now you can run Python on OpenVMS:

  $ PYTHON
  Python 1.5.2 (V007, Sat Aug  5 20:38:12 2000) [DECC] on OpenVMS VAX
  Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
  portions Copyright 1996-2000 Uwe Zessin
  >>>

  Beginning with version 1.5.2-V005  the  date  printed  is  dynamically
  taken   from   the   image  header's  link  date  -  the  code  is  in
  VMS__GETBUILDINFO.C.    Beginning   with   version   1.5.2-V007    the
  architecture name (Alpha, VAX) is also printed.



  5.8  compile Python files

  For performance reasons the '.PY' files from the Python library should
  be  pre-compiled,  because  non-privileged users can not create '.PYC'
  files in that directories and each call would  result  in  a  new  (in
  memory) compilation.

  $ set DEFAULT PYTHON_VMS:
  $ @ SETUP
  $ @ PYTHON_TOOLS:COMPILEALL

  This adds 136 '.PYC' files with about 2670 blocks.



  5.9  run tests

  This is an example - the actual output might look different.
  $ set DEFAULT PYTHON_VMS
  $ @ SETUP
  $ set DEFAULT PYTHON_TMP1:
  $ python
  Python 1.5.2 (V007, Sat Aug  5 20:38:12 2000) [DECC] on OpenVMS VAX
  Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
  portions Copyright 1996-2000 Uwe Zessin
  >>> import test.autotest
  test_grammar
  test_opcodes

  Python for OpenVMS -installation manual                       PAGE 5-8
  installing and building


  test_operations
  test_builtin
  test_exceptions
  test_types
  test_al
  test test_al skipped -- an optional feature could not be imported
  test_array
  test_audioop
  test_binascii
  test_bsddb
  test test_bsddb skipped -- an optional feature could not be imported
  test_cd
  test test_cd skipped -- an optional feature could not be imported
  test_cl
  test test_cl skipped -- an optional feature could not be imported
  test_cmath
  test_cpickle
  test_crypt
  test test_crypt skipped -- an optional feature could not be imported
  test_dbm
  test test_dbm skipped -- an optional feature could not be imported
  test_dl
  test test_dl skipped -- an optional feature could not be imported
  test_errno
  test_fcntl
  test test_fcntl skipped -- an optional feature could not be imported
  test_gdbm
  test test_gdbm skipped -- an optional feature could not be imported
  test_gl
  test test_gl skipped -- an optional feature could not be imported
  test_grp
  test test_grp skipped -- an optional feature could not be imported
  test_gzip
  test test_gzip skipped -- an optional feature could not be imported
  test_imageop
  test_imgfile
  test test_imgfile skipped -- an optional feature could not be imported
  test_long
  test_math
  test_md5
  test_mimewriter
  test_new
  test_nis
  test test_nis skipped -- an optional feature could not be imported
  test_ntpath
  test_operator
  test_pickle
  test_pkg
  test_popen2
  test test_popen2 skipped -- an optional feature could not be imported
  test_pow
  test_pwd
  test test_pwd skipped -- an optional feature could not be imported
  test_re

  Python for OpenVMS -installation manual                       PAGE 5-9
  installing and building


  test_regex
  test_rfc822
  test_rgbimg
  test_rotor
  test_select
  test test_select crashed -- exceptions.AttributeError : popen
  test_sha
  test_signal
  test test_signal skipped -- an optional feature could not be imported
  test_socket
  test test_socket crashed -- socket.error : (65535, 'no logical name match')
  test_strftime
  test test_strftime failed -- Writing: 'Conflict for %I (hour (01-12)):',
   expected: ''
  test_strop
  test_struct
  test_sunaudiodev
  test test_sunaudiodev skipped -- an optional feature could not be imported
  test_thread
  (hangs)


  Some files can be deleted after the tests:

  $ delete /LOG PYTHON_DISK:[PYTHON.PYTHON-1_5_2.LIB.TEST]*.PYC;*

  Other files are left in the subdirectory [.PYTHON_TMP] that  has  been
  created  by  the SETUP.COM procedure in the directory that the logical
  name SYS$SCRATCH points to.



  5.10  convert documentation to RUNOFF format

  The Python for OpenVMS distribution contains full  sources  to  format
  the  files  for  line  printer  or  text  output.   You do not need to
  download    the    files    'python-1_5_2-v007doc.tlb',    'demo.txt',
  'insman.txt',  'genman.txt'  or  'refman.txt' from the Internet if you
  have the 'Python for OpenVMS source kit' and access to this chapter.

  $ set DEFAULT PYTHON_VMS:
  $ set DEFAULT [.DOC.GENMAN]
  $ @ CVT_DOC "*"
  $!
  $ set DEFAULT [-.INSMAN]
  $ @ CVT_DOC "*"
  $!
  $ set DEFAULT [-.REFMAN]
  $ @ CVT_DOC "*"
  $!
  $ set DEFAULT [-.DEMO]
  $ @ CVT_DOC "*"


  Python for OpenVMS -installation manual                      PAGE 5-10
  installing and building


  The whole documentation translation process took about 40 minutes on a
  VAXstation 4000 modell 60.
  ------------------------------------------------------------------------



  5.11  thread support

  Use your text editor of choice to change the  procedure  SETUP.COM  to
  define the logical name PYTHON_CFG_THREADS to "1" and run it:

      $ set DEFAULT PYTHON_VMS:
      $ @ SETUP

  You can use the following command for a full rebuild:

      $ @ BUILD_PYTHON

  Link the executable:

      $ @ LINK_PY


  Test it:

      $ @ SETUP
      $ set DEFAULT [.DEMO]
      $ PYTHON
      [...]
      >>> import thread1.py

  Note that no more work has been done regarding threads.

                                   ---

  To revert to non-threading mode:

        -  undo the change to logical name PYTHON_CFG_THREADS
        -  re-run SETUP.COM
        -  re-compile all modules again with BUILD_PYTHON.COM
        -  link the executable again.

  ------------------------------------------------------------------------
  09-AUG-2000 ZE.

  Index                                                     PAGE INDEX-1
   


                                  INDEX



  files                                 PYTHON_DOC_DEMO, 4-3
    demo.txt, 3-2, 5-9                  PYTHON_INCLUDE, 4-3
    genman.txt, 3-2, 5-9                PYTHON_INS_TMP, 4-3, 5-1
    insman.txt, 3-2, 5-9                PYTHON_INS_TOOLS, 4-3
    python-1_5_2-v007doc.tlb, 3-2,      PYTHON_OLB, 4-3
        5-9                             PYTHON_TOOLS, 4-3
    python-1_5_2-v007src.zip, 3-1       PYTHON_VMS, 4-3
    python1_5_2.zip, 2-1
    README_TLB.TXT, 3-2               symbols
    refman.txt, 3-2, 5-9                PYTHON, 5-6
    SETUP.COM, 5-4                      PYTHONPATH, 5-6
                                        PYTHONSTARTUP, 5-6
  logical names                         PYTHONUNBUFFERED, 5-7
    PYTHON_CFG_CXX, 5-4
    PYTHON_CFG_DEBUG, 5-4
    PYTHON_CFG_THREADS, 5-4, 5-10     tools
    PYTHON_DISK, 4-3                    UNZIP, 3-3, 4-4