Windows development environment

Official windows support was dropped in October 2011. All what is below is likely to be obsolete.

These instructions aim to be a guide to setting up and running the LHCb software on a standalone windows machine, or using the LHCb Windows Terminal Server at CERN ( The Terminal Server is a virtual Windows 2003 server which allows concurrent connections. To request the rights to log on to this machine please contact Joel.Cloiser AT

In case of installation problems, errors in the instructions or suggestions for improvements please contact Marco and Chris. The lhcbts installation is maintained by Hubert.


Preparing a standalone machine

This section describes the software that has to be installed and configured on a standalone Windows machine. The instructions are given for machines in the CERN NICE environment. You can skip to the next section if you are using the Terminal Server, or if your PC was installed by the LHCb support team at CERN.

Install the SSH application PuTTy
SSH is needed to access the CERN CVS servers.
  • 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 version from here.
  • In Start->Control Panel->System->Advanced Menu, define the environment variable CVS_RSH. It must be set to the location of the PuTTy application plink. Normally this will be C:\Program Files\PuTTY\plink.exe.

Prepare access to the LHCb software releases
You have to decide whether to install all the LHCb software locally (recommended) or access the centrally maintained LHCb software release area in AFS
  • For a local installation (recommended):
    • Create a directory on the local disk under which you will install the software. e.g. C:\releases
    • In Start->Control Panel->System->Advanced Menu, define the environment variable MYSITEROOT to point to the above directory
  • For AFS access, install OpenAFS. At CERN it is recommended to use OpenAFS 1.5.60
    • Follow carefully the instructions given in up to step 5. Then:
      • Get an AFS token via the Network Identity Manager (icon installed by step 3 in your system tray), not via the AFS Client
      • Follow the step 6 instructions, but adding a network place with name AFS and network address \\\all
    • In Windows Explorer -> Tools -> Map network drive:
      • mandatory: Z: points to AFS
      • recommended: U: points to your AFS home directory, e.g. AFS\\user\c\cattanem
    • Start the OpenAFS->Client->Authentication program, then click on the padlock in the system tray:
      • In Advanced Menu->Configure AFS Client->Drive letters:
        • Mandatory : Mount /afs as Z:
        • Recommended : Mount your home (e.g. /afs/ area as U:
      • In Advanced Menu->Configure AFS Client->Advanced:
        • Recommended: Increase the size of your AFS cache (e.g. 1,000,000 kB cache and 10000 entries in Status Cache)
    • In Start->Control Panel->System->Advanced Menu, define the environment variable AFSROOT. It should be set to Z:

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 your PC.
  • Otherwise you can try to download from here.

Install Emacs (optional)
If you are familiar with emacs and wish to use this on windows, follow the instructions here.

Preparing access to the Windows Terminal Server

This section describes the steps needed to access the LHCb Windows Terminal server for the first time. You can skip to the next section if you are using a standalone PC.

Install the appropriate remote desktop software if needed
Installation instructions can be found from here for Windows, Mac and linux users.
  • Note - rdesktop has already been installed in the Scientific Linux CERN distribution.

Register your CERN NICE account for TS access
You should subscribe to the e-group called "lhcb-ts-users".

Start a session on the terminal server
  • 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 rdesktop :-
      pcdn ~ > rdesktop -d CERN -k en-gb -g 1024x768 -T "NICE TS"
      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.

Completing the installation

This section describes actions needed by all users both on standalone PCs and the Terminal Server. To set environment variables, use Start->Control Panel->System->Advanced Menu

Configure SSH access to the SVN repository
  • Detailed instructions can be found here (and here for CVS [obsolete]).
  • NOTE For Terminal Server users : TS users can not use the "Scheduled Tasks", as described in the notes, since this requires administrator rights. Without administrator rights it is still possible to use "Startup scripts":
    • "right click" on Start button, and "Open" in the context menu
    • Navigate to: Programs\Startup
    • Create a new shortcut in this directory with Target action set as: "C:\Program Files\PuTTY\pageant.exe" <path-to-private-key>

  • Another work around of Scheduled Tasks is to create a desktop short cut :
    • Create a new shortcut on your desktop (right click on the desktop)
    • Add the command "C:\Program Files\PuTTY\pageant.exe" <path-to-private-key>
    • 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 you key.
    • If the SSH configuration was successful, you should be able to connect without password with only the private/public key verification. In order to check this, you can try:
      C:\> "C:\Program Files\PuTTY\plink.exe" (username)
      where (username) is the lxplus account you have used to set up your ssh key.
    • [obsolete, only for CVS access] Define the environment variables CVSROOT = "" and CVS_RSH must be set to the location of the PuTTy application "plink". Normally this will be "C:\Program Files\PuTTY\plink".

Define a User_release_area
The User_release_area environment variable must be defined to point to a read/write directory. This will be your working directory and, for speed of access reasons, it is recommended to set it up on a local disk (though remember that it is then up to you to back it up)
  • On a standalone PC, create a directory C:\cmtuser and set User_release_area to point to it
  • On the terminal server, User_release_area is predefined to point to F:\users\(username)\cmtuser
  • It is also possible to define the User_release_area to be your AFS cmtuser directory. Set it to Z:\\user\(u)\(username)\cmtuser
If necessary, define GETPACK_USER
The GETPACK_USER environment variable must be defined if your Windows username is different from your lxplus username. Set it to the lxplus username that you use to when working on LHCb.
If you wish to use emacs:
  • Define the following environment variables
    • HOME
      • 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 "Z:\\lhcb\software\releases\TOOLS\Tools\Emacs\pro"
  • 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.

Accessing the LHCb software

The official software releases against which you build your software can be either installed on the local disk of the Windows machine (recommended) or accessed from the central AFS installation (slower but can be very handy if the working files are not in CVS (yet) or if the needed projects have not been installed locally). By analogy with working on Linux, commands to check out, build and run the LHCb software are executed in a DOS terminal window, in which the LHCb environment has been set (via execution of a "login" script). Different scripts are executed depending on whether you choose to work with the local installation or the AFS installation.

Pre-defined terminal windows on the LHCb terminal server

When you log in to the LHCb terminal server, you will find two terminal icons. These shortcuts provide a shell with the CMT environment set up for usage of either the local LHCb software installation on the machine ("Lblogin local" icon) or the AFS software installation ("LbLogin AFS" icon). Double click on one of these icons to open a terminal window.

These shortcuts are calling different instances of the LbLogin.bat script setting up different software locations. But both of them are calling a local post setup script %LOGIN_POST_SCRIPT%.bat if it exists. On the LHCb windows terminal servers, The LOGIN_POST_SCRIPT variable is defined system-wide and it is pointing to %LOCALINSTALLDRIVE%\local\lib\studio. This later bat script is then calling the proper compiler setup.

The user can also use that variable to customize the post setup of the login procedure. In order to do this, she/he has to (for example):

  1. create a new script (D:\Profiles\degauden\mysetup.bat) containing a call to the orginal studio.bat
         call  %LOCALINSTALLDRIVE%\local\lib\studio.bat 
  1. add the customisations.
  2. change the LOGIN_POST_SCRIPT variable in the system properties to point to D:\Profiles\degauden\mysetup (the .bat extension is automatically added)

More exhaustive informations about the behavior of the the login procedure can be found in the LbScripts release web pages

Local installation of LHCb software

  • Every release of the LHCb software is installed on the local disk of the terminal server (in E:\soft) by the LHCb software librarian, using the script
  • On a standalone PC, you have to install yourself at least one version of the LHCb software stack, using the script.
Import the software by following the instructions given here.

Using the AFS release area

In order to be able to access the AFS volumes, you have to setup your OpenAFS token (Start->All Programs->OpenAFS->Client->authentication)

Setting up the LHCb environment terminal window on a standalone machine

Start a terminal window (Start->Run..->cmd), then 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%\LbLogin.bat (local installation)
  • Z:\\lhcb\software\releases\LBSCRIPTS\prod\InstallArea\scripts\LbLogin.bat (AFS installation)

You then have to set up the environment for the compiler, with the command:

  • "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat" (Mandatory, C++)
  • "C:\Program Files\Microsoft Visual Studio\DF98\BIN\DFVARS.BAT" (Optional, if you have also installed the Fortran compiler)

Hint: If you have a desktop shortcut to start a terminal 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 %MYSITEROOT%\LbLogin.bat & "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat". In "Start in:" you could choose to start in %User_release_area%.

Alternatively you can also use the LOGIN_POST_SCRIPT feature to call the compiler setup. The entry in the short cut tab stays:

       C:\WINNT\system32\cmd.exe /k %VO_LHCB_SW_DIR%\lib\LbLogin.bat 
and the script %LOGIN_POST_SCRIPT%.bat is called automatically (please see above)

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: HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar)

The following commands are available at the DOS prompt:

  • getpack Similar behaviour to the Linux one with the same arguments. It does the checkout from the cvs repository and configures the package.
  • SetupProject Setup your environment for a particular project (e.g. SetupProject Brunel v33r3).
  • cmt All cmt commands are available. This include the cmt broadcast, cmt checkout, etc.
  • make Is equivalent to "nmake /f nmake" (NB : This command is only available once you have run the setup.bat script from your application cmt directory).
  • cvs Wrapper for the cvs command (accesses the public WinCVS installation in the CERN dfs domain).
  • doxygen Wrapper for the doxygen documentation tool. See here for details.
  • set Standard DOS command to set environment variables. Useful for setting variables for the current DOS window only. e.g. set User_release_area=C:\cmtuser

Building LHCb 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)

        > SetupProject --build-env Brunel v33r3
        > getpack Rec/Brunel v33r3
        > cd Rec\Brunel\cmt
        > cmt make (or "cmt broadcast cmt make" for multiple packages)
        > cmt run gaudirun ..\options\ .\
