Motif(s) for Linux
One of the most frequently asked questions in the Usenet Linux newsgroups is “Motif for Linux?”. Why? To answer that, I should first explain a little about what Motif is and why it is in such demand in the Linux community.
Motif is a set of programming libraries and header files, copyrighted by the Open Software Foundation (OSF), which allow programmers to create X programs using the Motif “look and feel”. Similar to the Athena toolkit (libXaw), the Motif toolkit (libXm) is also based on the Xt toolkit (the X “Intrinsics”), but the Motif toolkit has a distinct 3-D look to it which makes it much more pleasant-looking. Motif also includes a window manager called Mwm which, as of version 2.0, allows virtual desktops, a feature that users of earlier versions of Motif have wanted for a long time. Many people think of Motif and Mwm as the same thing, but Mwm is really just a small part of Motif. Motif is accepted as the standard X toolkit by major Unix vendors like IBM and HP, so it seems natural that Linux users want to use Motif on Linux platforms as well.
Even if you don't ever intend to develop Motif applications, having Motif on your system will be useful. Having access to the Motif shared libraries, which are included with Linux Motif distributions, will allow you to compile many freely-available Motif applications with shared Motif library support, resulting in much smaller binaries which take up significantly less memory than statically-linked binaries which you can retrieve from the Internet or copy from CD-ROMs.
This is another frequently asked question by Linux users. Two of the more popular Motif for Linux distributions, GUI Corporation's SWiM Motif 2.0 and Metro Link Inc.'s Motif 2.0, are reviewed here.
Motif 2.0 for Linux from Metro Link consists of five 3.5" disks, a quick installation guide, and the OSF Motif 2.0 User's Guide booklet. The user needs to have the XFree86 3.1.1 libraries already installed and a minimum of 8 MB RAM for things to work. Included on the disks are the Motif man pages, source to the OSF/Motif demos, precompiled binaries, Mwm, shared and static libraries, header files, the Uil compiler, Mrm, some extra utilities such as a pixmap editor, an xbm browser utility, and a huge set of colored pixmaps. Metro Link also includes the Xpm pixmap library, which OSF requires for building Motif 2.0 apps.
The installation is completely trivial as long as you follow the quick installation guide. Simply extract the files from the disks, untar them, and you're ready to play. The product takes up anywhere from 20 to 30 MB of disk space, depending on whether you wish to install the sources to the man pages. I chose not to, since the preformatted cat pages were also provided, and it saved some disk space.
Having everything installead, I proceeded to compile Mosaic, xmcd, and a bunch of other free Motif apps available on the net. Everything went smoothly, xmkmf working flawlessly with Metro Link's new Imake.rules, Motif.rules, and Motif.tmpl files. Not one problem. I also decided to build the included OSF/Motif demos, and that also worked out painlessly. I was a very happy camper. I actually expected something to go wrong, but that never happened. Mwm, the window manager, also ran smoothly, although on an 8 MB machine that might not be true. Compiling Motif apps on an 8 MB machine will also probably be very slow, but on my 16 MB machine (the recommended RAM amount) everything worked great. Metro Link offers free technical support for Motif 2.0 by phone, fax, and e-mail, but I can't tell you how good the support is because I never had to use it. I never ran into any problems with their product.
Next up is GUI Corporation's SWiM Motif 2.0. The main distributors are ACC Corp. (U.S.) and Lasermoon Ltd (Europe). SWiM Motif 2.0 ships on CD. Also included are the OSF Motif 2.0 User's Guide booklet and an installation guide. Similar to Metro Link's distribution, SWiM also includes Mwm, shared and static libraries, header files, Uil compiler, Mrm, man pages, and source to the OSF/Motif demos. In addition, the SWiM CD includes the source to all OSF Motif 2.0 documentation, including the Motif 2.0 Programmer's Manual, X11R5 and ELF shared libraries (as well as X11R6 ones), the complete XFree86 3.1.1 distribution, live file systems for XFree86 3.1.1 and SWiM Motif 2.0, and an archive of over 300 MB of Motif programs gathered from different places. The distribution takes about the same disk space as Metro Link's, and the memory requirements are the same.
After mounting the CD, I proceeded to install SWiM. The installation guide that I had was geared towards a floppy disk installation, based on SWiM's previous release which was not on CD. The README in the top CD directory did not really give any installation instructions, but after navigating around the subdirectories, I managed to find the directory with the main distribution. Along the way I came across directories which had X11R5 and ELF libs, so I assumed that the default installation was using X11R6 (XFree 3.1.1) libs. I was right. I then ran the Install script and everything went well until the script bombed because it was trying to untar something to the current directory, which was read-only since it was on the CD. As the last step of the installation, SWiM is supposed to untar a file (mwm_make.tar) and then compile mwm from the contents of that file using the shared Motif libraries that it had installed earlier. Since I was on a read-only file system it naturally failed. I looked at the Install script and proceeded to untar the mwm_make.tar file in /tmp and build mwm there. This worked out and then I was done with the installation.
I then started X and Mwm and proceeded to compile some programs. Everything worked perfectly and smoothly. SWiM comes with a mxmkmf program (and mx5mkmf for X11R5 users) which replaces xmkmf when compiling Motif programs using Imake files. For use with mxmkmf, SWiM also installs new Imake.tmpl, Motif.tmpl, and Motif.rules files in /usr/lib/X11/config, which are, by default, for use with X11R6-based distributions. X11R5 replacements are also installed in a seperate subdirectory. Instead of running xmkmf, I ran mxmkmf to compile the demos. Things worked according to plan.
I did run into some problems later when trying to use the uil compiler to produce some uid files required by some of the demo programs. It seems that SWiM installed an X11R5-based uil binary during the installation process, even though the distribution was set up for an X11R6 based system. Since I couldn't find an X11R6-based uil binary, I had to fetch some X11R5 shared libraries in order to run the uil compiler—not too big a deal, but I would have preferred to have an X11R6 binary. Other than that, and some of the installation problems, SWiM worked fine. Free technical support is also available in Europe for SWiM from Lasermoon Ltd.
One major difference between SWiM and Metro Link Motif 2.0 is that while Metro Link's shared Xm library requires linking with the Xpm library, SWiM's doesn't, since the Xpm library is compiled into SWiM's Xm library. I mention this difference because shared binaries compiled with SWiM won't work on a Metro Link system and vice versa, due to the differences between the shared Xm libraries.
At the time of writing this article, the Linux community is moving towards ELF shared library support from the current a.out format. The SWiM CD includes ELF shared libraries, but the Metro Link distribution does not; since ELF libraries are still under development and changing very rapidly, Metro Link has decided to wait until ELF is stabilized and in wider use before releasing ELF libraries with their Motif 2.0 package. By the the time you read this article, this change will probably have already taken place.
[InfoMagic just released Moo-Tiff and it will be reviewed in a future issue of Linux Journal—ED]
Free DevOps eBooks, Videos, and more!
Regardless of where you are in your DevOps process, Linux Journal can help!
We offer here the DEFINITIVE DevOps for Dummies, a mobile Application Development Primer, and advice & help from the expert sources like:
- Linux Journal
- New Products
- Users, Permissions and Multitenant Sites
- Flexible Access Control with Squid Proxy
- High-Availability Storage with HA-LVM
- Security in Three Ds: Detect, Decide and Deny
- Tighten Up SSH
- DevOps: Everything You Need to Know
- Non-Linux FOSS: MenuMeters
- Solving ODEs on Linux
- Android Candy: Bluetooth Auto Connect