Wednesday, 27 March 2019

Compiling GNV programs

Before I started on updating the GNV utilities to newer versions, I needed to demonstrate that I could compile the existing ones from source.  Having installed the source when installing the apps (by choosing not to select default installation options), I was left with two directories in the GNV root folder, common_src which contains the untouched original GNU source, and vms_src which contains vms specific files.  I also created a gnv$gnu:[build] directory in which the recompiled software would be built.

The main GNV utilities are well documented by JEM and include pretty much everything you need to know to recompile them.  I followed the supplied instructions and successfully recompiled the utilities without any major hitches.  I created a following script setup.com in the gnv$gnu:[build] directory to expedite the setting up of logicals for each compilation:

read/prompt="directory: " sys$command file
DEFINE/TRANS=CONC VMS_ROOT DKA0:[SYS0.SYSCOMMON.GNV.VMS_SRC.'file'.]
DEFINE/TRANS=CONC SRC_ROOT DKA0:[SYS0.SYSCOMMON.GNV.COMMON_SRC.'file'.]
DEFINE/TRANS=CONC LCL_ROOT DKA0:[SYS0.SYSCOMMON.GNV.BUILD.'file'.]
DEFINE REF_ROOT VMS_ROOT:,SRC_ROOT:
DEFINE PRJ_ROOT LCL_ROOT:, REF_ROOT:
set def PRJ_ROOT:[000000]
DEFINE GNV_PCSI_PRODUCER "JEM"
DEFINE GNV_PCSI_PRODUCER_FULL_NAME "JEM"
DEFINE STAGE_ROOT/TRANS=CONC DKA0:[SYS0.SYSCOMMON.GNV.BUILD.]
DEFINE NEW_GNU GNV$GNU:

