Introduction
The L1Calo scripts package (l1calo/scripts )
includes the following utilities each of which is described
in more detail below.
- buildpkg:
builds a package (make, make install)
- ifdep.sh:
executes a command if the current package is dependent on another named package
- getpkg:
checks out the head, latest or specific version of a package
- getallpkg:
checks out the head or latest version of all our packages
- updallpkg:
does a
cvs update -d for all checked out packages
- importpkg.pl:
does a
cvs import of a new package
- remoldver.pl:
removes old versions of packages
- makerel.pl (and related scripts):
builds a complete release of our software:
either for the nightly build or specific versions
- latest:
returns the latest tagged version of a package
- pkginfo.pl:
returns a list of all our packages and information about them
- cdpkg:
little utility for navigating package directories
- doxpkg.pl:
runs Doxygen (or Javadoc) on a specified package
- doxallpkg.pl:
runs Doxygen (or Javadoc) on all our packags
- downloadcmt.pl:
downloads and installs versions of CMT
- setupcmt.sh:
script to setup the L1Calo software
- edconf:
wrapper for
oks_data_editor useful for editing
configuration database files in the dbFiles
package area.
CMT related utilities
Some of these are copied/adapted from the datacollection group.
The buildpkg script builds a package via CMT
using make then make install .
The script can be run from anywhere in the package directory
tree (ie you dont have to cd to your cmt directory).
Usage:
buildpkg
-- builds the package, with all messages to the terminal.
buildpkg QUIET=1
-- builds the package, with CMT operating in quiet mode.
This suppresses echoing of often very long g++ commands
and makes it easier to see warnings.
buildpkg -l logdir
buildpkg -L
-- builds the package, with messages from make
sent to logdir/package.make and messages from
make install sent to logdir/package.install .
The -L option is a shorthand with logdir
set to $L1CALO_ROOT/logfiles/$CMTCONFIG .
cmt broadcast buildpkg -l logdir
-- builds the current package and all those it depends on
with messages saved as above for each package.
buildpkg -K
-- continues with make install even if make
failed with errors.
NB you can set the environment variable BUILDPKG_ARGS
(eg in your login scripts) to provide default arguments. Eg
export BUILDPKG_ARGS=QUIET=1
-- so buildpkg will always use QUIET=1 by default.
NB the -l , -L , -K options
must come first. Any other options are passed to make .
The ifdep.sh script executes a command if the current
package is dependent on another named package. This can be useful
in a cmt broadcast where you may want to rebuild just
a few packages that depend on another package which has been updated.
Usage:
ifdep.sh changedPkg command
-- executes command if the current package depends on
changedPkg
cmt broadcast ifdep.sh changedPkg buildpkg -L
-- broadcasts a buildpkg to all packages
(used by the current package) that depend on changedPkg.
This can be significantly faster than buildpkg
if not many packages depend on the changed package.
NB the command is taken as the rest of the line
so may be any number of arguments and does not need to be
in quotes.
The getpkg script checks out a named package.
By default it checks out the latest tagged version (using the
latest
script).
You can also check out a specified version, or with the
-h flag, you can check out the HEAD version.
By default it does not create the extra CMT version directory,
but instead creates the required vrsion.cmt file
in the cmt directory. If you want the CMT
version directory, you can give the -v flag
(which must be first). The default is -nv
for no intermediate version directory.
Usage:
getpkg -h dbFiles
-- checks out the HEAD version of the dbFiles
package. This is probably the thing you mostly want to do
if you are going to change anything.
getpkg dbFiles
-- checks out the latest tagged version of the dbFiles
package. This is probably best if you want to use a presumably
stable version of someone elses package.
Any changes you make (and commit) will create a new CVS branch.
getpkg dbFiles dbFiles-00-01-00
-- checks out the tagged version dbFiles-00-01-00
of the dbFiles package.
getpkg -v -h dbFiles
-- checks out the HEAD version and creates the old two level
CMT directory structure with the intermediate version directory.
The getallpkg script uses
getpkg
to check out all our packages.
By default, like getpkg , it checks out
the latest tagged version. Use the
-h option to get the HEAD version
of all packages.
The list of packages is obtained from the
pkginfo.pl
utility.
As with getpkg , you can also give
the -v flag (as the first argument)
to get the old style two level CMT directory
structure. The default is -nv
for no intermediate version directory.
Usage:
getallpkg -h
-- checks out the HEAD version of all our packages.
The updallpkg script ensures that all checked
out packages are up to date by doing cvs update -d
in each one.
The list of known packages is obtained from the
pkginfo.pl
utility.
You can use the -n option to run
cvs -n update -d to check what would be updated
without actually doing it.
The importpkg.pl script imports a new package into CVS.
Everything in and below the current directory is imported, but before
this is done, a few checks and cleanups are made.
The current directory must contain a cmt subdirectory.
If either the current or cmt directories are missing
a .cvsignore file, a suitable one is created for each
directory.
Then any files in the cmt subdirectory which CMT
regenerates (*.make,*.sh, *.csh ) are deleted.
The script also deletes any binary directories it finds
(eg i686-slc3-gcc323* etc).
You will be shown the list of files and directories to be deleted
and can cancel at this point.
After all the cleanups, the remaining files and directories
are imported into the CVS repository as the 00-00-00 version
of the specified package (which must not already exist).
Usage:
importpkg.pl myPkg
-- imports the contents of the current directory and all its subdirectories
into CVS as initial version myPkg-00-00-00
of the myPkg package.
The remoldver.pl script is a simple utility to
remove old versions of packages. As developers tag new versions
of their packages, if you use getallpkg you will
accumulate successive versions in your l1calo area
(if you are using the two level CMT version directory style).
Sometimes CMT seems to pick the wrong version to use, so it
makes life easier if you only have one version around.
If you run remoldver.pl from your
l1calo area, it looks for old versions and asks
if you want them to be deleted.
This script is only useful if you checked out packages with
the old style CMT two level directory structure. If you do
not have the extra version directory, this script should
not be used.
The checkoutrel.pl , makerel.pl and
finishrel.pl scripts build complete releases
of all L1Calo software. The typical use is to make the nightly
build of the HEAD versions of all our packages.
Alternately they can be used to build a specific release
using particular tagged versions of (a subset of) our packages.
In the latter case, the set of tagged versions appropriate
for an identified L1Calo release are obtained from the
pkginfo.pl
utility.
The scripts are used as follows. First checkoutrel.pl
checks out all required packages from CVS. Next, makerel.pl
is used to build the release for a given CMTCONFIG value. It does
both debug and non-debug versions. makerel.pl can be
used several times with different CMTCONFIG values. Finally
finishrel.pl builds the reference documentation,
checks for build failures, invokes relpage.pl to
write web pages and cleans up.
Optionally finishrel.pl can send emails to package
developers if their packages failed to build.
Usage:
checkoutrel.pl pid release relDir relPkg cvsroot guru emailAuthors cmtconfig
makerel.pl pid release relDir relPkg cvsroot guru emailAuthors cmtconfig
finishrel.pl pid release relDir relPkg cvsroot guru emailAuthors cmtconfig
-- where the arguments which control the scripts behaviour are as follows
(not all are actually used by each script):
pid -- is an arbitrary numeric suffix to uniquely
label the temporary working directory. The PID of the parent process
is a good choice.
release -- is the release to build.
The default is "nightly ".
Any other value known to the
pkginfo.pl
utility may also be given.
relDir -- is the default directory in
which to build the release. The default is $HOME .
The release name is appended to relDir .
relPkg -- is the CMT package to use as
the release package. The default is L1CaloRelease .
Other packages might be given for test purposes.
cvsroot -- is the value of CVSROOT to use.
By default the current environment variable (if any) is used.
guru -- is the email address of the person
to whom emails about general errors should be sent.
The default is the local user running the script.
emailAuthors -- is a flag which specifies
whether emails should be sent to the authors of packages
which fail to build. The possible values of this flag are
"authors " which sends emails to package authors
(and the guru) or "guru " which instead sends the
emails only to the email address of the guru .
This may be useful for test purposes.
The default is not to send any emails.
cmtconfig -- is the CMTCONFIG to be used
for a given invocation of makerel.pl .
By default the current environment variable (if any) is used.
The latest script returns the latest tagged
version of a package. It relies on your CVSROOT environment
variable being set correctly and also requires that some
special CMT hooks have been installed in your CVS repository.
Chapter 13 of the CMT manual (available from
here)
explains what is required. This has been done for our CVS
r/epository at CERN.
Usage:
latest dbFiles
-- returns the latest tagged version of the dbFiles package.
The pkginfo.pl script gives some information
about our packages. So far you can get the list of all
our packages and the tagged version of a package included
in a particular overall release of the L1Calo software.
Usage:
pkginfo.pl list
-- returns the list of all our packages.
pkginfo.pl tag dbFiles release
-- returns the CVS tag for the version of the dbFiles
package included in the specified release .
cdpkg.sh is a utility script for navigating among
the directories of a CMT package (or to other packages) for those
who dont like typing cd ../../xxx/yyy a lot.
It must be sourced to have any effect and is probably most useful
if it is invoked from an alias. Unfortunately it needs to know if
it is being sourced from bash or zsh
as their behaviour is different.
Usage:
First set up a suitable alias for your shell. You can use anything,
it doesnt have to be sd as shown below:
alias sd="source ~/l1calo/scripts/cdpkg.sh -b # (for bash)
alias sd="source ~/l1calo/scripts/cdpkg.sh -z # (for zsh)
Then
sd src
-- changes directory to the src directory in the
current CMT package (from wherever you are within it). Note
that your current working directory must be within an ATLAS
style CMT package, ie pkg/pkg-nn-nn-nn .
sd newPkg cmt
-- changes directory to the cmt directory of
the latest version of package newPkg (which must
exist at the same level as your current package).
There are two symbolic directories: inc
and obj :
sd inc
-- changes directory to the include directory (which should
have the same name as the package).
sd -q obj
-- changes directory to the current binary target directory
(ie the value of the CMTCONFIG environment variable).
The -q flag suppresses the printout of the new
directory. You can include that in the definition of your alias
if you like.
Utilities for generating documentation
The following two scripts are used to extract source code
documentation from our packages.
The doxpkg.pl script runs Doxygen and/or Javadoc
on a checked out CMT package to generate reference documentation
from the source code.
The script must be run from the CMT working area, ie where
all the package/version directory trees are found.
It looks for a Doxygen control file called
package/version/dox/Doxyfile
and for java source directories package/version/jsrc
and package/version/$CMTCONFIG/java where the latter
is where generated java source code is expected. If none of these
files or directories is found, doxpkg.pl exits silently.
Usage:
cd l1calo # expect confL1Calo/version here
doxpkg.pl confL1Calo
-- runs Doxygen and/or Javadoc on the confL1Calo package.
NB the doxpkg.pl script has effectively been
superceded by a new CMT fragment dox which you can
use via make dox from with the cmt
directory of your package. See the documentation on the
L1CaloPolicy package.
The doxallpkg.pl script runs Doxygen and/or Javadoc
on all checked out CMT packages found in the current directory.
The script must be run from the CMT working area, ie where
all the package/version directory trees are found.
Usage:
cd l1calo # expect package/version directories here
doxallpkg.pl
-- runs Doxygen and/or Javadoc on all packages in the
l1calo working area.
Utilities for downloading software
Obtaining and installing both CMT and especially the Online
software involve a number of files and operations on them.
For convenience, these operations have been collected into
a number of scripts.
The downloadcmt.pl script obtains and installs
a specified version of CMT.
The first time you try to get CMT, you will need to run the
script from a directory named CMT which is where the software
will be installed. Subsequently, assuming you have sourced
the CMT setup.sh script, downloadcmt.pl will try
to use the value of the CMTROOT environment
variable to determine where your CMT directory is.
Usage:
mkdir -p somedir/CMT # if it doesnt already exist
cd somedir/CMT # if CMTROOT is not defined
downloadcmt.pl v1r18p20041201
-- downloads and installs CMT version v1r18p20041201
(our default version at the time of writing).
L1Calo configuration scripts
The setupcmt.sh script is intended to be sourced
from your shell rc file. It expects that the TDAQ software
setup.sh scripts have already been sourced.
It then sets up all the extra environment variables and paths
required to run the L1Calo software.
The setup.sh script is an similar alternative to
setupcmt.sh and can be sourced to setup the L1Calo
development environment. It in turn sources setup scripts which
are generated automatically, by our L1CaloRelease
package, from CMT commands in our package requirements files.
This is in contrast to setupcmt.sh which is maintained
manually.
Like setupcmt.sh it expects that the TDAQ software
setup.sh scripts have already been sourced.
Online software related utilities
The edconf script is a wrapper for the standard
oks_data_editor utility.
Our database files are kept in a CVS package (dbFiles )
but are installed into the $L1CALO_ROOT area.
There are links between the different database files and these
all point to the installation area.
However if you want to edit a set of linked files inside the
dbFiles working area, you want to update the source
versions of the linked files, not the (readonly) versions in
the installed area. All edconf does is to redirect
$L1CALO_ROOT to point to dbFiles
before running oks_data_editor .
Usage:
cd dbFiles/version/partitions # directory of partition files
edconf L1CaloSlice.data.xml # edit specified partition
-- invokes oks_data_editor to edit the
L1CaloSlice partition and the files it references,
all within the dbFiles package.
Last updated on 19-Jan-2006
by Murrough Landon
|