Compilation

There are four different ways to compile:


Recompilation

The first variant (recompilation) is the most convenient and fastest way to compile and will be used in nearly all cases. Visual Eiffel will decide which classes must be recompiled to get the new program version as fast as possible. The first compilation of a new project will always be a complete compilation (as there is nothing as a base of recompilation). When the compilation is started, a compiler window appears like the picture on the left. It lists the tasks done during the compilation - loading of libraries, parsing of classes, loading and unfolding of class interfacing, checking and generation of classes (in this case generating the native code) and finally linking and assembling. The message Success indicates that the compilation was successful.

recompilation

You will probably make some changes and press the compile"Build" button (also called build) button again. In the free educational version the same complete compilation will be performed again. In the (not free) personal or professional version the compiler will optimize the recompilation. This will result in less classes loaded and unfolded. Also the number of classes for which code was generated is smaller (in our example the total number of project classes is only one, so that this does not count).

Now let's introduce a bug: The compiler window will show the place where the error was found and will also indicate which type of error was found:

error message

It is sufficient to double-click the line with the error message. The editor window with the erroneous class will appear and the cursor will be placed at the indicated place - hopefully very close to the place where the bug really is. In this example the do was not accepted at this place. Fix the bug and press the build button again.

Complete Recompilation

In some special situations a complete recompilation can be useful. As you know, the Visual Eiffel compiler tries to find out what effect the changes you made has on the rest of your project. So, usually only the classes affected by your modifications are recompiled.

But this dependency analysis may fail in some complex situations. The compiler recognizes this danger in some situations and starts a complete recompilation.

In other situations this failure may result in linker errors. So, if you have unexplainable linker errors, just start a full recompilation. This can be done with the menu item Project/Rebuild All.


Finalization

Finalization is a special compilation mode which optimizes the execution speed - and also the size of the generated executable. In order to switch on finalization, activate the finalization option.

Eiffel provides many opportunities for optimization - for example it is possible to remove most dynamic feature calls. Finalization allows the removal of dead code, and makes it possible to generate inline code instead of procedure calls in certain situations.

These optimizations require that all involved Eiffel code is optimized - not only the classes belonging directly to the current project. In "ordinary" compilations the libraries are just linked in. As these libraries were compiled for all possible projects, project-specific optimizations cannot be done.

Finalization compiles ALL classes from scratch and optimizes as much as possible. You can specify everything either by setting the corresponding options in the workbench or in the .esd file.


Copyright © Object Tools -- info@object-tools.com
Last updated: $Date: 2005/02/02 11:51:33 $