Skip to content

 

start:

python GNV section

Updated 2016-06-12, by Martin Borgman


 How to enable Python in GNV

This was tested on a zx6000 with:
----------------------------------- ----------- ------------
PRODUCT                             KIT TYPE    STATE
----------------------------------- ----------- ------------
HP I64VMS AVAIL_MAN_BASE V8.2-1     Full LP     Installed
HP I64VMS C V7.1-11                 Full LP     Installed
HP I64VMS CDSA V2.1-355             Full LP     Installed
HP I64VMS CSWS V2.1                 Full LP     Installed
HP I64VMS CSWS_JAVA V3.0            Full LP     Installed
HP I64VMS CSWS_PERL V2.1            Full LP     Installed
HP I64VMS CSWS_PHP V1.3             Full LP     Installed
HP I64VMS CXX V7.1-11               Full LP     Installed
HP I64VMS DWMOTIF V1.5              Full LP     Installed
HP I64VMS GNV V1.6-4                Full LP     Installed
HP I64VMS JAVA142 V1.4-22           Full LP     Installed
HP I64VMS KERBEROS V2.1-75          Full LP     Installed
HP I64VMS OPENVMS V8.2-1            Platform    Installed
HP I64VMS PERL V5.8-6               Full LP     Installed
HP I64VMS TCPIP V5.5-11             Full LP     Installed
HP I64VMS TDC_RT V2.1-78            Full LP     Installed
HP I64VMS VMS V8.2-1                Oper System Installed
JFP I64VMS LIBBZ2 V1.0-2            Full LP     Installed
JFP I64VMS MYSQL V4.1-14            Full LP     Installed
JFP I64VMS PYTHON235 V1.46-0        Full LP     Installed
JFP I64VMS ZLIB V1.2-3              Full LP     Installed
----------------------------------- ----------- ------------

Note1:
I'm using a HP internal version of bash, but I don't think this matters in this
case.


Prerequisites are:
GNV 1.6-2 or better
LIBBZ2 1.0-2 (from http://www.pi-net.dyndns.org/anonymous/kits/)
ZLIB 1.2-3 (from http://www.pi-net.dyndns.org/anonymous/kits/)
Python 2.3 or better (from http://www.pi-net.dyndns.org/anonymous/kits/)
Alpha or IA64 system
ODS-5 disk with hard links enabled
extended parse style enabled
case blind

What to do:

   1. First create the necessary links in /usr/local/bin
      CREATE/DIRECTORY GNU:[usr.local.bin]
      SET FILE /ENTER=GNU:[usr.local.bin]python. PYTHON_ROOT:[VMS.BIN]PYTHON.EXE
      SET FILE /ENTER=GNU:[usr.local.bin]pydoc. PYTHON_ROOT:[TOOLS.SCRIPTS]PYDOC
      SET FILE /ENTER=GNU:[usr.local]python-2.3.DIR SYS$COMMON:[000000]PYTHON235.DIR
   2. Python scripts typically start with:
      #! /usr/bin/env python
      The problem here isn't that GNV env is installed in the /bin directory,
      but that env uses execvp to start python and unfortunately On OpenVMS execvp
      completely ignores the PATH environment variable. On OpenVMS execvp uses
      DCL$PATH and VAXC$PATH to search for the command to execute. And to make
      matters worse, DCL$PATH and VAXC$PATH only work with OpenVMS style paths. For
      now the only solution is to define DCL$PATH and VAXC$PATH ourselves. To do
      this, find the @GNU:[LIB]GNV_SETUP.COM line in your LOGIN.COM or the system
      wide SYS$MANAGER:SYLOGIN.COM and enter the following lines on the next line:
      $ DEFINE DCL$PATH GNU:[bin],GNU:[usr.bin],GNU:[usr.local.bin]
      $ DEFINE VAXC$PATH GNU:[bin],GNU:[usr.bin],GNU:[usr.local.bin]

In this default installation, where python_root is SYS$COMMON:[PYTHON235], we
us the following environment. You don't need to set this yourself.
export PYTHONHOME=/python_root
export PYTHONPATH=/python_root/Lib:/python_root/local:/python_root/local/PIL
export PYTHONDOCS=/python_root/doc

You can optionally change this in your .bashrc to:
export PYTHONHOME=/usr/local/python-2.3
export PYTHONPATH=${PYTHONHOME}/Lib:${PYTHONHOME}/local:${PYTHONHOME}/local/PIL
export PYTHONDOCS=${PYTHONHOME}/doc

Now you can run the Python tests in bash by entering the following:
 /python_root/Lib/test/regrtest.py
Or in case you defined PYTHONHOME in your bash environment:
${PYTHONHOME}/Lib/test/regrtest.py

Regards,

Martin Borgman,
OpenOffice.org On OpenVMS porting group

Maintained by the OpenOffice on OpenVMS porting Project.