ROOT 5.34.18 on mac OSX 10.9.2 mavericks

Dear rooters,

I have tried a fresh installation of the current ROOT PRO version (5.34.18) on my mac (OSX 10.9.2) with XCode 5.1.

  1. Get the sources from here: ftp://root.cern.ch/root/root_v5.34.18.source.tar.gz

  2. Extract it to my local folder root installation: /Users/delaossa/local/root

  3. Configure it:

  1. Compile it:

Up to here everything went very well, but as soon as I open a root session I get the following errors:

[code] $> root


  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 5.34/18 14 March 2014 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      http://root.cern.ch            *
    
  •                                     *
    

ROOT 5.34/18 (heads/v5-34-00-patches@v5-34-17-156-g60f5d99, Apr 02 2014, 15:19:00 on macosx64)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
Error: cannot open file “iostream” (tmpfile):2:
*** Interpreter error recovered ***
Error: cannot open file “DllImport.h” (tmpfile):2:
*** Interpreter error recovered *** [/code]

It seems that ROOT cannot find these headers.
I defined manually the ROOT environment variables:

export ROOTSYS=/Users/delaossa/local/root export PATH=$ROOTSYS/bin:$PATH export DYLD_LIBRARY_PATH=$ROOTSYS/lib:$DYLD_LIBRARY_PATH

And it also fails when I try to make a plot:

[code]root [0] TF2 *f2 = new TF2(“f2”,“sin(x)sin(y)/(xy)”,0,5,0,5);
root [1] f2->Draw(“colz”)
Warning in TCanvas::ResizePad: c1 width changed from 0 to 10

Warning in TCanvas::ResizePad: c1 height changed from 0 to 10

Info in TCanvas::MakeDefCanvas: created default TCanvas with name c1
[/code]

Any ideas? The installation went OK, but ROOT is not usable.

Cheers,
Alberto

it works for me on Mavericks:

  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   5.34/18     14 March 2014   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

ROOT 5.34/18 (heads/v5-34-00-patches@v5-34-18-155-gf444e9f, Apr 02 2014, 16:25:27 on macosx64)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] TF2 *f2 = new TF2("f2","sin(x)*sin(y)/(x*y)",0,5,0,5);
root [1] f2->Draw("colz")
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
root [2] 

To set up the environment variable I go in the directory where ROOT is installed and I do:

. bin/thisroot.sh

The configuration script is not working for me:

[Behemoth] ~/local/root $> . bin/thisroot.sh [Behemoth] ~/local/root $> root dyld: Library not loaded: /Users/delaossa/local/root/lib/root/libCore.so Referenced from: /Users/delaossa/local/root/bin/root.exe Reason: image not found

Because it looks for libs in /Users/delaossa/local/root/lib/root instead of /Users/delaossa/local/root/lib

Also the output of root-config appends this root at the end of the right paths:

[Behemoth] ~/local/root $> root-config --cflags -pthread -stdlib=libc++ -m64 -I/Users/delaossa/local/root/include/root [Behemoth] ~/local/root $> root-config --libs -L/Users/delaossa/local/root/lib/root -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lpthread -stdlib=libc++ -lm -ldl

It is pretty clear that the paths are not properly defined and that is why I get the errors, but how can I fix it?

As I wrote in the previous post I configure root like this:

I do not why it looks for libraries and headers in the wrong folder…

Cheers!

OK, I found out something.

Basically there are two ways to configure root installation from source:

  1. By means of input flags for the ‘configure’ script, e.g. --prefix, --libdir, etc.
  2. By means of the environment ROOTSYS variable before the run of ‘configure’.

Option 1 is what is given me a lot of troubles. :confused:
It is easy to make a mistake with this option unless that you know very well what you are doing.
This is option is useful for some particular installations though, e.g. Homebrew.

Option 2 installs everything (libs, headers, configuration stuff) under the $ROOTSYS directory.
This has been the classic option since always in linux machines.
Now it turns out that it works very well in the mac too!

Instructions:

  1. Extract the source ROOT tree in the location you like. Mine: /Users/delaossa/local/root

  2. Set ROOTSYS to that location:

  1. Go there and just configure (no options):

[Behemoth] ~ $> cd $ROOTSYS [Behemoth] ~/local/root $> ./configure

  1. Make:
  1. Done:
   ============================================================
   ===                ROOT BUILD SUCCESSFUL.                ===
   === Run 'source bin/thisroot.[c]sh' before starting ROOT ===
   ============================================================
[Behemoth] ~/local/root $> . bin/thisroot.sh 
[Behemoth] ~/local/root $> root
root [0]  TF2 *f2 = new TF2("f2","sin(x)*sin(y)/(x*y)",0,5,0,5);
root [1] f2->Draw("colz")
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
root [2] .q

Great! Thanks!