Skip to content

Installing the COBOL-IT Compiler Suite

This document describes how to install and how to use the COBOL-IT Compiler Suite.

Installing COBOL-IT

The COBOL-IT compiler cobc requires that a C Compiler be installed on the host platform.

For a complete port list, including C Compilers that have been tested and are supported, see Port List with Supported C Compilers.

The COBOL-IT Compiler Suite Distribution

COBOL-IT Compiler Suite Unix/Linux distributions are provided in a "makeself" self-extracting archive file. A file-naming convention is observed when naming the distribution files. For example, the downloadable distribution for the Compiler Suite version 4.10.0 for the 64-bit Enterprise Linux x86 operating environments is named:

cobol-it-4.10.0-enterprise-64-x86_64-pc-linux-gnu_installer.sh

COBOL-IT Compiler Suite Windows distributions are provided in a Windows Setup executable. The downloadable distribution for the Enterprise Edition of the Compiler Suite version 4.10 for Windows 64-bit operating environments is named:

cobol-it-4.10-64-x64-vc2015-windows-enterprise-311224-setup.msi

Enterprise Editions of the COBOL-IT Compiler Suite are downloadable from Micro Focus, with access provided by your Sales Representative.

Installing On Linux/Unix

The COBOL-IT Linux/Unix 32-bit binary distributions are intended to be installed in /opt/cobol-it4. The COBOL-IT Linux/Unix 64-bit binary distributions are intended to be installed in /opt/cobol-it4-64.

An example with a 64-bit Linux binary distribution:
As a root user, download the installer.sh that is compatible with your platform.
cobol-it-4.10.0-enterprise-64-x86_64-pc-linux-gnu_installer.sh

From the folder in which the COBOL-IT install is located:

As superuser, run the installer.
% sudo sh cobol-it-4.10.0-enterprise-64-x86_64-pc-linux-gnu_installer.sh

The script will be promted to accept the license agreement, and upon acceptance install the distribution in /opt/cobol-it4-64 by default.

There are a number of options that can be used with the install. Run it with the --help option to discover what they are. A couple of the more useful ones are:

  • --target <dir>: Extract directly to a target directory (absolute or relative). This will require the user change to the cobol-it-setup.sh file located in the bin directory to specify this alternate location.
  • --accept : Accept the license
  • --list : list the files of the archive
  • --check : check integrity of archive

Run the cobol-it-setup.sh script to set all needed environment variables:
% source /opt/cobol-it4-64/bin/cobol-it-setup.sh (64-bit Linux/UNIX)
% source /opt/cobol-it4/bin/cobol-it-setup.sh (32-bit Linux/UNIX)

The license can be made available through a couple mechanisms. Perhaps the easiest is to copy the license file (provided it confroms to the standard naming convention ) to the installation directory (/opt/cobol-it4-64 in this example).
Another mechanism is to set the COBOLIT_LICENSE environment variable to the fully qualified name of the file.

You are now ready to use the compiler.

Installing the binary distributions for the RuntimeOnly (Linux/Unix)

Itentical to the process above, but the installer will be the runtime
'cobol-it-4.1:qualified0.0-enterprise-64-x86_64-pc-linux-gnu-runtimeonly_installer.sh'

cobol-it-setup.sh

       #setup the needed environement variables 
       DEFAULT_CITDIR=/opt/cobol-it4-64; export DEFAULT_CITDIR 
       # 
       # Copyright (C) 2008-2009 Cobol-IT 
       # 
       if [ "x${COBOLITDIR:=}" = "x" ] 
       then 
           if [ -f $DEFAULT_CITDIR/bin/cobol-it-setup.sh ] 
           then 
               COBOLITDIR=$DEFAULT_CITDIR 
           else 
               echo You must define COBOLITDIR to the root instalation dir of COBOL-IT 
           fi 
       fi 
       if [ "x${COBOLITDIR:=}" != "x" ] 
       then 
           PATH=$COBOLITDIR/bin:${PATH} 
           LD_LIBRARY_PATH="$COBOLITDIR/lib:${LD_LIBRARY_PATH:=}" 
           DYLD_LIBRARY_PATH="$COBOLITDIR/lib:${DYLD_LIBRARY_PATH:=}" 
           SHLIB_PATH="$COBOLITDIR/lib:${SHLIB_PATH:=}" 
           LIBPATH="$COBOLITDIR/lib:${LIBPATH:=}" 
           COB="COBOL-IT" 
           export COB COBOLITDIR LD_LIBRARY_PATH PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH 
           echo COBOL-IT Environment set to $COBOLITDIR 
           fi 
If installation is not in the default directory, the DEFAULT_CITDIR value should be edited.

Installing on Windows

COBOL-IT Supports the 32 and 64-bit Visual C 2015, 2017, 2019 and 2022 Compilers.

