Title: Configuration and Build System
1Configuration and Build System
2Objectives
- After completing this session, you should be able
to - Understand the basics of Configuration Management
using CMT - Get a copy of a package from the repository
- Know how to (re)build libraries and programs
3Package
- Package Definition
- Collection of related classes in a logically
cohesive physical unit - Minimal entity that can be versioned
- In practical terms it is defined as a
subdirectory (or a subdirectory tree). For those
familiar with CVS, this means that a package also
corresponds to a module - Reflects on
- Logical structure of the application
- Organizational structure development team
- Code (CVS) repository, access via CMT
4Dependencies, revision, and version
- Packages may and often do use other packages.
- Satisfies a need to link against one or more
libraries and header files from the providing
package. - Top priority
- Reduce inter-package dependencies
- Remove circular dependencies
- Two widely used terms revision version
- a (file) revision is a snapshot of a file stored
in the version management system. For instance, a
file in CVS could have two consecutive revisions
1.10 and 1.11. - a (package) version is some snapshot of the
revisions of all the files in the package, such
as revisions 1.2 of PACKAGE and 1.41 of
matrix.cxx, and is marked by assigning those
revisions a symbolic tag such as - Event-01-12-02.
- as packages undergo development, and as all of
the changes are tracked by CVS, each exists in a
number of versions.
5CVS
- Version control system
- Records the history of your source files
- Helps you if you are part of a group of people
working on the same project. - Repository on AFS
- Basic Commands
- Checkout
- Update
- Add/Remove
- Commit
- During the Tutorial we will be exposed to
corresponding CMT commands
6CMT
- Packages are maintained with CMT
- (Configuration Management Tool)
- Suite of tools and other facilities for
developers of relatively large and complex
software systems. - Looks after the process of building and releasing
products such as libraries and executables - Version management is under CVS
- A CMT package is a directory structure like
ltpackagegt/ltversiongt/cmt/requirements - ltversiongt
is the name of the CVS tag given to this package. - A CMT sub-package is a directory structure like
ltparentgt/ltpackagegt/ltversiongt/cmt/requirements
7CMT directories
- The cmt directory of MyPkg
- MyPkg/MyPkg-01-02-03/cmt
- Mainly CMT scripts
- The include directory of MyPkg
- MyPkg/MyPkg-01-02-03/MyPkg
- The Package .h files
- The source directory of MyPkg
- MyPkg/MyPkg-01-02-03/src
- The Package .cxx file
- In src/components the ltPackagegt_entries.cxx and
ltPackagegt_load files.cxx
- Documentation
- http//www.lal.in2p3.fr/SI/CMT/CMT.htm
- http//atlas.web.cern.ch/Atlas/GROUPS/SOFTWARE/OO/
tools/cmt/primer
8Link vs. Component Libraries
- Link libraries are need for linking the program
(static or dynamic) - Traditional libraries.
- Component libraries are loaded at run-time (eg,
ApplicationMgr.DLLs Component) - Collection of components (Algorithms, Converters,
Services, etc.)
9Component Libraries
ltPackageNamegt_entries.cxx
include GaudiKernel/DeclareFactoryEntries.h DEC
LARE_FACTORY_ENTRIES ( ltPackageNamegt )
DECLARE_ALGORITH( MyAlgorithm )
DECLARE_SERVICE( MyService )
Your components need to be added here
ltPackageNamegt_load.cxx
include GaudiKernel/LoadFactoryEntries.h LOAD_F
ACTORY_ENTRIES ( ltPackageNamegt )
Substitute with your package name
10Setting up the environment
- Copy CMT requirements file in your home directory
(/requirements) - Already done for you - basic one from Atlas CMT
primer - Defines
- Your site
- Your software distribution area
- The release number of Atlas software
- In HOME/requirements, set CMTPATH to your test
area (substitute ltxgt with your actual login, ie
(1-9), (a-e) of student accounts) - path_remove CMTPATH /afs/cern.ch/user/a/atltrltxgt/m
axidisk/Athena - path_prepend CMTPATH /afs/cern.ch/user/a/atltrltxgt/
maxidisk/Athena - Setup CMT (once)
- sh
- source /afs/cern.ch/sw/contrib/CMT/v1r10p20011126/
mgr/setup.sh - cmt config
- At each login (hence not now) - or when
requirements are modified - source setup.sh
- Go to our work directory
- cd maxidisk/Athena
11Checking out code
- Get TestRelease
- from the head (this example)cmt co MyCont/MyPkg
- a specific versioncmt co -r MyPkg-ii-jj-kk MyPkg
- cmt co TestRelease
- Note well be working with CMT under TestRelease
- Get the Atlfast package off the repository
- cmt co /Simulation/Atlfast/AtlfastCode
- Modify TestRelease requirements file to list the
packages being checked out - Syntax
- use ltPkggt lttaggt ltparentgt
- emacs TestRelease/ltrelease-versiongt/cmt/requiremen
ts - And add this line to the requirements file
- use AtlfastCode AtlfastCode-01-
Simulation/Atlfast
12Building the package
- Building AtlfastCode will take 5 mins
- cd TestRelease/ltversiongt/cmt
- source setup.sh
- cmt broadcast cmt config
- cmt broadcast gmake
- Results
- ------gt AtlfastCode library ok
- ------gt AtlfastCode ok
- all ok.
- Then cmt will check TestRelease configuration and
copy Atlfast jobOptions files into ../run
directory. - Manually copy all files
- cp /maxidisk/Athena/Simulation/Atlfast/AtlfastCod
e/AtlfastCode-xx-yy-zz/share/
/maxidisk/Athena/TestRelease/ltversiongt/run - (will be fixed on release vs 3.0.0)
cmt broadcast -selectAtlfastCode gmake
13Athena
- Execute the Main program
- From /run directory
- athena
- Atlfast comes already set to generate events
using Pythia and fast simulate final particles
(e, µ, g) - Running as is, with an empty algorithm will do
all the Atlfast initialization, event generation
(all settings from the standard Atlfast job
options) and not much else but - CONGRATULATIONS you run your very first athena
job!!!!!!
There are moments when everything goes well
dont be frightened, it wont last.