Can't intall root on macos 10.12.2

I can not seem to install root on macOS 10.12.2 at all. I attempted to install via homebrew with

brew install root6

I then added

pushd $(brew --prefix root6) >/dev/null; . libexec/; popd >/dev/null

to my .zshrc file for configuration. I can successfully run the root command; however, I am primarily trying to use the root libraries (specifically TMVA).

I tried compiling a new c file with make.

The following, for example, failed:

#include "TTree.">
so I instead tried #include "/usr/local/Cellar/root6/6.08.02/include/root/TTree.h"

However, upon using g++ -std=c++11 to compile said import, I get:

In file included from test.cpp:3: In file included from /usr/local/Cellar/root6/6.08.02/include/root/TTree.h:30: In file included from /usr/local/Cellar/root6/6.08.02/include/root/TBranch.h:28: In file included from /usr/local/Cellar/root6/6.08.02/include/root/TNamed.h:29: /usr/local/Cellar/root6/6.08.02/include/root/TString.h:41:10: error: 'RStringView.h' file not found with <angled> include; use "quotes" instead #include <RStringView.h>

I then tried pulling from the root git repository, cd root, and then running make. This failed because I didn’t have something called lxml.

Note that I can also not import ROOT using python, as I get a no module named root error. Can someone please help me properly install this library from the beginning? I am unable to find any decent resources that work at all and need to use root for a tight deadline.


Please pass root-config --cflags to the compiler invocation, and #include <TTree.h>. I don’t know what #import is. (Well I know of one but that’s not generally available yet :slight_smile:


Hi alex. Oh alright. (and sorry about the earlier typo)

How do I enale x11 on OSX instead of cocoa? I get a ld: symbol(s) not found for architecture x86_64


You shouldn’t enable x11 on MacOS (unless you really know that you absolutely need it). The default (Cocoa) should work just fine.


Don’t know why I didnt think I was missing c flags.

Using g++ `root-config --cflags` the.cpp `root-config --glibs` works successfully.