next up previous contents index
Next: The labrun Tool Up: Compilation and Execution Previous: Compilation and Execution   Contents   Index


The labmex Tool

The Tool Set for Computational Experiments contains a program labmex that facilitates the compilation and execution of a program. In general, the syntax is as follows:

labmex [<options>] <executable> [<arguments>]


<executable> refers to the program being compiled and executed. <arguments> specify the arguments given to <executable> (if any). <options> may be used to give different options to make. By default, labmex uses the command make to build the specified target <executable> and then, after successful compilation, executes it. If the compilation step fails, labmex will produce a compilation log file <executable>-<date>-<time>.clog. Type labmex --help for more help.

$\Rightarrow$ Tutorial 2:
Use labmex to compile and execute sort-demo. Find out which arguments sort-demo requires and perform a sorting experiment on 5000 numbers and 10 random sequences.
Solution:

cd sorting
labmex ./sort-demo
... find out proper usage ...
labmex ./sort-demo 5000 10

The solution to this and many other of the tutorial tasks can be shown with the program create-tutorial in the tutorial's directory. Running this program creates several tut<tutorial-nr> files.

$\Rightarrow$ Tutorial 3:
Next, play around with different options: (1) Force a make clean before the compilation of sort-demo. (2) Force the .clog file to be created even if compilation is successful. (3) Use a different compiler, e.g., gcc, by redefining the CC variable and set the makefile variable LFLAGS to the optimization level -O3. (4) Combine (1)-(3) by writing an option file and call labmex on this option file.

Solution:

(1) labmex -c before ./sort-demo 5000 10
(2) labmex -k ./sort-demo 5000 10
(3) labmex -m CC=gcc -m LFLAGS=-O3 ./sort-demo 5000 10
(4) Put all options into a file, say labmex.opt1, and call
         labmex @ labmex.opt1 ./sort-demo 5000 10


next up previous contents index
Next: The labrun Tool Up: Compilation and Execution Previous: Compilation and Execution   Contents   Index
Tobias Polzin 2002-11-18