Instructions for installing CERN CMSIM

From Darin Acosta

Note: Darin uses Alphas; you should grab the files appropriate for your platform.

Note: Tim Cox at UC Davis did extensive comparison and found that the CERN version of CMSIM has 99% of the Davis code in it. Thus, you should install the CERN version. He will install the remaining Davis code soon. Installing the CERN version now has some advantages: you'll get the c++ demon out of the way now. That part of the installation is decidedly non trivial....

Here are some instructions I put together on installing the CERN version of CMSIM. It probably isn't complete, so if I've forgotten anything let me know. Feel free to pass it along if this is still a problem for others. I compiled the UCD version of CMSIM by replacing the "src" and "cmdb" directories with those from UCD.

How I installed CERN version of CMSIM at UF

  1. copy tar files from /afs/cern.ch/cms/dist/
  2. Unpack everything
  3. I then have the following subdirectories :
  4. 2
    ./bin
    1
    ./bin/alpha_dux40
    343
    ./utils
    124
    ./utils/config
    4
    ./utils/config/CVS
    18
    ./setup
    20468
    ./cmsim/cms112/lib
    110
    ./cmsim/cms112/examples
    11610
    ./cmsim/cms112/src
    154308
    ./cmsim/cmdb
    There are many sub-subdirectories of the last few subdirectories
  5. Edit scripts
  6. ***************
       $CMS_PATH/utils/config/site.def
         - replace AFS config directory with local one:
    
    #define ConfigDir             /heeusers/acosta/cms/cmsim/utils/config
    /* DEA:
    #define ConfigDir             /afs/cern.ch/cms/utils/config
    */
    
    ***************
       $CMS_PATH/utils/config/osf1.def
         - add more compiler flags for DEC Alpha:
    
    < #define CMSExtraFortranFlags -align records -align dcommons -static \
    < -assume backslash -non_shared -taso -warn argument_checking \
    < -warn truncated_source -fpe2 -pad_source
    ---
    > #define CMSExtraFortranFlags -static -G 3 -pad_source
    
    
    Note: I asked Darin why he used these new compiler flags, and got this response:

    Those were compiler flags ZEUS uses for the Alpha platform. They seemed reasonable. for example, I didn't want shared libraries so that in the future I can run the executable under alpha linux. Also, I wanted more compiler time error messages, and I wanted to allow some floating point excpetions. However, it could very well be that some of these flags cause problems for CMSIM. I'm looking into it. But for any other platform, i.e. Sun, you may not need any additional flags. At least you should not blindly add any flags.

    The last sentence, about not blindly adding flags, is always good advice.

    ***************
       $CMS_PATH/utils/imakecp:
    
    9,10c9
    < # /afs/cern.ch/cms/utils/imakecp $DIR2ROOT/$i
    <  /heeusers/acosta/cms/cmsim/utils/imakecp $DIR2ROOT/$i
    ---
    >  /afs/cern.ch/cms/utils/imakecp $DIR2ROOT/$i
    
    ***************
       $CMS_PATH/utils/libbuild:
         - replace AFS directories with local ones:
    
    31,32c31
    < #set RULESDIR=/afs/cern.ch/cms/utils/config
    < set RULESDIR=/heeusers/acosta/cms/cmsim/utils/config
    ---
    > set RULESDIR=/afs/cern.ch/cms/utils/config
    145,146c144
    < #     /afs/cern.ch/cms/utils/imakecp $PWD
    <       /heeusers/acosta/cms/cmsim/utils/imakecp $PWD
    ---
    >       /afs/cern.ch/cms/utils/imakecp $PWD
    
    ***************
       $CMS_PATH/setup/cshrc
         - Put in local directories:
    
    setenv CMS_PATH /heeusers/acosta/cms/cmsim
    setenv CMS_SYS `$CMS_PATH/utils/fake-sys`
    setenv CERN /heeusers/acosta/cern/$CMS_SYS
    
    ***************
       $CMS_PATH/cmsim/cms112/examples/cmsim/cmsbuild
         - put in local directory, add any link flags:
    
    15,16c15
    < #set AFS = /afs/cern.ch
    < set AFS = /heeusers/acosta
    ---
    > set AFS = /afs/cern.ch
    18,20c17,18
    < set INC1 = $AFS/cms/cmsim/cmsim/$CMS_VER/src
    < #set INC2 = $AFS/asis/share/cern/pro/src
    < set INC2 = $AFS/cern/$CMS_SYS/pro/src
    ---
    > set INC1 = $AFS/cms/cmsim/$CMS_VER/src
    > set INC2 = $AFS/asis/share/cern/pro/src
    108,109c106
    < #                set ext = "-static -fpe4"
    <                 set ext = "-align records -align dcommons -static
    -assume backslash -non_shared -taso -fpe2 -pad_source -Wl,-taso -non_shared"
    ---
    >                 set ext = "-static -fpe4"
    136d132
    < echo "$F77 $FFLAGS $list -o $BUILDDIR/$CMS_VER${in}.exe "
    144d139
    < #-lgeant321 -ljetset -lpawlib -lgraflib -lgrafX11 -lX11 -ldnet_stub
    -lpacklib -lmathlib -lkernlib \
    
    ***************
    
  7. Add a few lines to my .cshrc file:
  8. setenv CMS_PATH /heeusers/acosta/cms/cmsim/
    source $CMS_PATH/setup/cshrc
    setenv CMS_BIN $CMS_PATH/cmsim/cms112/bin/$CMS_SYS
    
  9. Source this file: 'source .cshrc'
  10. Libraries can be built from the corresponding source directory:
  11.  cd cms/cmsim/cmsim/cms112/src/muon/
     libbuild -L $CMS_LIBS
    
  12. Executable can be built using 'cmsbuild' copied to the current directory

