Strange behavior of graphic display with latest OS X

Bonjour,
After updating my laptop system to the latest update (OS X 10.11.5) today, I’ve “lost” the XQuartz display … !
So I’ve decided to re-build root from scratch.
It worked without problems BUT I’m still “missing” the graphic display when I run a python script !!!

Here is the simplest example :

from ROOT import *
MYS = TFile("SIGN.root")
H_NbVert.Draw()

If the ultra-simple script above is called “plot.py”, then, when running it with : python -i plot.py ,
I should get the plot on a separate (XQuartz window) and then the python prompt.
Indeed, I get the python prompt BUT XQuartz is not launched and instead, a “Python” application icon appears in the Dock.

If now, I start python interactively and then type the 3 lines above one after the other :

  • after from ROOT import * , the “Python” application icon appears in the Dock
  • after H_NbVert.Draw() , the “Python” application icon is replaced by a Tree (ROOT ???) icon AND I get a graphic window with my plot !!!

Can someone tell me what to do ?
(I, of course, suspect something wrong with the graphic window assignment, but don’t know how to change this)
Thanks a lot in advance for your help !

– filip (Philippe Ghez LAPP-IN2P3-CNRS / LHCb)

Hi Philippe ,

The default graphics backend on mac is not XQuartz anymore. ROOT on mac uses Cocoa directly. If you want to install ROOT with XQuartz you should explicitly specify the options to do so. I guess in your case you did not specify an option activating XQuartz ? didn’t you ?

Can you try ti run the root you have and just Type “TCanvas C”, That should pop up a graphics window if ROOT works properly.

Cheers,
Olivier

Salut Olivier !!!
You’re right, I did not specify anything else than the macosx64 architecture.
I still see “strange behaviors” depending on which ROOT version and Python version I use.
Looks like ROOT 5.34 is bound to Python 2.6 and ROOT 6.04 is bound to Python 2.7.
(ROOT 5.34 is the one I rebuilt from source and ROOT 6.04 is from the .dmg binary installation)
In both cases I now get the “Tree” application icon and the graphic window.
And also there is still this IPython application automatically started which I don’t want …

But one thing is “missing” : I used to Ctrl-Click on histograms on the graphic window and this would make the histogram function panel appear (including for example : the Fit Panel button or the Rebin button). Very convenient. This does not work anymore with the Coca interface so I’d like to try to rebuild again with XQuartz for the graphic window. Just to see if it comes back as it was …

Can you tell me which option (and how) I should set when re-building ROOT from source ???

Merci d’avance !!!
– filip
PS : btw, I thought that posts I submit and answers I get from this forum would be automatically “transmitted” to my usual mailbox (ghez@lapp.in2p3.fr). Does not seem to be the case … Is there a setting somewhere to do this ?

Salut Philippe,

You will only get an email telling you somebody answered to your question but you have to come back to the forum.

I will check your python issue.

I di not know that… But I tried :slight_smile: sometimes you may have unknown functionality working. I tried with both 6 and 5.34 versions of ROOT using X11 on mac. That does pop up anything … Only the right click on the histogram shows a pop up menu .

if you use make the options are: -Dgviz=OFF -Dcocoa=OFF -Dx11=ON

if you use configure the options are: --disable-cocoa

We build ROOT with Python 2.7 so if you download a binary (5.34 or 6.04) preinstalled it will be with python 2.7.

Now, if you rebuilt ROOT (whatever version) locally, it will use the python you have locally … and it seems you have 2.6 locally …

Oliver,
merci de tes réponses rapides et complètes !!!

  • I’m not so sure it is the Ctrl_Click which triggers the histogram menu. I should have said that I have no mouse and use the Trackpad only. So my Ctrl_Click is in fact a Ctrl_Tap … :slight_smile:
    Anyway, maybe this “Ctrl_Tap” corresponds to your right click … If I can get ROOT back to what it was (environment = X11), I’ll try and tell you !

  • I will rebuilt root from scratch with the options you gave : THANKS !!!

  • Yes, my local python is 2.6 (2.6.9 actually). There is also a python 2.7 version in the “system” library frameworks but I suspect that it is “activated” according to the OS X version.

Thanks again for your kind help, Olivier !
Bonne journée,
– filip

Hi Philippe,

  • I am not sure about the CTRL “modifier”… Mac allows many changes in the pad setting. It could be that you set something on your MacBook. The histogram context menu is accessed by the "equivalent"of right click on the mouse. It could be that on your Macbook you set up CTRL-Tap as the equivalent of right-click…

  • Python and X11 are not linked. On your machine the default python (the visible one …) should be 2.6 . Therefore when you download a ROOT binary linked with 2.7 you have problem.

Bonne Journée !
Olivier

Olivier,

I just rebuilt ROOT following your instructions and it worked like a charm and now, XQuartz is taking care of the graphics (btw : much better than Cocoa).
I still do not understand why/how updating OS X to it’s most recent version (10.11.5) triggered this mess …
Anyway, I immediately tried the “ctrl” thing and I was wrong : when pointing the mouse on an histogram, when the icon has changed from a cross to an arrow, it is : Cmd_Tap which displays the histogram menu (as you said, probably “equivalent” to your right-click).

So : thanks again for your help ! (merci merci).
And if you know how to mark this topic with “SOLVED” : please do !!!

Bonne fin de journée à toi aussi,
– filip

Philippe,

Just a matter of taste :slight_smile: I prefer the Cocoa one …

I guess a new version of XQuartz was required. Also may be last time you install ROOT, X11 was still the default, now it is Cocoa.

