Strange behavior of graphic display with latest OS X

Hi Axel,

Thank you for your suggestions! But the problem — it does not show plots while I running the script (I want to see the plots before it finish running) — is still there.

Yi

Can you provide a small example ?

test.cpp (672 Bytes)
Here is a toy version of my code. Different behavior on Linux and on MacOS (I have test it).
When run it on Linux, remember to comment the “gStyle” line. (There is a difference on default Palette between Linux and MacOS).

I confirm your macro works as you want with the X11 version of ROOT on Mac but does not with the Cocoa version. So if you install the X11 version it should be fine for you.
Installing ROOT using X11 on Mac should be straight forward. I do it very on may machine. It should be as simple as Axel suggested.

Thank you Olivier,

But I’m still confused what to do. After I try Axel’s method I didn’t have what I expect.

you still get the error :

'X11/Xlib.h' file not found

?

Axel’s method is not x11 but cocoa, so instead of the command :

cmake /where/the/ROOT/sources/are && make -j4

I think I need to change it a little bit? (I mean if I want to build with x11)

Yes for this macro it is simpler for you to use the X11 version. As I said it works as you want with X11 but not with Cocoa. so your cmake command should be:

cmake  /where/the/ROOT/sources/are -Dcocoa=OFF -Dx11=ON

Trying it now, will see whether there are still problems and let you know. Thanks a lot!

Hi Olivier,

I really appreciate your help and patience, it works now! (The only small problem is that the plots are not as clear as before) Thank you very much!

Regrads,
Yi

Thanks Axel! Now I get what I expect! It’s very nice of you for helping me!

Regards,
Yi

Glad we solved it - but Olivier did most of the work!

Axel.

Good you solved your problem. Yes Cocoa backend is the native graphics on Mac and looks better seems to me. But note that Philippe (the original author of this thread) preferred the X11 backend… So it is really a matter of personal taste.
Cheers,
Olivier

There seems to be still something wrong. Today I notice that not all of my code works well and although I see the plot as I expected, I meet some warnings and errors as following:

Warning in TFile::Init: no StreamerInfo found in /usr/local/Cellar/root6/6.08.02/lib/root/libGQuartz_rdict.pcm therefore preventing schema evolution when reading this file.
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for TGCocoa.h
requested to autoload type TGCocoa
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for TGOSXGL.h
requested to autoload type TGOSXGLManager
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for TGQuartz.h
requested to autoload type TGQuartz
Warning in TFile::Init: no StreamerInfo found in /usr/local/Cellar/root6/6.08.02/lib/root/libGCocoa_rdict.pcm therefore preventing schema evolution when reading this file.
Error in TUnixSystem::Load: version mismatch, /usr/local/Cellar/root6/6.08.02/lib/root/libGCocoa.so = 60802, ROOT = 60806
Error in TInterpreter::TCling::AutoLoad: failure loading library libGCocoa.so for TGCocoa

The path

/usr/local/Cellar/root6/6.08.02/

is my old root location.

Do I need to set some environment variables? It seems when running the code, some parts still using the old root.
(I have done the command

. /root/bin/thisroot.sh

already)

Yes, in order to use root you should “source” the script thisroot.sh for the current shell

cd where/you/have/installed/root
source bin/thisroot.sh

You see I have done this. And then I met those warnings and errors.

it is not a script to be executed … you should “source” it … the exact command I sent you …

test.cpp (840 Bytes)

I add some flags in the code for debugging, and when I do:
root -l test.cpp
I get:

YideMacBook-Pro:root6_v6.08.06 yitao$ root -l test.cpp
root [0]
Processing test.cpp…
1
2
Warning in TFile::Init: no StreamerInfo found in /usr/local/Cellar/root6/6.08.02/lib/root/libGQuartz_rdict.pcm therefore preventing schema evolution when reading this file.
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for TGCocoa.h
requested to autoload type TGCocoa
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for TGOSXGL.h
requested to autoload type TGOSXGLManager
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for TGQuartz.h
requested to autoload type TGQuartz
Warning in TFile::Init: no StreamerInfo found in /usr/local/Cellar/root6/6.08.02/lib/root/libGCocoa_rdict.pcm therefore preventing schema evolution when reading this file.
Error in TUnixSystem::Load: version mismatch, /usr/local/Cellar/root6/6.08.02/lib/root/libGCocoa.so = 60802, ROOT = 60806
Error in TInterpreter::TCling::AutoLoad: failure loading library libGCocoa.so for TGCocoa
3
Press “A/a” to show next pixel, “Q/q” to quit.
a
Press “A/a” to show next pixel, “Q/q” to quit.

Which means the problem is due to this line (in the test.cpp file):
c = new TCanvas("c", "c", 400, 400);
But then I don’t know how to solve this…

Thanks Olivier!

Sorry for the typo in reply!
The one I type in terminal is
. ./root/bin/thisroot.sh
rather than
./root/bin/thisroot.sh

I think it’s the same thing as
source ./root/bin/thisroot.sh
Actually I also tried the “source” one, but showing the same problem.

(Sorry for my so many stupid questions.)

yes … it is the same.