Comments from Benn Tannenbaum.....

Note: I found a bug in one of the scripts for the Sun version. As you un-tar the files, two directories created will be ..../sun4x_55/. However, the script $CMS_PATH/utils/fake-sys thinks the directory should be ..../sun4m_54/. The easiest way to fix that is to change the line

echo sun4m_54
to
echo sun4x_55
in the script $CMS_PATH/utils/fake-sys. The current distribution of CMSIM (v113/28 April) has this corrected.

Note: I had to make a few additional changes to get CMSIM to work. Some are because I used CMSIM 113 and Darin used CMSIM 112, some are because I have a Sun (and in Chris Williams' words, "You are suffering from a nasty case of non-standard C++ compiler as are most Suns").

  1. Sun reason: I had to change my c++ compiler to g++, since CC on my Sun just wasn't happy. To do that, I changed
    #define CccCmd CC
    to
    #define CccCmd g++
    in the file $CMS_PATH/utils/config/System.def.
  2. Sun reason: I had to change some of the header files for c++ to get the ECAL code to compile. I changed
    #define CMSCXXstl $(SRC)/stl/sgiimg
    to
    #define CMSCXXstl $(SRC)/stl/sgi2.03
    in the file $CMS_PATH/utils/config/sun.cf. I did that by trial and error-- you may need a different one.
  3. Sun reason: I kept CC as the compiler for cmsbuild, since g++ crashed and burned with the compiler options I had. I could have re-written the GNUmakefile to make it thing that I was a Alpha (since that platform uses g++ as the default compiler), but since CC worked for me.... I didn't want to break anything.
  4. I defined the following softlinks (using the command ln -s <from> <to>):
    dev -> cms113/
    new -> cms113/
    old -> cms112/
    pro -> cms113/
    in the directory $CMS_PATH/cmsim/. This can be done using the script $CMS_PATH/setup/setlevel but I did it by hand.
  5. I made these softlinks:
    cmdb -> ../cmdb/
    cmsim -> src/
    in the directory $CMS_PATH/cmsim/cms113/.
  6. last updated 1 May 1998 by Benn Tannenbaum (benn@physics.ucla.edu)