uscms.org  www 

User Software and Computing

Computing Environment Setup : Software Setup

General CMS Software Environment

The CMS software environment for csh and tcsh users is set by sourcing the environment setup script.

In tcsh, csh:

source /cvmfs/cms.cern.ch/cmsset_default.csh

In bash, sh:

source /cvmfs/cms.cern.ch/cmsset_default.sh

This will set general CMS software environment variables, extend the user's $PATH to include CMS specific utilities and tools, and define aliases used in the CMS software projects.

Note:, if you wish to change your default login shell, follow the instructions later on this page to open a ServiceNow Request.

Platform specific environment

SCRAM automatically sets the correct architecture based on the version of Scientific Linux installed on a node. The default (which may change) is slc6_amd64_gcc472. You only need to redefine the architecture if you want to change the default. For a more detailed example, see the CMS WorkBook. For example, to access newer releases do the following:

In tcsh:

setenv SCRAM_ARCH slc6_amd64_gcc630

Or in bash:

export SCRAM_ARCH=slc6_amd64_gcc630

Note that a CMSSW work area that is setup in a slc6 environment will NOT work on slc7 nodes, such as cmslpc-sl7.fnal.gov. You must make a new CMSSW work area with an appropriate slc7 SCRAM_ARCH to have the code run on slc7.

Build work area and set runtime environment

To build your work area: the instructions are described in the CMSWorkBook twiki. Keep in mind that you will probably want to work in your ~/nobackup/ area as it has more space available than your home directory.

For example: cmsrel CMSSW_9_3_2 creates a working area which you only need to do once per CMSSW version. You will need to be within the CMSSW_9_3_2/src directory to build the runtime environment.

A runtime environment for applications is generated by the scramv1 runtime -[c]sh command, executed in the area associated with a particular version of product. It may be the development area created by a user, or a public release area. The output of that command differs between versions, and the runtime environment itself is not set automatically. To set it, the user need to evaluate the result of the command above using the aliased cmsenv command, which is available only after sourcing /cvmfs/cms.cern.ch/cmsset_default.[c]sh.

Show me how [β] (uses existing cmsrel of myFavoriteCMSSW instead of, for instance, CMSSW_9_3_2)


CMSSW and version control is handled by GitHub. This link describes how to setup and access the CMSSW github.

Additionally, there is the Github HATS at the LPC from 2017 to learn more about how to use GitHub with CMSSW.

Login shell

The default login shell for new users at the cmslpc cluster is bash (June 4, 2019), it was tcsh until then.

To find out what your current shell is, use the command:

[username@cmslpc117 ~]$ echo $0

  • To permanently change your default login shell, use the LPC Service Portal
    • Login with Fermilab single sign-on (to use Kerberos, be sure to do a one-time configuration of your browser per the directions on the sign-on page; otherwise use your Services username/password (different from Kerberos))
    • Choose the " Modify default shell on CMS LPC nodes" ticket and fill it out
    • The ticket will process and close automatically usually within a minute
      • Note:It may take up to 1 business day (FNAL hours) for this change to propagate to all nodes
  • Note that changing one's shell manually after you login may not process default EOS aliases unless you use the -l option, like bash -l
  • As of Nov. 4, 2019, any new users get a default ~/.bash_profile file with the contents:
    # Source global definitions
    if [ -f /etc/bashrc ]; then
        . /etc/bashrc
  • Users with accounts made before Nov. 4, 2019 do not have a ~/.bash_profile by default)
  • Consider that modifying ~/.bash_profile is best for most uses, for instance, ~/.bashrc is used with scp. For more on that, there are many web discussions.

LCG software and standalone ROOT

There is a lot of additional software packages available through the LHC Computing Grid (LCG). For more information on what is available, consult: LCG list of packages for release 89, and PersistencyReleaseNotes#LCG_89 twiki. To setup the software from cvmfs, do the following (tcsh) - a specific example version is given - please pick your own preferred example LCG_**
Note /cvmfs/sft.cern.ch/lcg/mapfile.txt contains the list of all the possible software/directories:

[username@cmslpc37 ~]$ source /cvmfs/sft.cern.ch/lcg/views/LCG_89/x86_64-slc6-gcc62-opt/setup.csh


[username@cmslpc37 ~]$ source /cvmfs/sft.cern.ch/lcg/views/LCG_89/x86_64-slc6-gcc62-opt/setup.sh

Note that this may set different versions of python and root than your typical CMSSW, so you may wish to not use this command in the same shell as a CMSSW software environment. You can then configure a standalone ROOT (not in CMSSW!) - be sure your gcc compiler is a similar version (note the LCG environment above will pickup a standalone ROOT). Note that this will NOT work with python as you want the complete LCG setup in which the appropriate ROOT and python versions are both in your environment. This technique works for ROOT only. tcsh:

[username@cmslpc37 ~]$  source /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.10.02-19565/x86_64-slc6-gcc62-opt/bin/thisroot.csh


[username@cmslpc37 ~]$  source /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.10.02-19565/x86_64-slc6-gcc62-opt/bin/thisroot.sh

You can find similar versions for different architectures, for instance on a SL7 node, use: x86_64-centos7-gcc7-opt

For the most recent version of ROOT, browse here:
ls /cvmfs/sft.cern.ch/lcg/releases/LCG_latest/ROOT


  • Most versions of CMSSW come with Python2. CMSSW_10_1_X_2018-03-08-1100 comes with python (2) and python3.
  • However, if you want to run python3, you can pick that up from cvmfs, by running python3.6 directly from this area, note that this doesn't change your PYTHONPATH so you may find that useful:

    [username@cmslpc37 ~]$ /cvmfs/sft.cern.ch/lcg/releases/Python/3.6.3-c2eb8/i686-slc6-gcc49-opt/bin/python3.6

  • Or pre-pend your path (tcsh example given):

    [username@cmslpc37 ~]$ setenv PATH /cvmfs/sft.cern.ch/lcg/releases/Python/3.6.3-c2eb8/i686-slc6-gcc49-opt/bin/python3.6:${PATH}

    [username@cmslpc37 ~]$ python3

  • Alternately you can get it from setting up the complete LCG Python3 environment, for example (tcsh):

    [username@cmslpc37 ~]$ source /cvmfs/sft.cern.ch/lcg/views/LCG_92python3/x86_64-slc6-gcc62-opt/setup.csh


    [username@cmslpc37 ~]$ source /cvmfs/sft.cern.ch/lcg/views/LCG_92python3/x86_64-slc6-gcc62-opt/setup.sh

    Then you can run

    [username@cmslpc37 ~]$ python3


Fermilab LPC has its own cvmfs area: /cvmfs/cms-lpc.opensciencegrid.org
  • Useful scripts synchronized from the FNALLPC github lpc-scripts area are in /cvmfs/cms-lpc.opensciencegrid.org/FNALLPC/lpc-scripts
  • LPC Collaborative group software can be found in /cvmfs/cms-lpc.opensciencegrid.org/group
  • GPU software (under development) can be found in /cvmfs/cms-lpc.opensciencegrid.org/sl7/gpu, with Setup.csh and Setup.sh to setup the working environment for tcsh and bash shells, respectively.


For further references about using scram commands please consult the CMS WorkBook SetComputerNode. For questions concerning this page and CMS software environment at FNAL consult the LPC Computing Get Help list of resources.

Webmaster | Last modified: Tuesday, 19-May-2020 14:50:44 CDT