Building and Running LHCb Software
This page is obsolete and no longer maintained.
The new address is:
These instructions aim to be a guide to setting up and running the LHCb
software on a standalone windows machine, or using the CERN development
Terminal Server. In case of installation problems, errors in the
instructions or suggestions for improvements please contact Marco
- For Standalone Machines
- For the CERN Terminal Server
- For both standalone machines and terminal server
- Define Environment Variables
- Software access
- Install a software
- Map network drive
- Available Commands at the DOS Prompt
- Building LHCb Software on Windows in
Command Line Mode
- Using Visual Studio .NET
Before you can use the LHCb software, you will need to do a few tasks.
These tasks differ slightly depending on where you wish to run the
software; Either on a standalone CERN NICE PC, or using the CERN
windows terminal server.
N.B. If your PC was installed by the
LHCb support team at CERN, it should already have been configured
according to the following instructions, including AFS.
N.B. If you previously had a Visual
Studio 6 installation, remove
You will need to set up on your PC the following software
- Install the SSH application PuTTy
- If you are on CERN-NICE, you can install using the "Add/Remove CMF
packages" facility on your PC. Otherwise you can download the latest
- Install Microsoft Visual Studio .NET
- On CERN-NICE, use the "Add/Remove CMF packages" facility on your PC to add Microsoft
Visual Studio.NET 2003 (not 2005)
- Follow the instructions in the setup wizard. Most defaults
are sensible, but you may want to skip installation of Web server
extensions in step 1
- Install the CERN Castor software
- Provides various useful commands, such as rfcp. Note that Castor 2 is
not (yet) available for Windows.
- On CERN-NICE, install using the "Add/Remove CMF packages" facility on
- Otherwise you can try to download from
- Install OpenAFS (optional)
- You can choose whether to install all the LHCb software stack locally
(recommended) or access it from the centrally maintained release area in
- If you choose to use AFS, installation instructions can be found
- Install Emacs (optional)
- If you are familiar with
emacs and wish to use this on windows, follow the instructions here.
For the CERN Terminal
- Install the appropriate remote desktop software
- Installation instructions can be found from here for Windows, Mac and linux users.
- Note - rdesktop has already been installed on lxplus.
- Register your CERN NICE account for TS access
- This can also be done from here,
by following the registration link.
pcdn ~ > rdesktop
-d CERN -k en-gb -g
1024x768 -T "NICE TS" cerntsdev01.cern.ch
- Start a session on the terminal server cerntsdev01.cern.ch.
- For linux the application to use is "rdesktop". A useful set
of options (for a British keyboard) is
pcdn ~ > rdesktop -d CERN -k en-gb -g 1024x768 -T "NICE TS"
- Connection Problems ?
- If you experience problems connecting to the Terminal Server
from outside CERN, it is possible that your local network is blocking
connections through the RDP port 3389. Symptoms are, for example with
pcdn ~ > ERROR: connect: Connection refused
- If this happens, you should speak to your local system
administrator to see if access can be granted. If this is not possible,
one solution which works very well is to start a VNC session on lxplus,
and run rdesktop from there. See this page for
details on how to use VNC.
For both standalone and TS sessions, once you
performed the prerequisites as above :-
- Configure SSH access to the CVS repository
- Detailed instructions can be found
- NOTE For
Terminal Server users : TS users can not use the "Scheduled
Tasks", as described in the notes, since this requires administrator
rights. A work around for this is to create a desktop short cut :-
- Create a new shortcut on your desktop (right click on the
- Add the command "C:\Program
- Where <path-to-private-key> is the complete path to
your private ssh key.
- Double clicking this new icon will start up pagent and add
- Create a .emacs file in your
HOME area (optional)
- Copy to the directory pointed to by the environment variable
HOME, your .emacs file. A standard version containing the
customisations for LHCb, can be downloaded from here.
(NB - Remember to remove the first "a" from the file name when saving.
It was added since the web server doesn't like files without a
character before the . !)
- If you don't have the variable HOME defined, follow the
instructions here to define it.
- NOTE For Terminal Server users :
Emacs is already installed and available from the start Menu.
- If you want to access the AFS software release
areas, configure AFS
- Using the AFS application (a
little padlock in the system tray) :-
- Mandatory : Mount /afs
- Recommended : Mount your
home (e.g. /afs/cern.ch/user/j/jonrob) area as U:
The following environment variables are mandatory and must
be defined (in Start->Control Panel->System->Advanced Menu)
- CMT needs to write some temporary files: it writes on
- You should make sure that the TEMP environment variable points to
an area with write access.
- The first location where CMT is looking for projects. You
should create a directory, typically on the local disk (
and set User_release_area to point to it.
- NOTE For
Terminal Server users : For local files, we recommend using the
- Must be set to ":ext:isscvs.cern.ch:/local/reps/lhcb" to
enable ssh access to the server.
- Must be set to the location of the PuTTy application "plink".
Normally this will be "C:\Program Files\PuTTY\plink".
The following variable is optional, it should only be set if you want CMT to
access the AFS software release areas
- Set the environment variable AFSROOT
The following variables are optional, they are needed if you want to
use emacs as editor
- Points to your "home" area
(e.g. C:\Users\<username> on the TS). Used by emacs as the
location to look for a ".emacs" file.
- The location of the LHCb
Emacs package. Set as
If you have chosen to not use AFS, you have to install at least one version
of the LHCb software stack, using the installProject.py script.
- Create a directory on the local disk under which you will install the
software. e.g. C:\releases
- Define the environment variable MYSITEROOT to point to
the above directory
- Import the software by following the instructions given
Map Network Drives (optional)
If you have chosen to use the AFS release area, and you are at CERN, we recommend that you map the directory \\cern.ch\dfs\Experiments to
the S: drive. This directory contains a collection of scripts needed to
run various tasks. To map a network drive, use the Tools menu of the
Available Commands at
the DOS Prompt
(Hint: If you want to have a unix shell style "tab"
behaviour to autocomplete a filename/directory in DOS, set the
value "9" in the registry key:
When you open a new DOS window, you should execute a script equivalent to the
group login on Linux, to set up all other environment variables necessary to
work with CVS and CMT. Depending on whether or not you have installed the
software locally, you should type:
- %MYSITEROOT%\scripts\localsetup.bat (local
- S:\lhcb\scripts\lhcbsetup (AFS+DFS installation)
(Hint: If you have a desktop shortcut to start a DOS window, you
can modify its properties to execute the script automatically:
right-click on the icon, select Properties, Shortcut tab. In "Target:"
append the string: /K S:\lhcb\scripts\lhcbsetup. In "Start
in:" you could choose to start in %User_release_area%.)
The following commands are available at the DOS prompt:
- getpack Similar behaviour than the Linux
one with the same arguments. It does the checkout from the cvs
repository and configures the package.
- setenvProject Setup
your environment for a particular project (e.g. setenvProject Brunel v31r7).
Wildcard usage does not always work - you may need to specify the
version you want at the command line.
All cmt commands are available. This include the cmt broadcast, cmt
- make Is
equivalent to "nmake /f nmake"
- setup To execute
the setup.bat in each package to set the necessary environment
Wrapper for the cvs command (accesses the public WinCVS installation in
the CERN dfs domain).
- doxygen Wrapper for the doxygen documentation
tool. See here
Standard DOS command to set environment variables. Useful for
setting variables for the current DOS window only. e.g. set
Software on Windows in Command Line Mode
Building software in Windows in command-line mode is not much
different from building it in Linux. All the basic commands (cmt, cvs,
etc.) should just work the same way in this environment. This is
perhaps the easiest way to check that your package can be built and run
in Windows if you are not used to the graphical integrated development
environments (Visual Studio).
The following command sequence should just do the work of building
and running (e.g. using Brunel)
> BrunelEnv v24r2
getpack Rec/Brunel v24r2
> cd Rec\Brunel\v24r2\cmt
> make (or "cmt broadcast
make" for multiple packages)
Using Visual Studio
Terminal Server Users : In order to use the graphical interface
to Visual Studio .Net you need special access rights. You should ask Joel
to add you to the "Debugger Users" group on the terminal server.
Before starting Visual Studio.NET, you need to create the "solution"
file (equivalent to the workspace in VisualStudio 6). For example:
> cmt build vsnet
The last command starts Visual Studio.NET. Before running e.g. Brunel,
you may have to tell Visual Studio.NET about the job options file that
you want to read:
- In Solution Explorer select Brunel
- In Project Menu: "Set as StartUp Project"
- In Project Menu -> Properties...
- Select Debugging the left hand panel
- In Command Arguments add: ..\options\v200402.opts
N.B. This step is only necessary once, it is remembered in subsequent
Visual Studio.NET sessions with this executable
You are now ready to debug your program. Use [F5] to run the program
in debug mode.
Data Access on Windows
If you have installed the Castor client, you can access Castor data files
directly from Gaudi, as on Linux. Instructions for accessing data using DC04
software (obsolete) are given here
Document last updated