Building and Running LHCb Software on Windows

This page is obsolete and no longer maintained. The new address is:

https://twiki.cern.ch/twiki/bin/view/LHCb/WindowsDevEnv

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 and Chris.

Contents

  1. Prerequisites
    1. For Standalone Machines
    2. For the CERN Terminal Server
    3. For both standalone machines and terminal server
  2. Define Environment Variables
  3. Software access
    1. Install a software release
    2. Map network drive
  4. Available Commands at the DOS Prompt
  5. Building LHCb Software on Windows in Command Line Mode
  6. Using Visual Studio .NET


Prerequisites

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.

For Standalone Machines

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 it
You will need to set up on your PC the following software :-

For the CERN Terminal Server

                       pcdn ~ > rdesktop -d CERN -k en-gb -g 1024x768 -T "NICE TS" cerntsdev01.cern.ch
                       pcdn ~ > rdesktop -d CERN -k en-gb -g 1024x768 -T "NICE TS" cerntsdev01.cern.ch
                       pcdn ~ > ERROR: connect: Connection refused

For both standalone and TS sessions, once you performed the prerequisites as above :-


Define Environment Variables

The following environment variables are mandatory and  must be defined (in Start->Control Panel->System->Advanced Menu)

The following variable is optional, it should only be set if you want CMT to access the AFS software release areas

The following variables are optional, they are needed if you want to use emacs as editor


Install a software release (optional)

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.


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 Windows Explorer.


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)

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:

(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:


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)

        > BrunelEnv v24r2
        > getpack Rec/Brunel v24r2
        > cd Rec\Brunel\v24r2\cmt
        > make (or "cmt broadcast make" for multiple packages)
        > setup
        > ..\win32_vc71_dbg\Brunel.exe ..\options\v200402.opts



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 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\Rec\Brunel\v24r2\cmt
        > setup
        > 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:

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 19-Dec-07.