This script prompts for the name of the utility that is to be recompiled, sets the logicals, and then set the default directory to the prj_root.  I normally then follow this with a set def prj_root:[xxx] command, where xxx is the name of the folder shown from the directory listings (for the GNV utilities it's usually just the name of the utility, but for the other libraries like libpng it is a combination of the name and the version number).  I've not changed the producer name yet because keeping the JEM ensures that any other programs that have a dependency on these utilities will still work.

The first time this is done, it is also necessary to recreate empty copies of any directories in the common_src and vms_src directories, in the build directory:

$ copy SRC_ROOT:[000000...]*.dir;* LCL_ROOT:[000000...]*.dir;* 
$ copy VMS_ROOT:[000000...]*.dir;* LCL_ROOT:[000000...]*.dir;*

I also created a directory gnv$gnu:[build.kit] that will store all the new PCSI install files.

Compiling the utilities should then just be a case of running the right .COM file - the names seem to be slightly different for each utility, e.g. build_bash.com, pcsi_product_sed.com

It's a good idea to run the included "clean" scripts e.g. clean_bash.com first to clear out any residual files, compiler failures were often traced back to this.

Most of the build scripts have debugging enabled, I disabled this by deleting the /debu qualifier from the descrip.mms makefile.

Installation of the re-compiled executables requires deleting the original executable - the installer seems to refuse to install over any existing executables.  Some of the utilities include a script to do this e.g. remove_bash.com



Monday, 25 March 2019

Books

Sadly, I had to leave behind my copy of the infamous 32-binder DEC wall of reference books when I moved countries so I am reliant on PDF versions downloaded from HP and VSI.  It's never the same as having a real book, even if they are much easier to search!

I'm also slowly building up my collection of other (physical) OpenVMS related books as I find them for reasonable second-hand prices, so far I have:

UNIX for OpenVMS Users
Publisher: Digital Press; 3rd Edition (May 2, 2003)
ISBN-10: 1555582761

Getting Started with OpenVMS: A Guide for New Users
Publisher: Digital Press; 1st Edition (November 27, 2002)
ISBN-10: 1555582796

OpenVMS with Apache, WASD, and OSU: The Nonstop Webserver
Publisher: Digital Press; 1st Edition (October 24, 2002)
ISBN-10: 1555582648

Linux and OpenVMS Interoperability
Digital Press; 1st Edition (April 15, 2003)
ISBN-10: 1555582672

OpenVMS System Management Guide
Publisher: Digital Press; 2nd Edition (November 7, 2003)
ISBN-10: 1555582435

OpenVMS AXP Internals and Data Structures, Version 1.5
Publisher: Digital Press;  (January 15, 1994)
ISBN-10: 155558120X

OpenVMS Alpha Internals and Data Structures: Memory Management
Digital Press; 1st Edition (December 6, 2002)
ISBN-10: 1555581595

OpenVMS Alpha Internals and Data Structures: Scheduling and Process Control
Publisher: Digital Press; 1st Edition (January 9, 1997)
ISBN-10: 1555581560

Getting Started with OpenVMS System Management
Publisher: Digital Press; 1st Edition (April 15, 2003)
ISBN-10: 1555582818

Writing OpenVMS Alpha Device Drivers in C: Developer's Guide and Reference Manual
Publisher: Digital Press; 1st Edition (1 Sept 1996)
ISBN-10: 1555581331

Using DECWindows MOTIF for OpenVMS
Publisher: Digital Press; 1st Edition (1993)
ISBN-10: 155581145

Alpha Architecture Reference Manual
Publisher: Digital Press; 1st Edition (1992)
ISBN-10: 155558098

I'm aware of, and watching for this book:

Writing OpenVMS Alpha Device Drivers in C: Developer's Guide and Reference Manual
Publisher: Digital Press; 2nd Edition (1 July 1999)
ISBN-10: 1555582095





Friday, 22 March 2019

Secure Web Browser Source


The Secure Web Browser source is available in two versions for Alpha: v1.7.13 and v1.1.12.

Confusingly v1.1.12 is actually the newer of the two as it refers to v1.1.12 of SeaMonkey which was the 'successor' to Mozilla, which is what the v1.7.13 version is.  There's also a Firefox version 2.0.18 but it is only for I64.

Additional files to build and kit the SWB are also required.

I unpacked the buildfiles into DKA0:[BUILDTOOLS], the source files into DKA0:[V1112], and the kitting tools into DKA0:[KITTINGTOOLS].

The actual build process does not occur in the DKA0:[V1112] folder, a separate folder is needed: DKA0:[v1112opt]

There used to be a page on the HP website that was dedicated to explaining, albeit with some missing and/or obsolete details (I don't think it'd been updated since v1.7.13), how to compile the source on OpenVMS.  It's since been lost in the HPE purge...
Fortunately I saved a copy, and it here repeated here verbatim for posterity and reference:

The following instructions are intended to serve as a guide for building Secure Web Browser (based on SeaMonkey) on OpenVMS. The instructions assume that the reader is a knowledgeable, experienced OpenVMS developer. This provide information on the tools and processes that OpenVMS Engineering team uses to build Secure Web Browser (SWB), but they are not step-by-step directions.

With all the prerequisite hardware and software configured correctly, follow these steps to build SWB on OpenVMS: 

  • Download SWB sources
  • Download build tools
  • Download kitting tools

Note: The build takes significant amount of time. For example, on a 667Mhz DS20E AlphaStation, building a non-debug version of Mozilla takes about 12 hours.

The following downloads are required to obtain the source code and associated build tools:

Alpha

» Download SWB V1.1-12 Sources

» Download the below build tools and utilities:

» GTK for OpenVMS
» OpenVMS Porting Library
» LibIDL for OpenVMS
» GNV for OpenVMS
» Perl for OpenVMS
» Alpha Build tools
» Alpha Kitting tools

Alpha:

System Software


The following system software is required: 

  • OpenVMS Alpha V7.3-2 or later
  • HP C V6.5-002
  • HP C++ V6.5-031 or later
  • DECC$SHR ECO with DECC$PIPE_BUFFER_QUOTA support
  • Alpha Macro64 V1.2
  • GNV V1.5-4 or later
  • Perl V5.8 or later
  • GTK+ 1.2-10 run time (this PCSI kit is available as part of the SWB 1.7-13 download)
  • OPL 1.0-0A6 run time (this PCSI kit is available as part of the SWB 1.7-13 download)
  • LibIDL build it from source 

Account Quotas

The build account should have the following quotas as a minimum:

Maxjobs:     0  Fillm:    300  Bytlm:    100000
Maxacctjobs: 0  Shrfillm:   0  Pbytlm:        0
Maxdetach:   0  BIOlm:    500  JTquota:    4096
Prclm:      20  DIOlm:    500  WSdef:      4000
Prio:        4  ASTlm:    500  WSquo:     16000
Queprio:     0  TQElm:    200  WSextent: 150000
CPU:    (none)  Enqlm:   3000  Pgflquo:  700000


Disk Space

In addition to the disk space requirements for the prerequisite software, the following is also required: 

  • 500,000 blocks for the source code area
  • 1,200,000 blocks for a non-debug build area and/or 8,500,000 blocks for a debug area
The Secure Web Browser (SWB) for OpenVMS Alpha and OpenVMS Integrity servers are built from Mozilla sources. Some of the files are modified to run SWB on OpenVMS and a few files were modified/replaced to provide the branding. The build procedure for SWB is identical to Mozilla.

Alpha:

SWB V1.1-12 (based on SeaMonkey V1.1.12) is used as an example throughout this section.

The directory structure will change based on user's environment. So, adjust system specific logicals and symbol variables to match with your system.
  • Download build tools and copy them on to OpenVMS Alpha system
    • $RUN swb_axp_buildtools.sfx_axpexe to generate a .bck file
    • Run the BACKUP command to restore the .bck file
  • Copy .bashrc file to your sys$login directory
  • Download SWB V1.1-12 source code and do the following;
    • $RUN swb_axp_v1112source.sfx_axpexe to generate a .bck file
    • Run the BACKUP command to restore the .bck file
  • Run swb_axp_setup.com to set the build environment

For example, SWB and GNV logicals will get defined like this:

SWB logicals

(LNM$PROCESS_TABLE)

"MOZ_OBJROOT" = "_DKA200:[v1112opt.]"
"MOZ_SRCROOT" = "_DKA200:[v1112.mozilla.]"
"MOZ_SRCTOP" = "_DKA200:[v1112]"


GNV logicals

(LNM$PROCESS_TABLE) 

GNV_CC_INCLUDE_LENGTH_MAX" = "400"
GNV_CC_WARN_INFO" = "1"
GNV_CXX_SET_COMMAND" = "DEFINE/USER
DECC$FILENAME_UNIX_ONLY FALSE"
GNV_EXTRA" = "_DKA200:[gnv_extra]"
GNV_LINK_AUTO_SYMVEC_NODUPS" = "1"
GNV_LINK_LIB_TYPES" = "so exe a"
GNV_LINK_MISSING_LIB_ERROR" = "1"


Setting up Configure

Bash>

cd /moz_srcroot
mv configure configure.old
sed \
-e 's/"confdefs.h"/"confdefs.h"\
#ifdef GENERIC_PTHREAD_REDEFINES\
#include "motif_redefines.h"\
#endif/' \
-e 's/^int *$//' \
-e 's/i*n*t* *main *()/\
#ifdef __cplusplus\
extern "C" { void __posix_exit(int); }\
#else\
void __posix_exit(int);\
#endif\
int maine();\
int main() {\
__posix_exit(maine());\
}\
int maine()/' \
-e \
'/^(set)/{
N
/^.*$/c\
# On some platforms the copious set output fills the pipe and we hang.\
(set) > /tmp/set$$.tmp 2>&1\
cat /tmp/set$$.tmp |\
case `(ac_space=" "; cat /tmp/set$$.tmp | grep ac_space) 2>&1` in
}' \
configure.old > configure


Another fix to configure is needed for Mozilla 1.7:

old
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done

new
" $ac_file_inputs > /tmp/cs.tmp
sed -f conftest.subs /tmp/cs.tmp > $ac_file
rm /tmp/cs.tmp
fi; done


Running Configure (non debug) 

$ create /dir [.vms_cxx]
$ library /object /create [.vms_cxx]CXX$LINK.OLB
$ set file /ent=[.vms_cxx]CXXINK.OLB [.vms_cxx]CXX$LINK.OLB ! make bug
$!
$! VMS build optimization
$ create /dir moz_objroot:[dist.bin]
$ create /dir moz_objroot:[dist.lib]
$ copy /log work:[work.cxx]libvmscxx.so moz_objroot:[dist.bin]libvmscxx.so
$ copy /log work:[work.cxx]libvmscxx.so moz_objroot:[dist.lib]libvmscxx.so

. /work/work/moz.sh # define moz_srcroot and moz_objroot
. /work/work/moz.sh # define moz_srcroot and moz_objroot
cd $moz_objroot
/moz_srcroot/configure \
--enable-application=suite \
--with-pthreads --disable-gtktest --disable-glibtest \
--disable-profilesharing \
--enable-md --disable-tests \
--without-zlib --enable-extensions=default,irc \
--with-glib --with-glib-prefix=/_dka0/gtk/1_2_10/glib/ \
--with-gtk --with-gtk-prefix=/_dka0/gtk/1_2_10/gtk/ \
--with-libIDL-prefix=/_dka200/libIDL-0.6.5 \
--enable-crypto --disable-freetype2 --enable-nspr-autoconf \
--disable-debug --enable-optimize



Tidy up after configure:
rm .MAP

Finally, start the build:
mkdir logs
/gnu/bin/make -j2 > logs/build 2>&1 # or use /work/work/build.sh


Scan log file for errors:

bash$ /work/work/scanlog build.
Total C Modules: 628
C++ Modules: 1953
C/C++ Info: 144
C/C++ Warn: 547
C/C++ Error: 0
C/C++ fatal: 0
Share Images: 90
Archive Warns: 0
Archive Errs: 0
Symbol Trunc: 0
Symbol Dupl: 0
gmake errs: 0
DCL errs: 0
Link errs: 0
link undefsym: 0


After the Build

Download kitting tools and copy them on to OpenVMS Alpha system
  • $RUN swb_axp_Kittingtools.sfx_axpexe to generate a .bck file
  • Run the BACKUP command to restore the .bck file
The "kit" contains all files in the dist/bin tree. Copy these files to a user defined directory and then create the kit.

$! Create saveset from build area
$ define xxx build1:[v1112opt.dist.] /trans=conc
$ back /log /nocrc /group=0 xxx:[bin...]*.*;0 sys$manager:V1112opt.sav/sav
$! Restore saveset into run/kit area
$ set default work:[work]
$ back /log sys$manager: V1112opt.sav/sav [...]*.*
$ rename bin.dir V1112opt.dir
$ set def work:[work.V1112opt]
$ @[-]swb_axp_tidy
$ delete [...]*.dir;* /log ! until no more deletes
$ @mozilla ! Just launch, select any menu item and exit
$! Create the Mozilla PCSI kit
$ set def work:[work]
$ @swb_axp_pcsi
$! make sure GTK and OPL kits are in place and match software statements
$ @swb_axp_make_kit


Incremental Building

Once SWB is built and running, you can make changes as necessary.

Important: Change the source code in the source tree (/v1112/mozilla/...) and build in the object tree (/v1112opt/...). Do not attempt to build in the source tree.

It is faster to build where changes have been made (assuming that the changes are not global in nature). You can use gmake build from the top of the object tree, but this will take few hours just to build one or two files that were changed.

Depending upon the build type, follow these steps for an incremental build:

Shared Build:
  • gmake in the object directory which corresponds to the source directory where changes were made.
  • If a shared image (.so) was not created, find the directory where the shared image is built and gmake there as well (usually there is a build directory one or two levels higher in the tree).
  • Copy the newly built shared image (.so) file out into the SWB run tree.
Static Build:
  • gmake in the object directory which corresponds to the source directory where changes were made.
  • If a library file (.a) was not created, find the directory where the library file is built and gmake in there as well (usually there is a build directory one or two levels higher in the tree). Note that the library file must be named something like foo.a. If only foo_s.a is built, you must still find the directory where foo.a gets built.
  • gmake in xpfe/bootstrap. This will rebuild the mozilla-bin image which you then copy out into your SWB run tree.

Thursday, 21 March 2019

Installing other GNV libraries


Additional GNV libraries can be downloaded from here, and installed.  These are very useful GNU-based libraries that many other packages are dependent on.  There are a lot of inter-dependencies between the libraries, the following installation order avoids issues with missing dependencies:

pkg-config v0.21-0 ECO1
expat v2.0-0 ECO1
gettext v0.16-1
zlib 1.2-7
freetype v2.2-1
fontconfig v2.3-2
libxrender v0.9
libpng v1.2-13 ECO1
cairo A1.2-6
GLIB A2.12-6 ECO3
ATK v1.12-4 ECO1
JPEG v6.0-0B
TIFF v3.8.2 ECO1
GNUTAR v1.19
Pango v1.14-8 ECO2
cURL v7.19-6

When installing, I did not use default options as this does not include installing the source files which are needed to assist with compiling newer versions and/or optimising these versions.

Some, but not all, then require startup scripts in the SYSTARTUP_VMS.COM script:

$ set process /parse_style=extended
$ @SYS$STARTUP:EXPAT_STARTUP.COM
$ @SYS$STARTUP:GETTEXT_STARTUP.COM
$ @SYS$STARTUP:GNV$ZLIB_STARTUP.COM
$ @SYS$STARTUP:FREETYPE_STARTUP.COM
$ @SYS$STARTUP:FONTCONFIG_STARTUP.COM
$ @SYS$STARTUP:LIBPNG_STARTUP.COM
$ @SYS$STARTUP:CAIRO_STARTUP.COM
$ @SYS$STARTUP:GLIB_STARTUP.COM
$ @SYS$STARTUP:ATK_STARTUP.COM
$ @SYS$STARTUP:TIFF_STARTUP.COM
$ @SYS$STARTUP:PANGO_STARTUP.COM
$ @SYS$STARTUP:CURL_STARTUP.COM




Wednesday, 20 March 2019

Installing LibIDL

CSWB, as well as some other products such as the CSWS, require LibIDL 0.6.3 or later in order to compile.

The LibIDL version that used to be on the HP OpenVMS website, and can still be found at their FTP site here as well as on the OpenVMS Open Source CD, is v0.6.5.

It only comes in a compilable source version, and requires GTK version 1.2.7 or greater to be installed in order to successfully compile.  Additionally, it requires some re-configuration for the specific environment in which it is being compiled/installed, and I also found I had to undertake a few modifications to get it to successfully compile:

