RooFit does not work!

Recently i’ve installed the latest version of ROOT distribution (v6.04/08). The RooFit and TMVA libraries are included in the root directory, i tried to work with them but without success. For example here’s the error i get when i try to use the RooFIt library:

  | Welcome to ROOT 6.04/08       |
  |                               (c) 1995-2014, The ROOT Team |
  | Built for macosx64                                         |
  | From tag v6-04-08, 4 November 2015                         |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |

root [0] RooRealVar mes("mes","m_{ES} (GeV)",5.20,5.30) ;
ROOT_prompt_0:1:11: error: expected ';' after expression
RooRealVar mes("mes","m_{ES} (GeV)",5.20,5.30) ;
ROOT_prompt_0:1:12: error: use of undeclared identifier 'mes'
RooRealVar mes("mes","m_{ES} (GeV)",5.20,5.30) ;
root [1] using namespace RooFit;
ROOT_prompt_1:1:17: error: expected namespace name
using namespace RooFit;

can anyone help me ?
thanks a lot


this can be a faulty installation/setup.
How did you install ROOT?
Do you see the RooFit libraries in the $ROOTSYS/lib directory (libRooFit and libRooFitCore)?
Do you see the associated rootmaps (libRooFit.rootmap and libRooFitCore.rootmap)?


i’ve installed ROOT following these instructions:

prompt% ftp
User: anonymous
Password: ftp>
cd /root
ftp> bin
ftp> get root.v6.04/08.source.tar.gz
ftp> bye
prompt% gzip -dc root-.source.tar.gz | tar -xf -
cd root
./configure macosx

i have to admit that i’m not very practical with Root. I followed the instructions step by step and when i tried to type the root command it worked. But now i have no idea how to solve this problem…


you can refer to .
So to build root with roofit enabled:

mkdir rootBuild;cd rootBuild
cmake -Droofit=ON ../root
make -j 8

alternatively, since you use osx, you can download the binaries for that particular version:


So i have to reinstall the Root distribution following the rules listed in the web page you linked ?

Hi Giorgio,

two possibilities:

  1. You install a pre-packed binary version
  2. You start from sources, as you were doing, and use the code I posted in the block to configure and build ROOT.


Hi Danilo,
finally i managed to install ROOT with the RooFit and TMVA tools. I removed the distribution and reinstalled all after having added the CMake compiler to my terminal. I’ve followed your instructions step by step and nothing went wrong.
Thank you so much !