MacOSX ROOT display issues

I’m having trouble getting ROOT-6 to work on Mac OS 10.10.5 (Yosemite). Specifically, graphics do not display. For example

TBrowser *b = new TBrowser()

executes without error messages but also without bringing up the TBrowser. I am able to at least create an error if I then do

b -> Draw() //inherited from TObject.

The complete stack trace is attached.

Things I’ve tried:
[ul]
[li]Install ROOT from source with cocoa enabled or with X11 enabled[/li]
[li]Reinstall xquartz, reboot[/li]
[li]Setting DISPLAY environment variable to “:0” as well as “localhost:0” (I am doing this locally, no ssh)[/li]
[li]Install ROOT 5/6 from Homebrew[/li]
[li]Install ROOT 6 from MacPorts[/li][/ul]

All of these attempts give the same result. If you want more info about my setup (pretty vanilla), just let me know. Thanks for you help!

Which root version is it ? 6/… ?

MacPorts is 6.04.03
Homebrew 6.04.02
From source is 6.05.02 (commit 04c1ad5d0e170bc34d5b025d8b7ab64aa922e924)

Thanks!

I am using that all the time on Mac OSx … it works fine for me.
What is you Xcode version ?
How do you build it ? cmake ? how ?

Yes, I use the CMake instructions from https://root.cern.ch/building-root

I have Xcode 7.0.1

c++ compiler is

Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.5.0
Thread model: posix

If you have your sources in src
And build is a directory next to src
It should be enough to do:

cd build
cmake …/src
make

I must have something messed up quite badly…

Mostly the same results, with a warning instead of a crash when I try and display a window:

I blew away Homebrew’s and MacPort’s versions of ROOT and blew away my old ROOT build directory. Then I followed your instructions. ROOT builds fine with no errors (I have learned to set CPLUS_INCLUDE_PATH to " "). Then:

benjaminfenker:root_build$ ./bin/root
   ----------------------------------------------------------------
  | Welcome to ROOT 6.05/03                    http://root.cern.ch |
  |                                   (c) 1995-2014, The ROOT Team |
  | Built for macosx64                                             |
  | From heads/master@v6-05-02-349-g04c1ad5, Oct 12 2015, 09:29:14 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'     |
   ----------------------------------------------------------------

Setting up // the only line in my rootlogon.C file
root [0] TBrowser *b = new TBrowser()
(TBrowser *) 0x7fad09e4ea30
root [1] b -> Draw()
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

So, now there is no error message, but still no window. Hopefully the warnings are helpful? Is there not a way to make things more verbose to get a better idea of what is failing?

Perhaps it is relevant that I do see the splash screen and have all along.

You should see the browser after creating it. No need for a draw. May be you have set it to batch mode in your rootlogon.C ?

Thanks for all your help, but no. I’ve commented out my entire rootlogon.C file except for a cout line to reassure myself that I’m editing the right one. :slight_smile:

When you do

root [0] TCanvas C;

you should immediately see a canvas popping up … if not it means you are in batch mode.
Can you try to start root with option -l:

$ root -l

can you also check the .rootrc file ?

All I get after starting with -l (or -n) is:

root[0] TCanvas C
Warning in <TCanvas::ResizePad>: c1 width changed from 0 to 10

Warning in <TCanvas::ResizePad>: c1 width changed from 0 to 10

(TCanvas &) Name: c1 Title c1
root[1] gROOT -> IsBatch()
(Bool_t) false

I haven’t edited my .rootrc file, but I’ve attached it anyways.

The most relevant bits seem to be:

# Settings for X11 behaviour.
X11.Sync:                no
X11.FindBestVisual:      yes
X11.UseXft:              no
X11.XInitThread:         yes

# Settings for Cocoa backend.
# The EnableAntiAliasing flag defines if you want to have anti-aliased
# lines/polygon in a canvas/pad. Possible values:
# yes (enable AA), no (disable AA) and auto (use AA only on Retina displays)
Cocoa.EnableAntiAliasing: yes

I am nearly convinced that this is an X11 issue because X11 (XQuartz) does not show up on my menu bar when I start ROOT or when I try and draw something. Getting desperate I tried ssh’ing to see if that worked and, even with ssh -Y, it reports that “X11 forwarding request failed on channel 0,” which I am not used to seeing. I really appreciate all your help.
rootrc.txt (32.4 KB)

that’s normal because by default we install the Cocoa backend on Mac … not X11

The master is now 6.05/03… can you try ?

Yea that is what I am on, I don’t know where I got the 6.05/02 number from.

 ----------------------------------------------------------------
  | Welcome to ROOT 6.05/03                    http://root.cern.ch |

Ok … that’s really weird in that case. I see you have Xcode 7.0.1 but Mac OS 10.10… Is that version of Xcode not for 10.11 ? … ( just a guess… I must admit i have no much ides of what can go wrong for you … )… I am on Mac with OS X 10.11, Xcode 7.0.1, ROOT 6.05/03 and all works fine.

That’s a good point, I updated my XCode recently but have been resisting upgrading the OS. It is worth a try, but I won’t be able to do it until this evening (I’m in the US).

That’s just a guess … That’s the only difference I see with what I have now …

How did you eventually solve this problem? I’m currently experiencing a similar problem a similar problem, no error message but nothing displaying, I’ve been trying some of the same things with no results.

Hello,

Is this problem solved? There is a problem using root 6 on mac and xcode version is 11.

Any help on this would be appreciated.

Thanks
Shilpi