Next: , Previous: Postmark, Up: Scripts

4.3 Compile Benchmarks

Auto-pilot includes, which can be used to benchmark the unpacking, compilation, and removal of several packages. We have tested it with GCC, OpenSSL, and Am-Utils. No command line arguments are passed to It is controlled entirely with environment variables. The two most important variables to set are DATADIR and BENCH. DATADIR is the directory where you have stored the package to compile, and BENCH is which program to compile. If BENCH is gcc, openssl, or amutils, then the PACKAGE variable is automatically set, otherwise PACKAGE must be defined. PACKAGE is the prefix of the source package (e.g., gcc). Using these two variables, searches for all files that match $DATADIR/$PACKAGE*. If only one file matches, then it is automatically selected as the package file and stored in the environment variable PKGFILE. If no file is found or multiple files are found, then fails, and you should correct the problem. If you set PKGFILE before begins, then no automatic search is performed.

After determining PKGFILE, unpacks it using tar and changes the present working directory to the one extracted by tar. This assumes that the package is well behaved, and creates only one top-level directory. If this assumption is violated, an error message is printed.

If you set BENCH to one of the predefined benchmarks, then already contains the commands to compile the script. If you are compiling your own package, then you should either create a compilecommand hook or set the COMPILECMD variable to the command you want executed. If you need to perform multiple commands, and want them timed separately, then you need to use a compilecommand hook. The hook takes two arguments. The first is PACKAGE and the second is PKGFILE. If the hook returns success, then it must set the environment variable CMDLIST to an array containing each command to execute. For example, to compile GCC the following statements are used:


If neither the COMPILECMD variable or the compilecommand hook are defined, the compilation fails.

After compilation, the package is removed.

By default, all three phases are executed (unpacking, compilation, and deletion). To disable a phase set UNPACK, COMPILE, or DELETE to "0".