The COBOL-IT Windows 32-bit binary distributions are intended to be installed in C:\COBOL\COBOL-IT.
The COBOL-IT Windows 64-bit binary distributions are intended to be installed in C:\COBOL\COBOLIT64.

There is a separate msi installer file for each version of Visual C that is supported.
Download the version appropriate for your environment.
For example cobol-it-4.10-64-x64-vc2022-windows-enterprise-311224-setup.msi if you have the VC 2022 compiler from Microsoft.

Installation Steps

Launch the msi and proceed through the initial install screen by clicking Next.
Windows Installer 01

Accept the License Agreement to continue.
Windows Installer 02

Accept the default Destination Location or specify an different one. Then select Next.
Windows Installer 03

Select Install
Windows Installer 04

And select Finish
Windows Installer 05

The installation is now complete.
The Start Menu should contain a corresponding folder with a link for opening a developer command prompt.
Windows Installer 06
The link will cause the setenv_cobolit.bat file to be executed when you open your command shell. Setenv_cobolit.bat sets all the environment variables needed to begin using the COBOL-IT Compiler Suite.

You are now ready to use the compiler.

setenv_cobolit.bat for 64 bit VC 2022

@echo off

rem ----------------------------------------------------------------------------
rem Create a COBOL-IT development command prompt for VC2022 x64 builds
rem ----------------------------------------------------------------------------

if not defined COBOLITDIR set "COBOLITDIR=%~dp0" & echo Setting COBOLITDIR=%~dp0
set path=%COBOLITDIR%\BIN;%PATH%

rem ----------------------------------------------------------------------------

    set "CitVcYear=2022"
    set "CitVcVersion=17"
    set "CitVcPlatform=x64"
    set "CitVcHome="
    rem Add an SDK version here, like 10.0.17763.0 if desired
    set "CitVcSdkVer="