(Note that the command is gaudirun, not

Using Visual Studio .NET

Note to Terminal Server Users : In order to use the graphical interface to Visual Studio .Net you need special access rights. You should ask Joel or Hubert 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:

        > cd C:\cmtuser\Brunel_v33r3\Rec\Brunel\cmt
        > SetupProject Brunel v33r3
        > cmt build vsnet
        > ..\Visual\Brunel.sln

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 all
  • In Project Menu: "Set as StartUp Project"
  • In Project Menu -> Properties...
    • Select Debugging the left hand panel
    • In Command add: python.exe
    • In Command Arguments add: C:\software\releases\lhcb\GAUDI\GAUDI_v20r2\InstallArea\scripts\ ..\options\ .\
(you need the full path to, you can get it with which in the DOS window)

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

In principle, if you have installed the Castor client, you should be able to access Castor data files directly from Gaudi, as on Linux. This is however slow because it uses the public Castor 1 disk pool as opposed to the LHCb Castor 2 disk pool, so usually means a tape mount. For this reason, it is suggested that you make a disk copy of frequently used files.

Installed development tools on the Terminal Server

Beside the Windows Visual C++ development tools, a bunch of other development tools have also been installed on LHCbTS:

Some editors
Vim, Emacs, XEmacs
The Eclipse IDE 3.3 (Europa)
with support for Python and C++ development. See EclipseConfiguration
CVS tools
WinCVS, TortoiseCVS. To be noted that these tools will only work on windows with the "ext" method with CVS_RSH=ssh. The "kserver" (kerberos) method which is commonly used on lxplus (and on the AFS volumes) will not work. On windows by default, the getpack utility uses the ssh method for the CVS checkout. It is advised to setup your ssh key pair in order to be able to issue CVS commands without having to give the password each time.

-- KarolKruzelecki - 19-Mar-2010 -- MarcoCattaneo - 29 May 2009 -- HubertDegaudenzi - 11 Jul 2008 -- ChristopherRJones - 20 Dec 2007 -- DavidHutchcroft - 22 Feb 2008

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatemacs .emacs r1 manage 0.2 K 2007-12-20 - 11:58 ChristopherRJones An example '.emacs' file
Edit | Attach | Watch | Print version | History: r34 < r33 < r32 < r31 < r30 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r34 - 2011-10-12 - PatrickSKoppenburg
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback