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.

No comments:

Post a Comment