1) edit libIDL-config-VMS. to reflect installation environment by adjusting installation location of GTK+ and libIDL source by changing these lines to the correct locations of the libIDL source, and GTK install, mine were:

LIBIDL_ROOT=/dka0/libIDL/v0.6.5
GTK_ROOT=/dka0/software/gtk

2) edit build_vms.sh and change the following lines

vms_defines="-Wc/name=(AS_IS,short)"
to
vms_defines="-names_as_is_short"

delete every instance of -DCPP_PROGRAM=\"cc\ -E\"

change
ar c libIDL.a parser.o lexer.o ns.o util.o vms_alloca.o
to
ar rc libIDL.a parser.o lexer.o ns.o util.o
(note the change from ar c to ar rc)

delete or comment out the lines (no longer required as VMS now has malloc):

#
echo Compiling vms_alloca...
cc -c \
  $vms_defines \
  -o vms_alloca.o vms_alloca.c

3) edit util.c as follows:

replace

CPP_PROGRAM "

with

"cxx -E 

The modifications to remove the -DCPP_PROGRAM from util.c are a fudge, I can't seem to get the original approach to work which is to pass the substitution via the -D command line parameter.  It's possible if there are no spaces, i.e. -DCPP_PROGRAM=\"cxx\" but when an (escaped) space is used, i.e. -DCPP_PROGRAM=\"cc\ -E\" the program fails to compile.

As is often the case, the default LibIDL source doesn't enable optimizations, but it's fairly easy to edit the source to enable optimized code to be produced, just edit the following line in build_vms.sh to:

vms_defines="-names_as_is_short -opt=(tune=host)"

I also managed to compile version 0.6.8, available from here.  I copied over the following files from the 0.6.5 VMS version:

build_vms.sh
libIDL-config-VMS.
readme.vms

After making the modifications above for 0.6.5, it required further modifications:

edit libIDL-config-VMS.
and change LIBIDL_LIBRARY_VERSION=0.6.5 to LIBIDL_LIBRARY_VERSION=0.6.8
and amend the definition of LIBIDL_ROOT to point to the 0.6.8 source code

edit build_vms.sh and replace:
sed \
  -e 's/@LIBIDL_MAJOR_VERSION@/0/g' \
  -e 's/@LIBIDL_MINOR_VERSION@/6/g' \
  -e 's/@LIBIDL_MICRO_VERSION@/5/g' \

with:
sed \
  -e 's/@LIBIDL_MAJOR_VERSION@/0/g' \
  -e 's/@LIBIDL_MINOR_VERSION@/6/g' \
  -e 's/@LIBIDL_MICRO_VERSION@/8/g' \
  -e 's/@HAVE_WCHAR_H@/1/g' \
  -e 's/@HAVE_WCSTR_H@/1/g' \

and find the lines:

echo Compiling util...
cc -c \

and add immediately afterwards the following line:
-DCPP_NOSTDINC=\"-nostdinc\"

For completeness, I also edited readme.vms and replaced the two instance of 0.6.5 with 0.6.8

Later versions of LibIDL are available from here, but versions 0.7.x and greater require GTK+ version 2.x or greater.

Monday, 18 March 2019

Installing MMK

MMK is an improved version of the old DEC MMS program, essentially both are VMS versions of make.  MMS is so old it tends to choke on the more complex description files of newer Open Source compilations such as Perl.

MMK is available on the freeware CD (look for make-mmk), or the HP FTP site here.  However, these are both old versions so it's best to download the latest version from github here.  The latest version I've installed is v5.1

Once unzipped, it's pretty straight forward to compile it from the folder it was unzipped into:

$ @compile

Then copy the executable in [.BIN-Alpha] into SYS$COMMON:[SYSEXE] and the following line to SYLOGIN.COM

$ mmk :== $sys$common:[sysexe]mmk

In order to optimize the MMK build, I first opened compile.com and replaced CC/NOLIST with CC/OPT=(TUNE=HOST)/NOLIST


Saturday, 16 March 2019

Installing GTK+

CSWB requires GTK+ in order to compile.
GTK requires a C compiler, OpenVMS Porting Library, PERL, and AWK to compile.  With some editing it can compile without PERL and AWK.

The latest version of GTK+ provide by HP for OpenVMS is 1.2.10-A1.  It is available both as an installable PCSI included with the CSWB download, and as compilable source code.