:useinstaller
    rem ----------------------------------------------------------------------------
    rem Use Visual Studio Installer vswhere tool to locate the installation
    rem ----------------------------------------------------------------------------

    if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" echo Visual Studio %CitVcYear% or later Installer is missing; using default location. & goto :fallback

    setlocal enableextensions enabledelayedexpansion
        for /f "usebackq tokens=*" %%p in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -products * -version %CitVcVersion% -property installationPath`) do if "!CitVcHome!"=="" set "CitVcHome=%%p"
    endlocal & set "CitVcHome=%CitVcHome%"
    if defined CitVcHome if exist "%CitVcHome%\VC\Auxiliary\Build\vcvarsall.bat" goto :setvars
    echo Visual Studio %CitVcYear% not found using Visual Studio Installer; falling back...

:fallback
    rem ----------------------------------------------------------------------------
    rem Fallback method: look in default locations
    rem ----------------------------------------------------------------------------

                               set "CitVcHome=%ProgramFiles(x86)%\Microsoft Visual Studio\%CitVcYear%\Enterprise"
    if not exist "%CitVcHome%" set "CitVcHome=%ProgramFiles(x86)%\Microsoft Visual Studio\%CitVcYear%\Professional"
    if not exist "%CitVcHome%" echo Cannot find Visual Studio %CitVcYear% using the fallback method. & call :error & exit /b 3

:setvars
    call "%CitVcHome%\VC\Auxiliary\Build\vcvarsall.bat" %CitVcPlatform% %CitVcSdkVer%
    if errorlevel 1 echo Cannot create a Visual C command prompt: is Visual Studio installed? & call :error & exit /b 4
    echo Settings:
    set CitVcHome
    set CitVcYear
    set CitVcVersion
    set CitVcPlatform
    goto :finish

:error
    set CitVcHome=
    set CitVcYear=
    set CitVcVersion=
    set CitVcPlatform=
    rem clean up the environment

:finish
    rem Leave environment variables set unless error
    exit /b 0

Installing a C compiler

If COBOL-IT cannot find the appropriate C compiler, it will alert you during the installation.

Microsoft® Visual Studio Community C compilers are available for free from the Microsoft website.

Supported versions are Visual Studio 2015, 2017, 2019 and 2022.

Installing a C runtime

The Microsoft Visual C++ Redistributable Package installs the runtime components of Visual C++ libraries required to run applications developed with Visual C++ on a computer that does not have the same version of Visual C++ installed. As an example, COBOL-IT applications that are developed using Microsoft Visual C++ 2019 require that the Microsoft Visual C++ 2019 Redistributable package be installed in order to run.

This package is available to the user if they have Microsoft Visual C++ installed on their computer.

If they do not, they must download the appropriate Microsoft Visual C++ Redistributable Package from the Microsoft website.

citlicense.xml

COBOL-IT has made changes to licensing to all products, effective with the the release of COBOL-IT Compiler Suite version 4.0 (and later). With the release of COBOL-IT Compiler Suite version 4.0, separate license files are supported for each product/platform pairing. As a consequence, users are no longer required to use the same license for multiple products, on multiple platforms; users deploying multiple products may use multiple license files.

License location

The default location for COBOL-IT product license files is the installation directory
%COBOLITDIR% (Windows)
$DEFAULT_CITDIR (Linux).
For COBOLIT Compiler Suite version 4, the default installation directory is
/opt/cobol-it4 (Unix 32 bit).
/opt/cobol-it4-64 (Unix 64 bit).

License naming convention

License files located in the default location named citlicense.xml, or with the prefix citlicense- and the .xml extension will be tested for validation by COBOL-IT products. For examples, COBOL-IT products would automatically test licenses named citlicense.xml, citlicense-001.xml, and citlicense-myproduct.xml.

Using COBOLIT_LICENSE to reference single or multiple license files

For cases where different naming conventions are used, or where license files are not stored in the default installation directory, the user should use the COBOLIT_LICENSE environment variable to indicate the full path(es) and name(s) of their license file(s).

When a Subscription to the COBOL-IT Compiler Suite is registered, the registered user receives download authorization to the COBOL-IT Compiler Suite Enterprise Edition, and a license file which is generated to match the duration of the registered subscription.

Note

COBOL-IT Compiler Suite Enterprise Edition Subscriptions and licenses are defined as lasting for a prescribed period of time, from the date of the generation of the Subscription and corresponding license. That is, a one-year Subscription is accompanied by a one-year license, and the expiration date is set at one-year after the generation of the license, -not- one year after the installation of the software.

The COBOL-IT Compiler Suite Enterprise Edition (cobc), native executables created by the COBOL-IT Compiler Suite Enterprise Edition, COBOL-IT Runtime Enterprise Edition (libcobit.so, libcobit_dll.dll), and CitSORT search for a license file in the following manner:

Check to see if the COBOLIT_LICENSE environment variable is set. COBOLIT_LICENSE, if set, describes the full path, and license name to be used by the COBOL-IT Compiler, Compiler-generated executables, and Runtime.

Example:
For Linux/Unix-based platforms:

>export COBOLIT_LICENSE=/opt/cobol-it/license/mycitlicense.xml

Note that when indicating multiple license files, the semicolon “ ; ” separator is used. In Linux, the list of license files is started and finished with single-quote marks “ “. The single-quote is located on the same key as the double-quote on most keyboards.

Example:

>export COBOLIT_LICENSE=’/opt/cobol-it4-64/compilerlic.xml;/opt/cobol-it4-64/citsqllic.xml’

For Windows-based platforms:

       >set COBOLIT_LICENSE=C:\COBOL\COBOLIT\license\mycitlicense.xml
       >set COBOLIT_LICENSE=C:\COBOL\COBOLIT\mylic.xml;C:\COBOL\COBOLIT\mysqllic.xml

If neither the COBOLIT_LICENSE or COBOLITDIR environment variables are set, check for a file called citlicense.xml or citlicense-xxx.xml (where xxx is any string of characters) located in the default installation directory.

On Linux/Unix platforms, the default installation directory is /opt/cobol-it4 for 32-bit product, and /opt/cobol-it4-64 for 64-bit product.

On Windows platforms, the default installation directory is C:\COBOL\COBOLIT for 32-bit product, and C:\COBOL\COBOLIT64 for 64-bit product.

For information about your Enterprise Edition license, type cobc –V

Information about the Location, Name, Owner, and Expiration Date of the license are shown below:

% cobc -V
cobc (COBOL-IT) Enterprise
Version 4.2.2 (64 bits)
Build date Nov  3 2022 21:48:04

COBOL-IT License (v2): /opt/cobol-it4-64/citlicense_mylicense.xml
----------------------
Owner    :  Micro Focus
            The Lawn, 22-30 Old Bath Rd
            RG141QN Newbury, Berkshire
            UK

Type     :  Demo
Systems : LINUX
Products : COMPILER RUNTIME
Expire   :  2026-XX-XX (runtime never stop)

Thread safe programs and runtime
Copyright (C) 2001-2008 Keisuke Nishida / Roger While for OPEN-COBOL parts
Copyright (C) 2008-2022 COBOL-IT

COBOLITDIR=/opt/cobol-it4-64
COB_CC=gcc -pipe
Temporary dir=/tmp

When a license expires, or is not found

If the COBOL-IT Compiler Suite Enterprise Edition (cobc), native executable created by the COBOL-IT Compiler Suite Enterprise Edition, COBOL-IT Runtime Enterprise Edition (cobcrun), or CitSORT fails to locate a valid license, they will exit, returning a message to the user as follows:

```txt # cobc -V Invalid enterprise license file format:

   Enterprise license is not validated.
   Please verify the environment variable COBOLIT_LICENSE value, contact your local dealer or sales@cobol-it.com
Back to top