Installing Cobra Command Tool in Ubuntu 11.10
Is it possible to install and run a more than 20 year old program in the latest version of Ubuntu (11.10 64bits). Let's find out. We will install the smart terminal program Cobra Command Tool which I develop more than 20 years ago. The program can be downloaded from my company web page: www.zoocad.com.
Click the Zoo Design button and then the Download button.
Right-click cobra_10.0ub.tar.gz and select Save Link as.
Use this command to unzip and unpack the downloaded file.
-->tar zxvf cobra_10.0ub.tar.gz
Here is the result.
Copy all the files to the installation directory and edit the startup script (cobra) to match this directory.
Move the startup script (cobra) to the bin directory and start Cobra using the command:
--> cobra &
Absolutly nothing happens, the Cobra.exe file is not found. The explanation is this. Cobra is compiled for a 32 bit Linux operating system and we try to run it in a 64 bit Linux system.
How to make 32-bit applications work on a 64-bit operating system
Here is a Ubuntu help page describing how we can solve the problem.
Installing 32-bit shared libaries.
We start the Ubuntu Software Center and find the is32-libs and install them.
Installing in Ubuntu 13.10
In Ubuntu 13.10 and newer versions the ia32-libs are not available any longer. Use this command to load the 32 bit libraries we need:
sudo apt-get install libgtk2.0-0:i386
Let's try again.
--> cobra &
We are missing the library libxview.so.3. The Cobra program was written for the SUN OS 4 using the xview toolkit. This toolkit is obsolete but it has been converted to the Linux OS and can be downloaded from here. We will download the 32 bit version of the libraries.
Installing the xviewg libraries
We unpack the downloaded package using the following command:
sudo dpkg -x xviewg_3.2p1.4-28_i386.deb tmp
We copy all the files in the lib directory to the cobra install directory. When we start Cobra the next time the program will find the xview library files using the LD_LIBRARY_PATH variable.
Installing the xviewg libraries in Ubuntu 13.10
In Ubuntu 13.10 the xviewg libraries can be installed directly using this command:
sudo dpkg -i xviewg_3.2p1.4-28_i386.deb
Installing font files
The Cobra program uses old xfonts with fixed sizes. xfonts-100dpi provides a set of bitmapped fonts at 100 dots per inch. In most cases it is desirable to have the X font server (xfs) and/or an X server installed to make the fonts available to X clients.
We install the fonts using the following commands:
sudo apt-get install xfonts-100dpi
sudo apt-get install xfonts-75dpi
sudo apt-get install xfonts-utils
To start the font server using the new fonts we have to reboot our system.
We are ready to start Cobra.
--> cobra &
This doesn't look so good. We need to fix the font sizes for the buttons and the console.
In the X Window System, the X resources are parameters of computer programs such as the name of the font used in the buttons,the background color of menus, etc. They are used in conjunction with or as an alternative to command line parameters and configuration files.
We add the following .Xresources file in our home directory:
We can use the command: xrdb .Xresources to enable the new settings. The next time we boot our system this command will be executed automatically during start up.
Now let's start Cobra again.
--> cobra &
This time everything looks just perfect. We have demonstrated that we can take a 20 year old program and run it in the latest Linux environment. This shows the power of unix and the X-windows system.
Now when we have Cobra Command Tool running we can learn more about all the features of the program by reading the User's guide.