The file GTK1210-OPENVMS-A1.SFX_AXPEXE was downloaded and ran to unpack the contents into the directory in which it is in (for this reason I ran it in the folder DKA0:[GTK.v1_2_10].

The file vms_build_setup.com needs editing to define the location of the GTK source tree, and the OPL.  For me it looked like this:

define /nolog groot /trans=conc dka0:[gtk.v1_2_10.]
define /nolog grootu "/dka0/gtk/v1_2_10"

define /noloj vjid dka0:[porting.dist.include]
define /nolog vjidu "/dka0/porting/dist/include"

define /nolog vms_jackets dka0:[porting.dist.lib]vms_jackets

Then the GTK+ compilation can be started by running vms_build.com

As is often the case, the default GTK+ source doesn't enable optimizations, but it's easy to edit the source, before compiling, to enable optimized code to be produced:

edit vms_cc.com
and change line:
  cc_debug =""
to:
  cc_debug = "/opt=(tune=host,inline=speed)"






Installing PERL

Perl is used a lot, and still has native support for OpenVMS which is nice.  There's also a dedicated OpenVMS Perl maintainer/volunteer that makes installable PCSI images available here.

The latest version of Perl source for compiling can be downloaded from here.  Look for the Unix source download.  I installed version 5.28.1.

The Perl source comes in *.tar.gz or *.tgz format so I used gzip to ungzip it, and then vmstar to untar it as follows:

$ gunzip *.gz
$ vmstar -xf perl-5^.28^.1.tar

This will result in the folder [.PERL-5_28_1] being created and ready for compilation.

Compilation and installation is pretty straight forward (but takes a while), instructions can be found in readme.vms.  Essentially it's:

@configure
mmk
mmk test
mmk install

however the configure script asks a lot of questions, and I've previously found its easier to run:

@configure "-des"

which chooses defaults for almost everything and seems to work fine on OpenVMS.

I have more recently started trying to tweak the configuration options and currently am running the following non-default options:

Try to use 64-bit integers? y
Try to use maximal 64-bit support? y
Try to use long doubles? y
Make unlink() delete all versions? y
Any additional cc flags? /OPT=(TUNE=HOST)
Installation prefix? SYS$COMMON:[PERL-5_28_1]
use the malloc that comes with perl 5? y

MMS apparently does not work, you have to use MMK.

There's a lot of tests (there's a lot of Perl!) so it takes a long time for them all to run.  It is worth running them though to ensure that the compilation has been successful and reduce the likelihood it is the source of other open source compilation problems.

On the most recent run, I ended up with 28 tests out of 2367 that failed.

Once installed, add the following line to SYLOGIN.COM:

$ @SYS$COMMON:[PERL-5_28]PERL_SETUP.COM


Friday, 15 March 2019

Installing gzip

GZip is a very useful utility for unzipping files with a *.gz extension.

The latest OpenVMS version I know of is 1.5b, and it can be downloaded either as a pre-built image from here or compilable source from here.

Both archives extract into folder [.gzip-1_5b_vms]

Then MMS or MMK can be run from this folder as follows:

MMS/DESCRIP=[.VMS]DESCRIP.MMS CLEAN_ALL
MMS/DESCRIP=[.VMS]DESCRIP.MMS /MACRO=(LARGE=1)

Once compiled, the newly created executable GZIP.EXE can be copied to SYS$COMMON:[SYSEXE] and the following lines added to SYLOGIN.COM:

$ gzip :== $sys$common:[sysexe]gzip.exe
$ gunzip :== "$sys$common:[sysexe]gzip.exe -d"
$ gzcat :== "$sys$common:[sysexe]gzip.exe -cd"

The [.VMS]descrip.mms describes a CCOPTS macro that can be used to add additional compiler options such as enabling optimisations, but it doesn't seem to work (and I can't find any code for it in any of the .mms files).  So I manually enabled optimisations by changing the descrip.mms file as such before compiling:

# Default C compile rule.

.C.OBJ :
    $(CC) $(CFLAGS) /opt=(tune=host,inline=speed,level=5) /define=($(CDEFS)) $(MMS$SOURCE)

There's also a really useful little utility created called DECC_VER.EXE that when run lists the VMS, DECC, and CRTL version numbers.  Mine are currently:

__VMS_VERSION: >V8.4    <.
__VMS_VER  = 80400022.
__DECC_VER = 70390009.
__CRTL_VER = 80400000.

Thursday, 14 March 2019

OpenVMS Porting Library

The OpenVMS Porting Library (OPL) provides key files to assist with porting open source to OpenVMS.

Installation is via PCSI, or compilable source. The PCSI just installs the shareable image, and not the header files, so it is only useful for running programs that are based on it - not compiling with it.

The compilable source needs modification as newer versions of the CRTL have superseded some parts of the OPL and compiling can throw errors, an example is realpath which is in the OPL but now also in the CRTL.

The latest version of the OPL is version A9. Running the porting-a9.sfx_axpexe file unpacks the files into the directory, and the included porting_relnotes.txt explained how to compile and install the OPL using the included make files.

