Cobol on Linux OpenSUSE Leap

Installation of Cobol on OpenSUSE Leap

Cobol on LinuxI recently decided to install Cobol on my OpenSUSE Leap 42.3 Linux system.

Cobol is one of the oldest high-level languages, but is still used and regularly updated with the latest software engineering developments such as Object Oriented Programming. It is the language that powers up many important business application around the world.

The development of a Cobol compiler on Linux started in 2001 with a project by Keisuke Nishida and Roger While called OpenCobol,.  OpenCOBOL 1.1  that was accepted and dubbed a GNU package by Dr. Richard Stallman and became GnuCobol 1.1 in 2013 (the Official releases can be found at

A programmer’s guide, by Gary Cutler, and other documentation, can be found at

Notice that there are other Cobol compilers on Linux and one of the best know is the Micro Focus Cobol, but the GNU Cobol is the only free product. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the FSF (Free Software Foundation).

GnuCobol implements a substantial part of the COBOL 85, COBOL 2002, and COBOL 2014 standards, as well as many extensions of the existent COBOL compilers such as MicroFocus, IBM, MVS, ACUCOBOL-GT, RM/COBOL, BS2000..

GnuCobol  translates COBOL into C and compiles the translated code using the configured C compiler, usually gcc. You can build your COBOL programs on various platforms, including Unix/Linux, Mac OS X, Microsoft Windows, OS/400, z/OS 390 mainframes, among others.

Moreover GnuCobol provides EXEC SQL preprocessors for PostgreSQL, Firebird, ODBC, DB2.
GnuCOBOL 1.1, the current official release version has been built on

  • MS Windows native
  • MS Windows with Cygwin
  • GNU/Linux
  • POSIX Systems including OpenSolaris
  • OS/X
  • AS/400
  • HP Integrity HPUX 11.23
  • RS600 AIX 5
  • 390 Mainframe z/OS OMVS/USS
  • others, Raspberry Pi (quote was $35 for hardware, OS and GnuCOBOL)

There are also a few IDEs meant to support the development of programs written in GnuCobol and among them I found OpenCobolIDE written in Python and the Cobol Development Environment plugin for Eclise.

I tried to install all of them and you will find below a description of their installation.

Installation of GnuCobol  2.2.0

GnuCobolOpenSUSE does not provide gnucobol among its standard installation packages, but provides a link. for a quick installation of gnucobol by using yast2.

It displays a page where you must choose the version of OpenSUSE Leap or Tumbleweed that you are using, it warns you that the packages may be unstable (i.e. with experimental software) and then  offers you 1-click Install options.

If you continue it will show you the additional repositories to be used and they will ask you to accept the installation of the library libcob4 and of gnucobol.

At the end I could find in the /usr/bin library  the commands cobc, cob-config and .cobcrun. I could find also the new directories /usr/lib64/gnucobol and /usr/share/gnucobol

I tried to compile a small hello.cob source file, but I got the following runtime error:

/usr/include/libcob.h:25:17: fatal error: gmp.h: No such file or directory

I checked the usr/include library and actually the libcob.h file was missing.
Since the documentation says that this file is linked to gmp, I decided to install also the gmp package and the libcob-devel package that had not been installed before.

Finally I was able to compile and execute successfully my test cobol program:

linux-wgqh:/home/Mario1/Documents/Cobol/gnucobol # ls
hello hello.cob
linux-wgqh:/home/Mario1/Documents/Cobol/gnucobol # ./hello
Hello, world

Installation of the OpenCobolIDE-4.7.6

OpenCobolIDE  is a simple and lightweight COBOL IDE for the GnuCOBOL compiler.
The software is written in Python using PyQt5 (or PyQt4) and pyQode.

I decided to install this as well and I did it with the following command:

linux-wgqh:/usr/local/resources/mydata/myRPMs # pip3 install OpenCobolIDE –upgrade
Collecting OpenCobolIDE
Downloading OpenCobolIDE-4.7.6.tar.gz (12.9MB)
100% |????????????????????????????????| 12.9MB 20kB/s
Installing collected packages: OpenCobolIDE
Running install for OpenCobolIDE
Successfully installed OpenCobolIDE-4.7.6

The installation completed successfully, but ,when I tried to run it, I got a long list of errors as follows:

linux-wgqh:/home/Mario1 # opencobolide
Traceback (most recent call last):
File “/usr/lib/python3.4/site-packages/open_cobol_ide/extlibs/pyqode/qt/”, line 109, in autodetect
import PyQt5
ImportError: No module named ‘PyQt5’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/lib/python3.4/site-packages/open_cobol_ide/extlibs/pyqode/qt/”, line 116, in autodetect
import PyQt4
ImportError: No module named ‘PyQt4’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/lib/python3.4/site-packages/open_cobol_ide/extlibs/pyqode/qt/”, line 122, in autodetect
import PySide
ImportError: No module named ‘PySide’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/bin/opencobolide”, line 9, in <module>
load_entry_point(‘OpenCobolIDE==4.7.6’, ‘gui_scripts’, ‘opencobolide’)()
File “/usr/lib/python3.4/site-packages/open_cobol_ide/”, line 29, in main
from pyqode.qt import QtGui
File “/usr/lib/python3.4/site-packages/open_cobol_ide/extlibs/pyqode/qt/”, line 156, in <module>
File “/usr/lib/python3.4/site-packages/open_cobol_ide/extlibs/pyqode/qt/”, line 126, in autodetect
raise PythonQtError(‘No Qt bindings could be found’)
pyqode.qt.PythonQtError: No Qt bindings could be found

There was obviously something missing and I tried to add to my OpnenSUSE installation also the python3-qt5 package  that I had not installed before, but that I saw mentioned in the article “3 open source projects for modern Cobol development”.

I then re-installed OpenSourceIDE with the command pip3 install OpenCobolIDE –upgrade.

This time the IDE seemed to work correctly, even if it produced the message:

Failed to find a working GNU Compiler

I noticed that there was a Preferences option in the IDE and I requested to use the defaults,
The error disappeared after my successful re-installation of gnucobol and now the IDE is fully working.

Installation of the Cobol Development Environment Plugin for Eclipse

I decided to check also this Cobol IDE for Eclipse.

First I installed eclipse by following the approach suggested in the article  Install Eclipse IDE on OpenSuse Leap 42

The installation took a while to complete, but worked perfectly without any special problem.

I found the Cobol Development Environment Plugin in the Eclipse Marketplace that can be found as an option in the Help menu of Eclipse.  I chose the Cobol Development Environment  0.1.4 solution and tied the Install button.
The installation started, but it soon stopped with the message:

No repository found at

It looks like the installation of this this product has not been updated for a while and the marketplace installation currently is not up to date.

It is something that I’m going to investigate in the future.

A Video on Using Cobol on Linux


Introduction to GNU Cobol (formerly OpenCobol)

Gnu Cobol (Formerly OpenCobol) by Sourceforge
OpenCobolIDE Documentation
GNU Cobol Manual
3 Open Source Projects for Modern Cobol Development

Be Sociable, Share!