Auto-pilot includes compile.sh, 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 compile.sh. 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, compile.sh
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 compile.sh
fails, and you should correct the problem. If you set PKGFILE
before compile.sh begins, then no automatic search is performed.
After determining PKGFILE, compile.sh 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
compile.sh 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:
I=0 CMDLIST[$((I++))]=./configure CMDLIST[$((I++))]=make
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".