Prior to compilation a few modifications are required to remove parts that are no longer required due to updates to the CRTL:

JACKETS_ALPHA.OPT
remove the line:
  GENERIC_REALPATH=PROCEDURE,-

makefile.vms
remove the line:
  realpath.c \

vms_jackets.h
remove the line:
#define realpath   GENERIC_REALPATH

I installed it using the following commands:

$ gmake == "$DKA0:[software.opl]make_3_76_1_vms_alpha"
$ gmake "RUBY_RTL=1"
$ gmake "DIST_TOP=DKA0:[PORTING.DIST.]" install


This resulted in a compiled copy of the OpenVMS Porting Library being installed in DKA0:[PORTING.DIST] with the additional OpenVMS 7.3-1+ (RUBY) functions enabled.

The OPL can also be easily adjusted to compile as an optimised build by editing a line in the makefile.vms, before compiling as above, as such:

# Compiler flags we always want
CFLAGS += /prefix=all /include=[] /warn=disable=portable /optimize=(tune=host)





Wednesday, 13 March 2019

Installing GNV (GNUs Not VMS)


Installing GNV is necessary to provide access to a lot of GNU utilities that are required for porting open source software to OpenVMS.  The latest HP GNV software package needs to be installed to configure the overall environment and settings, before the newer versions of these utilities (that have been compiled for GNV) can be installed.

The latest HP version is GNV v3.0-1 and it's available from the HP FTP site here.

Once GNV was installed then updated versions of the utilities, found here, were installed.  This resulted in the following tools (and versions) being installed:

ar_tools v3.0-4
bash v4.3-46
bzip2 v1.0-6
coreutils v8.26
diffutils v3.5
gawk v4.2-1
grep v2.25
ld_tools 3.0-6
make v3.78-1 ECO2
ncompress v4.2-4
sed v4.2-2
unzip v6.0
vmstar v4.2

Most require a startup script to be called within the SYSTARTUP_VMS.COM script:

$ SET PROCESS /PARSE_STYLE=EXTENDED
$ @SYS$STARTUP:GNV$STARTUP.COM
$ @SYS$STARTUP:GNV$BASH_STARTUP.COM
$ @SYS$STARTUP:GNV$AR_TOOLS_STARTUP.COM
$ @SYS$STARTUP:GNV$BZIP2_STARTUP.COM
$ @SYS$STARTUP:GNV$COREUTILS_STARTUP.COM
$ @SYS$STARTUP:GNV$DIFFUTILS_STARTUP.COM
$ @SYS$STARTUP:GNV$GAWK_STARTUP.COM
$ @SYS$STARTUP:GNV$GREP_STARTUP.COM
$ @SYS$STARTUP:GNV$LD_TOOLS_STARTUP.COM
$ @SYS$STARTUP:GNV$MAKE_STARTUP.COM
$ @SYS$STARTUP:GNV$NCOMPRESS_STARTUP.COM
$ @SYS$STARTUP:GNV$SED_STARTUP.COM
$ @SYS$STARTUP:GNV$UNZIP_STARTUP.COM
$ @SYS$STARTUP:GNV$VMSTAR_STARTUP.COM

Tuesday, 12 March 2019

Installing Compilers, etc, from the Software Product Library

CSWB requires a C, C++, and Macro64 compiler to be installed and licensed.

First step to installing Software is to copy the ZIP and UNZIP utilities from the FREEWARE CD  into the SYS$COMMON:[SYSEXE] folder.
Then add the following lines to the SYLOGIN.COM script:

unzip :== $sys$common:[sysexe]unzip.exe
zip :== $sys$common:[sysexe]zip.exe

Through the Hobbyist program and download package, and some old SPL CDs, I installed and licensed the following software products:

HP C Compiler v7.3-009
HP C++ Compiler v7.3-009
DEC Fortran Compiler v8.2-104679-48H9K
DEC CXML v5.2-1
Ada Compiler v3.5
Pascal Compiler v6.1-116
BASIC Compiler v1.7
COBOL Compiler v2.9-1453
Macro64 Assembler v1.1

I also installed Modular Management System (MMS) v3.8 from the DECSET 12.8 ECO1 package, but didn't install the rest of the DECSET package.  I prefer MMK to MMS, but find its sometimes useful to have MMS available in case I suspect MMK is the cause of a compilation problem.

I also have a 7.3 ECO1 version of the HP C Compiler on an old OpenVMS SPL CD, but when I installed it seemed to cause some difficulty compiling programs, and the help-file was full of references to Tru64 which was weird.

Most require startup scripts to be called within the SYSTARTUP_VMS.COM script:

