ROOT

From DaqWiki
Jump to navigation Jump to search

Links

CERN instructions for building ROOT

Example session:

cd $HOME/packages
git clone http://ladd00.triumf.ca/~daqweb/git/root.git
cd root
git tag -l # <--- select desired branch. chose latest even tag vN-AA-BB (i.e. v5-34-32 or v6-04-00), N=5 or 6, AA latest even number, BB biggest number
git checkout -b v6-04-00 v6-04-00 # <---- use chosen tag
git status
###../configure.sh
#### ./configure --enable-xml --enable-roofit --enable-minuit2 --enable-mysql --enable-pgsql --enable-rpath --enable-xrootd --enable-http --enable-gdml --enable-unuran --enable-table --enable-ssl
###make -j6 -k
###make
cmake3 -Dall=ON -Dhttp=ON -Dminuit2=ON -Droofit=ON -Dtable=ON -Dunuran=ON ../root_v6.10.04.source/
cmake3 --build . -- -j6

Then test:

$ echo $SHELL
/bin/bash
$ . ./bin/thisroot.sh 
$ echo $ROOTSYS
/Users/olchansk/git/root
$ echo $PATH
/Users/olchansk/git/root/bin:/opt/local/bin:/opt/local/sbin:.:/Users/olchansk/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/opt/local/bin:/opt/local/sbin:.:/Users/olchansk/bin
$ root-config
Usage: root-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--auxcflags] [--ldflags] [--new] [--nonew] [--libs] [--glibs] [--evelibs] [--bindir] [--libdir] [--incdir] [--etcdir] [--noauxcflags] [--noauxlibs] [--noldflags] [--has-<feature>] [--arch] [--platform] [--config] [--features] [--ncpu] [--git-revision] [--python-version] [--cc] [--cxx] [--f77] [--ld ] [--help]
$ root-config --cflags
-pthread -stdlib=libc++ -std=c++11 -m64 -I/Users/olchansk/git/root/include

Build ROOT from GIT repository

  • cd $HOME/packages
  • git clone http://root.cern.ch/git/root.git ### will create subdirectory "root"
  • cd $HOME/packages/root
  • git pull ### update the repository
  • git branch -a ### show all available ROOT major release versions
  • git tag -l ### show all available point releases

(the rest is untested)

  • git checkout master ### switch to the main development tree
  • git checkout v5-34-00-patches ### switch to the v5-34-xx release stream
  • ./configure
  • make -j3 -k
  • make
  • make install

README

README file for ROOT users at TRIUMF

ROOT is the TRIUMF standard package for data visualization and analysis.

ROOT is an open-source project (LGPL) based at CERN and all ROOT users are encouraged to visit http://root.cern.ch for ROOT documentation, tutorials, examples and support (via ROOT forums and mailing lists).

The TRIUMF Data Acquisition Group provides limited support for ROOT as it is used in conjunction with data acquisition activities, the MIDAS data acquisition system, the ROOTANA package for analysing MIDAS data using ROOT and the ROODY graphical online histogram display tool.

ROOT binary kits used and supported by TRIUMF DAQ are located at /daq/daqshare/olchansk/root and all TRIUMF users are welcome to use them. If /daq/daqshare is not available via NIS/autofs. mount it manually by "mount -o ro daqshare:/public /foobarbaz"

The locally built binary kits have these differences from ROOT binary kits available from CERN:

  • compiled with "-O2 -g" to ease debugging of user applications, especially when they crash inside the ROOT libraries. ROOT sources are directly accessible to debugger programs and one can single-step through the ROOT libraries.
  • compiled with CERNLIB support
  • compiled with DCACHE support
  • compiled with XML support
  • compiled with ROOFIT support
  • build the static library libroot.a
  • build the extra libraries to enable use of STL in CINT.
  • build ROOT with the "-rpath" option to avoid difficulties with inconsistent user LD_LIBRARY_PATH settings.

To use the locally built ROOT do this:

  • run "ls -l /daq/daqshare/olchansk/root" to see the available versions
  • run "/daq/daqshare/olchansk/root/root_VVV_AAA/bin/thisroot.sh" (or .csh), where VVV is the desired version of ROOT and AAA is the desired computer architecture. For example, do ". /daq/daqshare/olchansk/root/root_v5.34.32_SL66_64/bin/thisroot.sh
  • if you do not want to use the network copy on trshare/daqshare, do copy the desired ROOT binary kit to your own disk (use "rsync -av" or "cp -rpv"), and run the local copy of "thisroot"

ROOT on MacOS

  • download the 64-bin GCC ROOT binary kit from root.cern.ch
  • unpack, rename
  • setup ROOTSYS & co
  • (required for ROODY) if will use libHbook and minicern, install gfortran runtime libraries:
    • download gfortran-lion.tar.gz from http://hpc.sourceforge.net
    • unpack
    • copy required libraries into /usr/local/lib:
    • sudo /bin/cp -pv usr/local/lib/libgfortran.3.dylib /usr/local/lib/
    • sudo /bin/cp -pv usr/local/lib/libquadmath.0.dylib /usr/local/lib/