# Building and running root on Mac OSX 10.8 (Mountain Lion)

**URL:** <https://root-forum.cern.ch/t/building-and-running-root-on-mac-osx-10-8-mountain-lion/15130>\
**Category:** ROOT\
**Created:** [October 23, 2012, 5:53pm UTC](https://root-forum.cern.ch/t/building-and-running-root-on-mac-osx-10-8-mountain-lion/15130 "2012-10-23T17:53:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![owen](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://root-forum.cern.ch/u/owen)\
**Post date:** [October 23, 2012, 5:53pm UTC](https://root-forum.cern.ch/t/building-and-running-root-on-mac-osx-10-8-mountain-lion/15130/1 "2012-10-23T17:53:48Z")

</div>

Hi All,

I upgraded my Mac to Mountain Lion not too long ago.  
I would like to build and use root 5.34/02 on it but  
I’m having trouble. The distribution builds after  
running config with this

./configure macosx --enable-roofit --disable-xrootd

with no errors as far as I can tell. I then set up  
the environment in my tcsh by doing

source bin/thisroot.csh

When I try to load and compile anything, I get tons  
of warnings and errors. Here’s a trivial piece of  
code for example in a file called roottest.c

# ================================= #include "TH1F.h" void roottest() { TH1F\* htest = new TH1F(“htest”,“test hist”, 10, 0., 10. ) ; htest-\>Draw() ; }

When I try to load it, this is what I get:

* * *

## root [0] .L roottest.c+ Info in TUnixSystem::ACLiC: creating shared library /Users/owen/work/cms/hadronic-susy-bjets/UserCode/SusyAnalysis/RA2b/Statistics/3Dcode/./roottest\_c.so Note: File “/root\_v5.34.02.source/root-bad2/lib/libThread.so” already loaded Note: File “/root\_v5.34.02.source/root-bad2/lib/libRIO.so” already loaded Note: File “/root\_v5.34.02.source/root-bad2/lib/libThread.so” already loaded Note: File “/root\_v5.34.02.source/root-bad2/lib/libMathCore.so” already loaded Note: File “/root\_v5.34.02.source/root-bad2/lib/libMathCore.so” already loaded Note: File “/root\_v5.34.02.source/root-bad2/lib/libMathCore.so” already loaded Note: File “/root\_v5.34.02.source/root-bad2/lib/libMathCore.so” already loaded Note: File “/root\_v5.34.02.source/root-bad2/lib/libMatrix.so” already loaded Note: File “/root\_v5.34.02.source/root-bad2/lib/libMathCore.so” already loaded Undefined symbols for architecture i386: “TH1F::TH1F(char const\*, char const\*, int, double, double)”, referenced from: roottest() in roottest\_c\_ACLiC\_dict.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) Error in : Compilation failed! root [1]

Needless to say, when I load something nontrivial I get many more "already loaded"  
warnings and undefined symbols for all of the root classes used in the code.  
It looks like something very basic in my setup is wrong, but I can’t find  
the problem. Any help would be appreciated. I’ve been running root on  
my macs for years with no trouble. I’m not a big fan of Mountain Lion.  
It was a downgrade in my opinion.

Here are some details of my setup, in case any of this is relevant.

I’m at CERN this week and next, so if there’s an expert here that  
can help by looking at the laptop, I’d be happy to set up a time  
and bring it to you, if that would be easier than exchanging emails.

Thanks,  
Owen

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Root distribution: root\_v5.34.02.source.tar

Hardware: MacBook Pro, 2.4 GHZ Intel Core i5

Operating system: OS X, Version 10.8.2

XQuartz 2.7.3 (xorg-server 1.12.4)

Xcode: Version 4.5.1 (4G1004)

clang -v  
Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn)  
Target: x86\_64-apple-darwin12.2.0  
Thread model: posix

uname -a  
Darwin [pb-d-128-141-230-236.cern.ch](http://pb-d-128-141-230-236.cern.ch) 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE\_X86\_64 x86\_64

Output of printenv in tcsh after sourcing bin/thisroot.csh

REMOTEHOST=  
TERM=xterm-color  
[HOST=pb-d-128-141-230-236.cern.ch](http://HOST=pb-d-128-141-230-236.cern.ch)  
SHELL=/bin/tcsh  
CLICOLOR=yes  
TMPDIR=/var/folders/nl/wf200gv16bvc97970ljy0scr0000gn/T/  
Apple\_PubSub\_Socket\_Render=/tmp/launch-l06yHr/Render  
[CVSROOT=:ext:owen@cmssw.cvs.cern.ch](mailto:CVSROOT=:ext:owen@cmssw.cvs.cern.ch):/local/reps/CMSSW  
SVN\_EDITOR=vim  
GROUP=staff  
USER=owen  
COMMAND\_MODE=unix2003  
HOSTTYPE=intel-mac  
SSH\_AUTH\_SOCK=/tmp/launch-yyxiqH/Listeners  
Apple\_Ubiquity\_Message=/tmp/launch-v7X7A8/Apple\_Ubiquity\_Message  
\_\_CF\_USER\_TEXT\_ENCODING=0x1F5:0:0  
LSCOLORS=ExGxFxdxCxDxDxhbadExEx  
PATH=/root\_v5.34.02.source/root/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin/:/usr/local/bin:/Users/owen/bin:/Users/owen/perl:/opt/local/bin:/usr/X11R6/bin:/Users/owen/work/cms/tdr-svn/utils/trunk:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/opt/X11/bin:/usr/texbin/:/usr/local/bin:/Users/owen/bin:/Users/owen/perl:/opt/local/bin:/usr/X11R6/bin:/Users/owen/work/cms/tdr-svn/utils/trunk:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/usr/texbin/:/usr/local/bin:/Users/owen/bin:/Users/owen/perl:/opt/local/bin:/usr/X11R6/bin:/Users/owen/work/cms/tdr-svn/utils/trunk:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin  
PWD=/root\_v5.34.02.source/root  
TEXINPUTS=/Users/owen/latex//:  
HOME=/Users/owen  
SHLVL=5  
OSTYPE=darwin  
VENDOR=apple  
MACHTYPE=x86\_64  
LOGNAME=owen  
CVS\_RSH=ssh  
DISPLAY=/tmp/launch-27QxhB/org.macosforge.xquartz:0  
X11\_PREFS\_DOMAIN=org.macosforge.xquartz.X11  
\_=/opt/X11/bin/xterm  
WINDOWID=18874381  
XTERM\_VERSION=XTerm(281)  
XTERM\_LOCALE=C  
XTERM\_SHELL=/bin/tcsh  
ROOTSYS=/root\_v5.34.02.source/root  
LD\_LIBRARY\_PATH=/root\_v5.34.02.source/root/lib  
DYLD\_LIBRARY\_PATH=/root\_v5.34.02.source/root/lib  
SHLIB\_PATH=/root\_v5.34.02.source/root/lib  
LIBPATH=/root\_v5.34.02.source/root/lib  
PYTHONPATH=/root\_v5.34.02.source/root/lib  
MANPATH=/root\_v5.34.02.source/root/man:/opt/local/share/man:/usr/share/man:/usr/local/share/man:/opt/X11/share/man:/usr/texbin//man:/usr/X11R6/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [October 23, 2012, 6:02pm UTC](https://root-forum.cern.ch/t/building-and-running-root-on-mac-osx-10-8-mountain-lion/15130/2 "2012-10-23T18:02:04Z")

</div>

The “macosx” architecture is a 32-bit one (“i686”). It seems to me that you need to configure and build your ROOT for the “macosx64” architecture, which is a 64-bit one (“x86\_64”).  
Note also, you may need to install your ROOT as the “root user” (i.e. a “superuser”), if you set the ROOT’s “prefix”:  
sudo make install  
See also (notice remarks about the ROOT’s “etcdir”):  
[url][ROOTSYS and linux distribution installation](https://root-forum.cern.ch/t/rootsys-and-linux-distribution-installation/14173/6)  
[url][Problems installing root with --prefix=$HOME/.local](https://root-forum.cern.ch/t/problems-installing-root-with-prefix-home-local/14683/4)  
[url][Release 5.32.03 on Ubuntu 12.04](https://root-forum.cern.ch/t/release-5-32-03-on-ubuntu-12-04/14368/2)  
BTW. Try to take the current “v5-34-00-patches” branch source code directly from the ROOT’s svn (it contains many fixes as compared to the frozen “v5-34-02” distribution).

---

<div class="post-metadata">

**Author:** ![owen](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://root-forum.cern.ch/u/owen)\
**Post date:** [October 23, 2012, 7:34pm UTC](https://root-forum.cern.ch/t/building-and-running-root-on-mac-osx-10-8-mountain-lion/15130/3 "2012-10-23T19:34:54Z")

</div>

[quote=“Wile E. Coyote”]The “macosx” architecture is a 32-bit one (“i686”). It seems to me that you need to configure and build your ROOT for the “macosx64” architecture, which is a 64-bit one (“x86\_64”).  
Note also, you may need to install your ROOT as the “root user” (i.e. a “superuser”), if you set the ROOT’s “prefix”:  
sudo make install  
See also (notice remarks about the ROOT’s “etcdir”):  
[url][ROOTSYS and linux distribution installation](https://root-forum.cern.ch/t/rootsys-and-linux-distribution-installation/14173/6)  
[url][Problems installing root with --prefix=$HOME/.local](https://root-forum.cern.ch/t/problems-installing-root-with-prefix-home-local/14683/4)  
[url][Release 5.32.03 on Ubuntu 12.04](https://root-forum.cern.ch/t/release-5-32-03-on-ubuntu-12-04/14368/2)  
BTW. Try to take the current “v5-34-00-patches” branch source code directly from the ROOT’s svn (it contains many fixes as compared to the frozen “v5-34-02” distribution).[/quote]

Thanks for the suggestions. I tried rebuilding with “macosx64” doing everything else the same and I get the same problems. I’m not using “prefix” or installing it anywhere after the build. I never have in the past. I point to the place where it was built by sourcing bin/thisroot.csh. Is that necessary now?

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [October 23, 2012, 7:44pm UTC](https://root-forum.cern.ch/t/building-and-running-root-on-mac-osx-10-8-mountain-lion/15130/4 "2012-10-23T19:44:09Z")

</div>

[quote=“owen”]I point to the place where it was built by sourcing bin/thisroot.csh. Is that necessary now?[/quote] What do you actually mean here? For me, “to build” means to run “make” (after the “configure” step). Once it is built, you do need to “source bin/thisroot.[c]sh” in the terminal window in which you want to use it. See the “Location independent installation” entry in the [“Installing ROOT from Source”](http://root.cern.ch/drupal/content/installing-root-source).  
BTW. The annoying “[libSomeRootLibrary.so](http://libSomeRootLibrary.so) already loaded” warnings were fixed several weeks ago in the the “trunk” and in the “v5-34-00-patches” branch.

---

<div class="post-metadata">

**Author:** ![owen](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://root-forum.cern.ch/u/owen)\
**Post date:** [October 23, 2012, 8:25pm UTC](https://root-forum.cern.ch/t/building-and-running-root-on-mac-osx-10-8-mountain-lion/15130/5 "2012-10-23T20:25:57Z")

</div>

[quote=“Wile E. Coyote”][quote=“owen”]I point to the place where it was built by sourcing bin/thisroot.csh. Is that necessary now?[/quote] What do you actually mean here? For me, “to build” means to run “make” (after the “configure” step). Once it is built, you do need to “source bin/thisroot.[c]sh” in the terminal window in which you want to use it. See the “Location independent installation” entry in the [“Installing ROOT from Source”](http://root.cern.ch/drupal/content/installing-root-source).  
BTW. The annoying “[libSomeRootLibrary.so](http://libSomeRootLibrary.so) already loaded” warnings were fixed several weeks ago in the the “trunk” and in the “v5-34-00-patches” branch.[/quote]

Yes, I was using “build” to mean executing make and “point to” to mean setting all the environment variables by sourcing thisroot.csh.

I think I found a solution to the problem. I tried doing everything from a directory in my user account (i.e. /Users/owen) instead of from the root directory of the filesystem (i.e. /). The normal procedure of configure, make, source thisroot.csh, use root now works when I do it that way.

For the record, the problem I was seeing has something to do with how I set up the directory where I unpacked the distribution tar file. In Mountain Lion, user accounts no longer have permission to write to / (even ones with administrator privileges) so I made a directory there (/root\_v5.34.02.source) and used sudo chown owen /root\_v5.34.02.source, unpacked the distribution source inside there, and then built it there so that my resulting ROOTSYS was /root\_v5.34.02.source/root. It seems that somehow fouled things up.

Thanks for the suggestions.

Owen