$ @SYS$STARTUP:DECC$STARTUP.COM
$ @SYS$STARTUP:CCXX$STARTUP.COM
$ @SYS$STARTUP:ADA$STARTUP.COM
$ @SYS$STARTUP:FORT$STARTUP.COM
$ @SYS$STARTUP:CXML$STARTUP.COM
$ @SYS$STARTUP:PASCAL$STARTUP.COM
$ @SYS$STARTUP:DECSET$ENVMGR_STARTUP.COM
$ @SYS$STARTUP:MMS$STARTUP.COM

Saturday, 9 March 2019

Installing OpenVMS

OpenVMS was installed from CD-ROM using the ALPHA084 Hobbyist ISO, all installation/configuration options were geared towards a non-clustered install with a focus on maximising performance (building the SWB is estimated to take 10-12hrs on a DS20e).

Hard drive for installation: DKA0, and this was INITALIZEd as ODS-5 with hard links enabled.
DECnet: not installed
DECwindows Motif: installed
DECnet-Plus: not installed
DECnet Phase IV: not installed
HP TCP/IP Service: installed

Once installation was complete, the LPKs were installed and the system rebooted

Next steps were to decompress all the system libraries:

$ @SYS$UPDATE:LIBDECOMP.COM

Then a few additional modifications to the drive structure, namely enabling Access Dates, and disabling high water marking:

$ SET VOLUME DKA0: /VOLUME_CHARACTERISTICS=(ACCESS_DATES) /NOHIGHWATER_MARKING

Then all the OS patches I could find were installed:

DEC AXPVMS VMS84A_PCSI V4.0
DEC AXPVMS VMS84A_UPDATE V11.0
DEC AXPVMS VMS84A_MANAGE V2.0
DEC AXPVMS VMS84A_LDAP V3.0
DEC AXPVMS VMS84A_F11X V3.0
DEC AXPVMS VMS84A_ENCRYPT V2.2
DEC AXPVMS VMS84A_ACMELDAP v3.0
HP AXPVMS HPBINARYCHECKER V1.2

Followed by various TCPIP patches, and upgrading the core SSL

DEC AXPVMS TCPIP V5.7-13ECO5
DEC AXPVMS TELNET_PAT V5.7-13ECO5A
DEC AXPVMS TCPIP_CVE_PAT V5.7-ECO5
HP AXPVMS SSL V1.4-502
HP AXPVMS SSL1 V1.0-2C

I know there are newer versions of OpenSSL available, and will compile and install them in due course - I just wanted to first get the official HP versions installed.

If anyone has any additional/new patches I'd love to get hold of them...

Thursday, 7 March 2019

Hardware Specs

Here's what I currently have to work with:

Compaq AlphaServer DS20e (Rack version)
2x 667MHz EV67 CPU pass 2.2.1/2.2.3 (21264A)
3GB ECC SDRAM (8x256MB, 8x128MB)
Radeon 7500 64MB PCI Graphics Card
HP NC7771 PCI-X Gigabit Ethernet Network Interface Card
Compaq Smart Array 5304 256MB 4-channel RAID Controller
5x HP BF03687B54 36.4GB 15k U320 SCSI Hard Drives, RAID0
1x 36GB 15k U320 SCSI Hard Drive, non-RAID
3x 375W Hot Plug Power Supplies
Combo 24x CD-ROM and 1.44MB FDD

2x Digital Personal Workstation 600au
600MHz EV56 CPU (21164A)
1.5GB RAM
Powerstorm 4D20 Graphics Card
2x 36GB 15k SCSI Hard Drive
IDE CD-ROM

All machines are KVM'd to a HP 1920x1200 ZR24W Monitor, DEC VMS keyboard, and generic PS/2 optical mouse.

The Radeon 7500 is a reference card, not an official HP Alpha card, but works perfectly.

The NC7771 NIC has been firmware modified using this Hardware hack, to make it appear as a 3X-DEGXA-TB, it works perfectly.

The SA5300 is an official Compaq card, but not the 5300A.  Running the Alpha Firmware Update CD-ROM flashed it to the 5300A firmware and it now appears as a 3X-KZPDC-DF device.

According to the QuickSpecs for the 5300A it is only compatible with pass 2.6+ of the EV67, however I've now been running this 5300A with my pass 2.2.x EV67 for over 6 months with no issues to date.  I've never managed to find out what is different about pass 2.6 compared to 2.2 that stipulated the 5300A requirement for a 2.6+.

The SA5300 only supports up to U160; I did buy a Smart Array 6400 as it supports up to U320 but only realised after it'd arrived that it is a 3.3V-only PCI-X card, and the DS20e PCI slots are keyed only for 5V cards.  So it still sits in the box...

Currently the DS20e is running OpenVMS 8.4, and the PWS600au is running VMS and Tru64 5.1B.