Original post is here: eklausmeier.goip.de
I tried to install IBM COBOL for Linux multiple times. I tried to install it on Arch Linux, which is the Linux I use:
Initially I succeeded in installing the IBM compiler in 2021. The IBM compiler compared very favorably against the GNU Cobol compiler, see Comparing GnuCOBOL to IBM COBOL. But in 2023 this installation procedure failed. So, no IBM COBOL on Arch Linux.
Richard Nelson from IBM contacted me today and mentioned that IBM COBOL should also run on Arch Linux. So I tried to install the latest version 1.2.0.2 again. Version 1.2 is particularly appealing as it supports 64 bit. IBM COBOL compilers were notorious with lacking 64 bit support, see Memory Limitations with IBM Enterprise COBOL Compiler.
My current Arch Linux setup is as given in below table.
Type | Version |
---|---|
Linux | 6.7.6-arch1-2 #1 SMP PREEMPT_DYNAMIC x86_64 GNU/Linux |
gcc | gcc version 13.2.1 20230801 (GCC) |
glibc | 2.39-1 |
gcc-libs | 13.2.1-5 |
1. Download. Software package is here: IBM COBOL for Linux on x86.
IBM now uses this annoying two-factor authorization procedure, click through all these hoops.
This 2FA makes it essentially impossible to write an AUR package, which downloads the IBM file within the PKGBUILD
.
The file in question is IBM_COBOL_V1.2.0_LINUX_EVAL.x86-64.240110.tar.gz
. Its size is 116 MB.
1$ tar ztvf IBM_COBOL_V1.2.0_LINUX_EVAL.x86-64.240110.tar.gz
2drwxr-sr-x root/root 0 2023-06-06 01:05 images/
3drwxr-sr-x root/root 0 2024-01-10 16:16 images/rhel/
4-rw-rw-r-- root/root 26210268 2024-01-10 16:16 images/rhel/cobol.rte.1.2.0-1.2.0.2-231215.x86_64.rpm
5-rw-rw-r-- root/root 2331592 2024-01-10 16:16 images/rhel/cobol.dbg.1.2.0-1.2.0.2-231215.x86_64.rpm
6-rw-rw-r-- root/root 3055224 2024-01-10 16:16 images/rhel/cobol.cmp.license-eval.1.2.0-1.2.0.2-231215.x86_64.rpm
7-rw-rw-r-- root/root 11199076 2024-01-10 16:16 images/rhel/cobol.cmp.1.2.0-1.2.0.2-231215.x86_64.rpm
8drwxr-sr-x root/root 0 2024-01-10 16:17 images/sles/
9-rw-r--r-- root/root 22295780 2024-01-10 16:17 images/sles/cobol.rte.1.2.0-1.2.0.2-231215.x86_64.rpm
10-rw-r--r-- root/root 1975984 2024-01-10 16:17 images/sles/cobol.dbg.1.2.0-1.2.0.2-231215.x86_64.rpm
11-rw-r--r-- root/root 2999760 2024-01-10 16:17 images/sles/cobol.cmp.license-eval.1.2.0-1.2.0.2-231215.x86_64.rpm
12-rw-r--r-- root/root 9095804 2024-01-10 16:17 images/sles/cobol.cmp.1.2.0-1.2.0.2-231215.x86_64.rpm
13drwxr-sr-x root/root 0 2024-01-10 16:17 images/ubuntu/
14-rw-r--r-- root/root 1957512 2024-01-10 16:17 images/ubuntu/cobol.dbg.1.2.0_1.2.0.2-231215_amd64.deb
15-rw-r--r-- root/root 2992220 2024-01-10 16:17 images/ubuntu/cobol.cmp.license-eval.1.2.0_1.2.0.2-231215_amd64.deb
16-rw-r--r-- root/root 10125300 2024-01-10 16:17 images/ubuntu/cobol.cmp.1.2.0_1.2.0.2-231215_amd64.deb
17-rw-r--r-- root/root 22514248 2024-01-10 16:17 images/ubuntu/cobol.rte.1.2.0_1.2.0.2-231215_amd64.deb
18-rwxr-xr-x root/root 6763 2024-01-10 16:32 install
19-rw-r--r-- root/root 820691 2023-06-06 01:05 install.pdf
20-rwxr-xr-x root/root 2694559 2023-06-06 01:12 LicenseAgreement.pdf
21-rwxr-xr-x root/root 285651 2023-06-06 01:12 LicenseInformation.pdf
22-rwxr-xr-x root/root 57001 2023-06-06 01:12 notices
23-rw-r--r-- root/root 311858 2023-06-06 01:14 quickstart.fr_FR.pdf
24-rw-r--r-- root/root 311477 2023-06-06 01:14 quickstart.ja_JP.pdf
25-rw-r--r-- root/root 281309 2023-06-06 01:14 quickstart.pdf
26-rwxr-xr-x root/root 2932 2023-06-06 01:12 README
2. Unpacking the Ubuntu part. We will extract the Ubuntu part, highlighted above.
1$ tar zxf IBM_COBOL_V1.2.0_LINUX_EVAL.x86-64.240110.tar.gz images/ubuntu/
Change to images/ubuntu
directory and run the below loop, which first unpacks the deb-files with ar
, then unpacks the resulting tar.xz
data file with tar Jx
:
1for i in *.deb; do ar xf $i; tar Jxf data.tar.xz; done
This creates a subdirectory opt
with 188 entries.
Move the resulting opt
or opt/ibm
to the "real" /opt
and chown -R root:root
all the files.
Installation size is 135 MB.
3. Checking the installation. See, whether all libraries are in place.
1$ ldd /opt/ibm/cobol/1.2.0/bin/cob2
2 linux-vdso.so.1 (0x00007ffebab8a000)
3 librt.so.1 => /usr/lib/librt.so.1 (0x000070366a43e000)
4 libdl.so.2 => /usr/lib/libdl.so.2 (0x000070366a439000)
5 libpthread.so.0 => /usr/lib/libpthread.so.0 (0x000070366a434000)
6 libc.so.6 => /usr/lib/libc.so.6 (0x000070366a252000)
7 /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x000070366a47a000)
8
9$ ldd /opt/ibm/cobol/1.2.0/bin/cob3
10 not a dynamic executable
11
12$ ldd cob3_64
13 linux-vdso.so.1 (0x00007ffeddbf9000)
14 librt.so.1 => /usr/lib/librt.so.1 (0x00007a35119f5000)
15 libdl.so.2 => /usr/lib/libdl.so.2 (0x00007a35119f0000)
16 libicuuc_64r.so => /opt/ibm/cobol/1.2.0/usr/bin/./../../../rte/usr/lib/libicuuc_64r.so (0x00007a3510600000)
17 libcob2_64r.so => /opt/ibm/cobol/1.2.0/usr/bin/./../../../rte/usr/lib/libcob2_64r.so (0x00007a3510000000)
18 libm.so.6 => /usr/lib/libm.so.6 (0x00007a3511904000)
19 libc.so.6 => /usr/lib/libc.so.6 (0x00007a3511720000)
20 libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007a350fc00000)
21 libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007a35116fb000)
22 libicudata_64r.so => /opt/ibm/cobol/1.2.0/usr/bin/./../../../rte/usr/lib/libicudata_64r.so (0x00007a350da00000)
23 libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007a35116f6000)
24 /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007a3511a31000)
25 libicui18n_64r.so => /opt/ibm/cobol/1.2.0/usr/bin/./../../../rte/usr/lib/libicui18n_64r.so (0x00007a350d200000)
26 libdfp_64r.so => /opt/ibm/cobol/1.2.0/usr/bin/./../../../rte/usr/lib/libdfp_64r.so (0x00007a350ca00000)
For convenience add the bin-directory to the PATH
:
1$ export PATH=$PATH:/opt/ibm/cobol/1.2.0/bin
Up to this point, running the compiler would report a license problem. The actual compiler is cob2
.
Here is an example, once the license is setup correctly:
1$ cob2 hello1.cob
2IBM COBOL for Linux 1.2.0 compile started
3End of compilation 1, program HELLO1, no statements flagged.
4. Getting a 60 day trial license.
Richard Nelson sent me a new file libxlcmpev_64r.so
.
With this new library file the compiler works flawlessly.
1$ license_check
2Evaluation (Trial/Eval/TnB) license
3Current date Sat, 02 Mar 2024 17:54:00 GMT
4Activation date Thu, 29 Feb 2024 00:00:01 GMT
5Expire date Mon, 29 Apr 2024 23:59:59 GMT
6Days left 58
Thanks Richard!
Also, Richard mentioned the install
shell script in the original tar file, see line 18.
I didn't make use of that! My fault.
Once I knew that this libxlcmpev_64r.so
is problematic, and looking at the install script:
...
extendTrial="$reldir/cobol/$version/usr/bin/xlcmp xlcbl && rm $reldir/cobol/$version/usr/bin/xlcmp"
eval $extendTrial
...
Generating the license now goes like this, as user root:
1/opt/ibm/cobol/1.2.0/usr/bin/xlcmp xlcbl
This generates a new 1.2.0/usr/lib/libxlcmpev_64r.so
.
This provides a valid 60 day license.
1$ license_check
2Evaluation (Trial/Eval/TnB) license
3Current date Sat, 02 Mar 2024 18:14:24 GMT
4Activation date Sat, 02 Mar 2024 00:00:01 GMT
5Expire date Wed, 01 May 2024 23:59:59 GMT
6Days left 60