Done :slight_smile:

Olivier

Hi Olivier,

It seems that I meet a similar problem as Philippe. I want to see the graphic display while running the ROOT script but my Mac does not show an expected behavior. The same script works well on Linux.
I am new in coding and computer issues, and I don’t know how to check whether my Mac use XQuartz or Cocoa. Besides, I install ROOT using homebrew rather than building or compiling it step by step , so could you please so kind to tell me how to rebuilt ROOT with a correct graphics backend (XQuartz or Cocoa)?
My MacOS version is 10.12.3.

Thanks in advance!

Yi

You can follow the instructions described here.
The cmake flags to enable X11 instead of Cocoa are : -Dcocoa=OFF -Dx11=ON

Thank you for your reply!
Do I need to uninstall or delete the original root which I am using now? And if so, what is the best way to uninstall it?

No you do not. You will just to point to the new one by running the thisroot.sh script in the install folder. (as shown in the page I sent you ).

Maybe I understand it wrongly but following is what I met:

YideMacBook-Pro:root6_build yitao$ cmake --build . -Dcocoa=OFF -Dx11=ON
Unknown argument -Dcocoa=OFF
Unknown argument -Dx11=ON
Usage: cmake --build [options] [-- [native-options]]
Options:

= Project binary directory to be built. --target = Build instead of default targets. May only be specified once. --config = For multi-configuration tools, choose . --clean-first = Build target 'clean' first, then build. (To clean only, use --target 'clean'.) --use-stderr = Ignored. Behavior is default in CMake >= 3.0. -- = Pass remaining options to the native tool.

Any advice? Thanks!

To configure you do not need the --build option. Just do:

cmake  . -Dcocoa=OFF -Dx11=ON

The once it is finish just type:

make 

Hi Olivier,

Thanks a lot! After I type “make”, it stops at 86% of the process and show an error:

[ 86%] Building C object graf3d/glew/CMakeFiles/GLEW.dir/src/glew.c.o
In file included from /Users/yitao/programs/root6_v6.08.06/root-6.08.06/graf3d/glew/src/glew.c:49:
/Users/yitao/programs/root6_v6.08.06/root6_build/include/GL/glxew.h:94:10: fatal error:

‘X11/Xlib.h’ file not found

make[2]: *** [graf3d/glew/CMakeFiles/GLEW.dir/src/glew.c.o] Error 1
make[1]: *** [graf3d/glew/CMakeFiles/GLEW.dir/all] Error 2
make: *** [all] Error 2

Do I need to download this header file? And where should I put it in?

It looks like X11 is not properly installed .
You should install XQuartz

Thanks Olivier,

After installing XQuartz from the link you send me, the x11 still cannot be found. By the way, when I install XQuartz, it skip the path-setting step automatically. I notice that after I type :

cmake . -Dcocoa=OFF -Dx11=ON

It shows several “disable” and “Could NOT find” as following:

YideMacBook-Pro:root6_build yitao$ cmake . -Dcocoa=OFF -Dx11=ON
– Found a Mac OS X System 10.12
– Found a 64bit system
– Found LLVM compiler collection
– ROOT Platform: macosx
– ROOT Architecture: macosx64
– Build Type: RelWithDebInfo
– Compiler Flags: -m64 -pipe -W -Wshadow -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -std=c++11 -O2 -g -DNDEBUG
– Looking for ZLib
– Building freetype version 2.6.1 included in ROOT itself
– Building pcre version 8.37 included in ROOT itself
– Building LZMA version 5.2.1 included in ROOT itself
– Looking for X11
– Could NOT find GIF (missing: GIF_LIBRARY GIF_INCLUDE_DIR)
– Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
– Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
– Building AfterImage library included in ROOT itself
– Looking for GSL
– Looking for Python
– Found Python interpreter version 2.7
– Looking for OpenGL
– Looking for Graphviz
– Looking for Bonjour
– Checking whether Bonjour/Avahi is supported
– Looking for Kerberos 5
– Looking for LibXml2
– Looking for MySQL
– Looking for PostgreSQL
– Looking for SQLite
– Looking for FFTW3
– Looking for XROOTD
– Looking for BLAS for optional parts of TMVA
– Enabled support for: asimage astiff bonjour builtin_afterimage builtin_ftgl builtin_freetype builtin_gl2ps builtin_glew builtin_pcre builtin_unuran builtin_lzma builtin_llvm cxx11 cling exceptions explicitlink fftw3 fortran gviz genvector krb5 ldap mathmore memstat mysql opengl pch pgsql python shared sqlite thread tmva vdt xft xml x11 xrootd
– Found libtool - /usr/bin/libtool
– Target triple: x86_64-apple-darwin16.4.0
– Native target architecture is X86
– Threads disabled.
– Doxygen disabled.
– Sphinx disabled.
– Go bindings disabled.
– Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
– Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
– OCaml bindings disabled.
– Building with -fPIC
– Constructing LLVMBuild project information
– Targeting X86
– Clang version: 3.9.0
– Cling version (from VERSION file): ROOT_0.4~dev
– Cling will look for C++ headers in ‘/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/include/c++/v1’ at runtime.
– And if not found, will invoke: ‘/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++’ for them.
– TMVA: Deactivate PyMVA because numpy is not found
– Configuring done
– Generating done
– Build files have been written to: /Users/yitao/programs/root6_v6.08.06/root6_build

Hi,

Why do you enable x11 to begin with? You are better off using cocoa. Simply remove your build directory, recreate it, cd there and type cmake /where/the/ROOT/sources/are && make -j4 and you are all set.

Axel