overview of lhcb applications and software environment lhcb software tutorial - march 20111
TRANSCRIPT
![Page 1: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/1.jpg)
Overview of LHCb applications and software environment
LHCb software tutorial - March 20111
![Page 2: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/2.jpg)
AnalysisBender
LHCb applications
LHCb software tutorial - March 20112
Simul.Gauss
AnalysisDaVinci
MCHits
MicroDST
MCParticles
GenParticles
Event Model / Detector Description / Conditions
Gaudi
Digit.Boole HLT
MooreReco.Brunel
Raw Data
DST
StrippingDaVinci
Ev.Disp.Panoramix
![Page 3: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/3.jpg)
Software organisation
LHCb software tutorial - March 20113
Applications are released as a stack of Projects One project per application
e.g. Brunel, DaVinci
Several independent projects for components e.g. Lbcom, Rec, Hlt, Analysis, Stripping
Four projects for the framework Gaudi, LHCb, Phys, Online
Projects are collections of Packages Group of classes in a logically cohesive physical unit.
Packaging structure reflects on: Logical structure of the application Organizational structure of the development team
Package is minimal entity that can be versioned A project version uniquely defines the versions of the
packages it contains, and of the projects it depends on Users work in the environment defined for a given version of the
chosen project e.g. SetupProject DaVinci v28r1p1
BrunelLbco
mRec
LHCbGaud
i
![Page 4: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/4.jpg)
LHCb software tutorial - March 20114
CMT (Configuration Management Tool) Based around the notion of package Provides a set of tools for automating the
configuration and building of packages
CMTrequirements
codecodecodecodecode
SVNrepository
• What to build• How to build • Package
dependencies
makefileDevStudio files
Buildingtools
(compilers, linkers, IDEs )
Libraries&
Executables
![Page 5: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/5.jpg)
public scripts and configurables, will be on$PYTHONPATH
Mandatory documentation directory contains the release.notes file
Package: Structure
LHCb software tutorial - March 20115
cmt srcdoc
i686_winxp_vc9_dbg
x86_64_slc5_icc11_opt
x86_64-slc5-gcc43-opt
packA
$PACKAROOT
Mandatory manager directory contains the requirements file
public include files#include “packA/xxx.h” . . .
options
Hat
packA
python
Job options
Generated binary directories
![Page 6: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/6.jpg)
LHCb software tutorial - March 20116
Package versions Packages have several versions
Defined in cmt requirements file Version number formatted according to convention:
v28r1p1
Major version Indicates a change in the interface: all packages that use
it may have to change Minor version
Indicates an internal only change Patch version
Not always present. A minor bug fix to an existing release
Major version 28
Minor version 1 Patch version 1
![Page 7: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/7.jpg)
LHCb software tutorial - March 20117
Package Categories Application: is a package that sets up the
environment and contains the job options needed for configuring and running a program.
Library: contains a list of classes and the list of dependent packages needed to compile it.
Package group: contains a list of other packages with their version number (e.g. LHCbSys)
Interface package: interfacing to packages not managed with CMT (e.g. Python, GSL, ROOT,…)
![Page 8: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/8.jpg)
LHCb software tutorial - March 20118
Link vs. Component Libraries Link libraries are linked to the program
executable (static or dynamic linking)
Base classes, event and geometry data classes Loaded at program start Must be found on LD_LIBRARY_PATH
Component libraries are loaded on demand at run-time Collection of components (Algorithms, Tools,
Services, etc.) “Plug-ins” No need to recompile or re-link program if plug-in
changes
![Page 9: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/9.jpg)
CMT: requirements file
LHCb software tutorial - March 20119
package MyPackageversion v1r0
# Structure, i.e. directories to process.branches cmt doc src
# Used packages.use GaudiAlg v*
# Component library building rulelibrary MyPackage ../src/*.cpp
# define component library link optionsapply_pattern component_library library=MyPackage
![Page 10: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/10.jpg)
LHCb software tutorial - March 201110
CMT: Basic Commands cmt config
Configures the package (creates setup and make files) Invoked automatically by getpack (see later slide)
cmt show uses Show dependencies and actual versions used
cmt make build the current package
cmt broadcast <command> Recursive CMT command in all used packages found in the
current CMT project e.g. cmt broadcast cmt make
cmt run <command> Executes <command> in current package environment
![Page 11: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/11.jpg)
LHCb software tutorial - March 201111
Setting the CMT environment Create a working directory for a given project
actually an alias for SetupProject --build-env <Project> [<version>]
creates working directory and cd to it: ~/cmtuser/<Project>_<version>
Packages are searched for in Projects that are on CMTPROJECTPATH
Default is ${User_release_area}:${LHCBPROJECTPATH}
Add additional paths with --nightly and --dev-dir switches of SetupProject
> setenv<Project> [<version>]
![Page 12: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/12.jpg)
Getting a package
LHCb software tutorial - March 201112
The “getpack” command Script combining “svn checkout” + “cmt config”
If no version given, it suggests the latest version of a package N.B. Suggested version is not necessarily consistent with current environment;
especially if you are not using the latest environment
> getpack [hat/]<package> [<version>] [head]
![Page 13: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/13.jpg)
Building a package
LHCb software tutorial - March 201113
Work in the /cmt directory <hat>/<package>/cmt
Set the CMT configuration ($CMTCONFIG) Defines platform, compiler, directories where to find binaries
slc5 default: x86_64-slc5-gcc43-opt LbLogin –c i686-slc5-gcc43-dbg setenv CMTCONFIG $CMTDEB
Invoke the make command, via cmt
Putting “cmt” in front of any command ensures that the command is executed in a shell that has defined all the environment described by the requirements file
> cmt make [-j][target][clean][binclean]
![Page 14: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/14.jpg)
Running the application
LHCb software tutorial - March 201114
Set the run time environment
Takes into account value of CMTCONFIG Needed once at beginning of session, then only if environment
changes (new packages checked out, requirements file changed, CMTCONFIG changed, etc.)
Execute the program
But see also cmt run command in hands on
> SetupProject <project> <version>
gaudirun.py job.py
![Page 15: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/15.jpg)
LHCb software tutorial - March 201115
SVN (Version Control System) Record the history of your source files Share your development with other people
Commit often But only codes that compiles and builds
Tested by nightly builds
LHCb and Gaudi Repositories reside on CERN-IT SVN server Private repositories are also possible, but must be
managed by yourself, see http://svn.web.cern.ch/svn/howto.php#creating-requesting
![Page 16: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/16.jpg)
Accessing LHCb SVN server
LHCb software tutorial - March 201116
Web browsable LHCb:
Trac: https://svnweb.cern.ch/trac/lhcb/browser WebSVN: http://svnweb.cern.ch/world/wsvn/lhcb
Gaudi: Trac: https://svnweb.cern.ch/trac/gaudi/browser WebSVN: http://svnweb.cern.ch/world/wsvn/gaudi
World readable if authenticated SSH authentication Automatic if authenticated in CERN AFS cell (lxplus)
For write access Register your account in the e-group lhcb-svn-writers
Detailed instructions athttps://twiki.cern.ch/twiki/bin/view/LHCb/SVNUsageGuidelines
![Page 17: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/17.jpg)
LHCb software tutorial - March 201117
Emacs customisation A customisation of emacs for LHCb:
Templates for creation of files E.g. MyAlgorithm.h, MyAlgorithm.cpp, requirements,
release.notes etc. Various shortcuts for code insertions Optionally, load an EDT keypad emulation
Add following lines to ~/.emacs: (load (expand-file-name "$EMACSDIR/edt")) (load (expand-file-name "$EMACSDIR/lhcb"))
Or copy from $EMACSDIR/.emacs
![Page 18: Overview of LHCb applications and software environment LHCb software tutorial - March 20111](https://reader036.vdocuments.us/reader036/viewer/2022082611/56649eb45503460f94bbb9a3/html5/thumbnails/18.jpg)
LHCb software tutorial - March 201118
Exercise Now read the web page attached to this
lesson in the agenda and work through the exercises