How to use YACL with EMX C++ for OS/2

Last update: June 20th, 1997

This file provides directions on how to build YACL and its demo programs using EMX C++ for OS/2.

Requirements: EMX C++ version 2.6.1 or later, and a decent make program. I recomment GNU make version 3.72.1. The emx makefiles included with YACL are designed for GNU make version 3.72 or better. I have heard that they will not work with earlier versions of GNU make. You can get the latest version of GNU make from ftp-os2.nmsu.edu by anonymous ftp.

Caveat: YACL will not build properly with the 2.7.0 and 2.7.1 versions of EMX: a bug in the GNU C++ compiler causes an internal compiler error while compiling YACL. However, YACL works fine with version 2.6.3 and with version 2.7.2.

Building YACL

Here are the steps:

Using gdb with YACL:

You can use gdb with programs that use YACL. To do this, you must build the YACL libraries using the makefiles named emxdebug.mak instead of emxos2.mak. Specifically, use the command line

This will create library files base.a, io.a and ui.a instead of the corresponding .lib versions. If you then use emxdebug.mak in any of the UI demo directories, you'll get an executable that can be debugged with emx gdb. Bear in mind, however, that the resulting executables are significantly larger than the ones built using the emxos2.mak makefiles.

Known problems

YACL will not compile under version 2.7.0 of EMX. The compiler crashes with an internal compiler error. Version 2.6.3 works fine, however, as does version 2.7.2.

Under OS/2, this compiler produces very compact executables; the UI demos are in the range of 300K. The only compiler that does better is Watcom.

There seems to be a connection (at least on my machine) between the speed of the EMX compiler and the IBM Internet Access Kit package that came with the BonusPak (don't ask me why). If I have the SLIP drivers from the IAK package loaded, EMX slows to a crawl: I clocked it taking six hours to compile all the ui classes on my 486/66 with 28 MB main memory. But if I don't have the IAK loaded, the speed is acceptable; it takes about 30 seconds (on average) per file. Of course, your mileage may vary.

Also, if your machine has 8MB or less of RAM, then EMX takes inordinate amounts of time to compile YACL -- as much as a whole day. This is mainly because GNU C++ is a memory hog when compiling templates, and YACL uses lots of templates. The result is that EMX thrashes badly on low-memory machines. But if you have at least 16MB, then EMX's speed is acceptable, with the whole compilation taking about 2 hours.

It seems that GNU C++ (and consequently the EMX compiler) do not actually inline functions that have been declared inline unless you specify the optimization switch (-O). But if you do specify the switch, the compile will go much slower. Bear this in mind when you choose to uncomment the OPTIMIZE symbol definition in the file control/emxos2.ctl.