| |Intro | Install | Using | Monitor | Tuning | Advanced | Platform Notes | Teambuilder |
[Prev: Installation] [Home] [Next: Teambuilder Monitor]
Teambuilder Compiler is used in place of the normal compiler. This is achieved by placing the Teambuilder bin directory before the normal compiler's path in the $PATH environment variable. Assuming Teambuilder is installed in /opt/teambuilder the following commands will ensure Teambuilder is used:
For csh users: setenv PATH /opt/teambuilder/bin:$PATH
For sh users: export PATH=/opt/teambuilder/bin:$PATH
You should now be able to type make to begin compilation and Teambuilder will be used to compile your files. You can verify that Teambuilder is being used using the Teambuilder Monitor application.
If Teambuilder is not being used check that your makefiles do not specify the full path of your compiler.
To use Teambuilder to its full potential run make with the -j parameter to specify the number of concurrent compilations to run. You may want to call the following script "make" and place it in your path before the system make:
#!/bin/sh
if [ "$TEAMBUILDER" = 0 ]
then
/usr/bin/make "$@"
else
export PATH=/opt/teambuilder/bin:$PATH
/usr/bin/make -j20 "$@"
fi
You can adjust the -j parameter to suit your Teambuilder farm. Setting -j a little higher than the total number of concurrent compilations your farm supports will help keep the machines saturated. Teambuilder will not allow more jobs than MaxJobs to be run concurrently on any machine.
You can query the scheduler for how many jobs it can process concurrently by running tbcompiler -joblimit. This will print 1 if the compiler cannot connect to a scheduler.
If you ever want to compile locally (e.g. if you are disconnected from the network) set the TEAMBUILDER environment variable to 0:
For csh users: setenv TEAMBUILDER 0
For sh users: export TEAMBUILDER=0
Make sure you adjust the number of concurrent compilations accordingly. The "make" script above takes $TEAMBUILDER into account automatically.
To see debug output from the Teambuilder Compiler set the TEAMBUILDER_DEBUG environment variable to 1:
For csh users: setenv TEAMBUILDER_DEBUG 1
For sh users: export TEAMBUILDER_DEBUG=1
This writes the Teambuilder progress to stderr. To send the Teambuilder debugging output to a file instead set the TEAMBUILDER_LOG environment variable to the file to use:
For csh users: setenv TEAMBUILDER_LOG $HOME/.myfarm.log
For sh users: export TEAMBUILDER_DEBUG=$HOME/.myfarm.log
To compress network traffic before sending it to a compilation daemon set the TEAMBUILDER_COMPRESS environment variable to a value between 1 (fastest compression) and 9 (best compression). This is set to 0 (no compression) by default:
For csh users: setenv TEAMBUILDER_COMPRESS 1
For sh users: export TEAMBUILDER_COMPRESS=1
In almost all cases you should leave this value set to 0 (no compression) since this provides the best performance on fast networks. If you have a very slow network you may want to experiment with other values.
Teambuilder will choose a daemon that has a compiler with the same name as your compiler. For example if you are using a cross-compiler named arm-linux-g++ only machines with this compiler will be assigned your jobs.
Commands are rerouted via tbcompiler by making a link to tbcompiler, named identically to your command, and placing this link earlier in you PATH than the actual command. The default command links can be seen in /opt/teambuilder/bin. Usually these commands are compiler names, but it is possible to schedule, though not distribute, other commands (see Scheduling Local Jobs).
tbcompiler determines whether the command being run is a compiler by comparing the command name to a list of known compiler names. In most cases your compiler will be matched by one of the defaults, but if necessary you can specify additional compiler names to match using the TEAMBUILDER_CC_NAMES environment variable. For example, if you have a compiler named ccxp and CCxp you can add support for those compilers by making links for the command and specifying that those commands are compilers:
# cd $HOME/bin # ln -s /opt/teambuilder/bin/tbcompiler ccxp # ln -s /opt/teambuilder/bin/tbcompiler CCxp
for csh users: setenv TEAMBUILDER_CC_NAMES ccxp,CCxp
for sh users: export TEAMBUILDER_CC_NAMES=ccxp,CCxp
Teambuilder is tested with a limited number of compilers so there is no guarantee that your compiler will work with Teambuilder.
You will also need to add support for this compiler to tbdaemon.
The default compiler names accepted are:
*g++,*c++,*egcs++,*egcs,*CC,*xlC,*icpc,*icc,*cc,*insure
If your farm includes several versions of compilers which are incompatible you can specify the version you want to use with the TEAMBUILDER_CC_VERSION environment variable. For example, if your farm includes gcc 2.95.2, gcc 2.95.4 and gcc 2.96.0 you can specify that you want to use the 2.95.x versions:
For csh users: setenv TEAMBUILDER_CC_VERSION 2.95.*
For sh users: export TEAMBUILDER_CC_VERSION=2.95.*
The following wildcards are allowed:
? matches any character
* matches any sequence of characters
[] matches a defined set of characters
Some compilers output more than just the version number when they are queried for their version, so this must be accounted for in the version expression.
Teambuilder must always connect to the same scheduler that the daemon on your machine is using. You can avoid the broadcast traffic and increase the speed of the compiler slightly by specifying the scheduler explicitly:
For csh users: setenv TEAMBUILDER_SCHEDULER scheduler
For sh users: export TEAMBUILDER_SCHEDULER=scheduler
The software build process usually runs other programs besides the compiler. When combined with make generating concurrent jobs you can have a large number of processes competing for resources. In order to keep the machine load within limits it is possible to schedule any program by creating a link to tbcompiler with the program's name. For example, if the strip command is run often in your build process and you have identified it as a source of excessive resource usage you could schedule it by doing the following.
# cd $HOME/bin # ln -s /opt/teambuilder/bin/tbcompiler strip
This will make strip also obey the job limit you have placed on your machine.
[Prev: Installation] [Home] [Next: Teambuilder Monitor]
| Copyright © 2001-2005 Trolltech | Trademarks | Teambuilder version 1.3
|