Missing Canvas

Hi

We installed Root 5.34 on a brand new Debian Wheezy 64-bit machine and compilation went well. Root is running and we are able to read and write Root files. However, the graphic display is not working when we try to pull up a tree browser or make canvases.

The command "TCanvas *c1 = new TCanvas(“c1”,“Root Canvas 1”) returns the warning:

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

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

No Canvas is drawn but no errors are given either. The splash screen appears on startup and we are not loading root in batch mode (“root -b”). Thanks for any suggestions …

The usual reason is the nonexistent / improper ROOT’s “etcdir” (search the forum for the word “etcdir”).

Hi!

“root-config --etcdir” returns /usr/local/root/etc. Should I rebuild again and set it to --etcdir=/usr/local/etc/root?

See if the “/usr/local/root/etc” subdirectory exists and, if yes, that it contains your ROOT version specific files (it may be that it contains files from another ROOT version).

The directory does exist and to my knowledge contains the correct ROOT version specific files. I don’t think it is possible for the files to be from another version since there was no previous installation beforehand and the dates of all the files listed match either the date of the version release (Mar 14) or the date of installation (May 15).

I think Debian provides its own ROOT version -> can it be that you have some Debian’s ROOT related packages installed?

Try something like (check the output and pay attention to all “absolute paths” reported):

echo ${ROOTSYS}

which root-config
type root-config
root-config --etcdir
root-config --prefix
root-config --exec-prefix
root-config --bindir
root-config --libdir

which root
type root
which root.exe
type root.exe
ldd root-config --bindir/root
ldd root-config --bindir/root.exe
ldd root-config --libdir/libCore.so
ldd root-config --libdir/libRint.so
ldd root-config --libdir/libCint.so

Here is the output for the commands you listed:

analysis@analysis-lenovo-520s:~$ echo $ROOTSYS
/usr/local/root
analysis@analysis-lenovo-520s:~$ which root-config
/usr/local/root/bin/root-config
analysis@analysis-lenovo-520s:~$ type root-config
root-config is /usr/local/root/bin/root-config
analysis@analysis-lenovo-520s:~$ root-config --etcdir
/usr/local/root/etc
analysis@analysis-lenovo-520s:~$ root-config --prefix
/usr/local/root
analysis@analysis-lenovo-520s:~$ root-config --exec-prefix
/usr/local/root
analysis@analysis-lenovo-520s:~$ root-config --bindir
/usr/local/root/bin
analysis@analysis-lenovo-520s:~$ root-config --libdir
/usr/local/root/lib
analysis@analysis-lenovo-520s:~$ which root
/usr/local/root/bin/root
analysis@analysis-lenovo-520s:~$ type root
root is aliased to `root -l’
analysis@analysis-lenovo-520s:~$ which root.exe
/usr/local/root/bin/root.exe
analysis@analysis-lenovo-520s:~$ type root.exe
root.exe is /usr/local/root/bin/root.exe
analysis@analysis-lenovo-520s:~$ ldd /usr/local/root/bin/root
linux-vdso.so.1 => (0x00007fff65bff000)
libXpm.so.4 => /usr/lib/x86_64-linux-gnu/libXpm.so.4 (0x00007f6c6ab9e000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f6c6a863000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6c6a55b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6c6a1d0000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f6c69fb0000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6c69dab000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6c69b29000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6c6adc6000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6c69913000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f6c6970f000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f6c6950a000)
analysis@analysis-lenovo-520s:~$ ldd /usr/local/root/bin/root.exe
linux-vdso.so.1 => (0x00007fff523ff000)
libCore.so.5.34 => /usr/local/root/lib/libCore.so.5.34 (0x00007f60d263f000)
libRint.so.5.34 => /usr/local/root/lib/libRint.so.5.34 (0x00007f60d240a000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f60d20ed000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f60d1ed7000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f60d1cbb000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f60d192f000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f60d1718000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f60d14db000)
libCint.so.5.34 => /usr/local/root/lib/libCint.so.5.34 (0x00007f60d0b58000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f60d0954000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f60d06d2000)
/lib64/ld-linux-x86-64.so.2 (0x00007f60d3020000)
analysis@analysis-lenovo-520s:~$ ldd /usr/local/root/lib/libCore.so
linux-vdso.so.1 => (0x00007fff95db8000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f6242f82000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f6242d45000)
libCint.so.5.34 => /usr/local/root/lib/libCint.so.5.34 (0x00007f62423c2000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f62421be000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6241eb7000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6241c34000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6241a1e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6241693000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6243b8f000)
analysis@analysis-lenovo-520s:~$ ldd /usr/local/root/lib/libRint.so
linux-vdso.so.1 => (0x00007fff75bdc000)
libCore.so.5.34 => /usr/local/root/lib/libCore.so.5.34 (0x00007f9dfb577000)
libCint.so.5.34 => /usr/local/root/lib/libCint.so.5.34 (0x00007f9dfabf5000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9dfa8d8000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9dfa6c2000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9dfa337000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9dfa11f000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f9df9ee2000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9df9cde000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9df9a5b000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9dfc18d000)
analysis@analysis-lenovo-520s:~$ ldd /usr/local/root/lib/libCint.so
linux-vdso.so.1 => (0x00007fffbefa3000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f79981dc000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7997ed5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7997c52000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7997a3c000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f79976b1000)
/lib64/ld-linux-x86-64.so.2 (0x00007f7998d79000)

I see nothing wrong in your output.

Can it be that you have “${HOME}/.rootrc” and/or “./.rootrc” and/or “rootlogon.C”? Try to run “root -n” and see if you still get the TCanvas problem.

I’m afraid, for the moment I have no further idea, sorry.

Try to post the output of:
root-config --version
root-config --arch
root-config --platform
root-config --features
root-config --config

I do have ~/.rootrc and rootlogon.C is under customize_root/ and .rootrc knows where to find it. When I run “root -n” I get an error involving TVirtualStreamerInfo:

Fatal in TVirtualStreamerInfo::Factory: Cannot find the plugin handler for TVirtualStreamerInfo! However $ROOTSYS/etc/plugins/TVirtualStreamerInfo is accessible, Check the content of this directory!

with a bunch of “Generating Stack Trace…” code afterwards and then the ROOT command line.
I previously put a line in rootlogon.C that took care of this error but the “-n” seems to be ignoring it.

The output you requested is here:

analysis@analysis-lenovo-520s:~/analysis-10023/n2analysis$ root-config --version
5.34/18
analysis@analysis-lenovo-520s:~/analysis-10023/n2analysis$ root-config --arch
linuxx8664gcc
analysis@analysis-lenovo-520s:~/analysis-10023/n2analysis$ root-config --platform
linux
analysis@analysis-lenovo-520s:~/analysis-10023/n2analysis$ root-config --features
asimage astiff builtin_afterimage builtin_lzma cintex explicitlink fftw3 fitsio gviz genvector krb5 ldap mathmore memstat mysql opengl python reflex shadowpw shared soversion ssl tmva vdt x11 xft xml thread
analysis@analysis-lenovo-520s:~/analysis-10023/n2analysis$ root-config --config
–enable-soversion

Sorry, I just realized I didn’t fully answer your initial question. After loading “root -n” I get no errors, just the Root command line, and still have the TCanvas problem. If I try “root -n” with a call to load in a data file I get the TVirtualStreamerInfo error I described before and it exits ROOT automatically.

It seems to me that you’ve got something in your “.rootrc” and/or “rootlogon.C” which creates problems.
Actually, “root -n” should disable the execution of logon and logoff macros, but just to make sure … remove (rename) your “${HOME}/.rootc”, then “cd” to any subdirectory in which there are NO “./.rootrc” nor “./rootlogon.C” and then try to run “root” (you should get NO errors).

One more thing … how exactly did you build and install your ROOT (I mean all command lines that you used)?

Try to run (there should be just one shared library and one rootmap …):
locate libCore

I’ve found an old thread with a similar problem: X11 problem

I renamed both ~/.rootrc and customize_root/rootlogon.C and ran root and got NO errors just like you said :slight_smile: I was even able to get a TBrowser up! :smiley: It wasn’t able to pull in the libraries to run a data file however, which I am assuming is controlled by /.rootrc and therefore makes sense.

To build and install ROOT I followed the instructions on root.cern.ch/drupal/content/inst … oot-source for Fixed Location Installation. I made sure I had all the prerequisite packages installed beforehand and used:

./configure --prefix=/usr/local --enable-soversion --enable-shared --enable-opengl --with-gsl-incdir=/usr/include
–with-gsl-libdir=/usr/lib
make
sudo /sbin/make install
ldconfig

I think I see a problem … when you set “–prefix=/usr/local” and you do not set “–etcdir” then your ROOT related executables should be in “/usr/local/bin” and your ROOT’s “etcdir” should be “/etc/root”. How come you’ve got “root[.exe]” in “/usr/local/root/bin” and your ROOT’s “etcdir” is “/usr/local/root/etc”?

You should use something like “–prefix=/usr/local/root --etcdir=/usr/local/root/etc” or “–prefix=/usr/local --etcdir=/usr/local/etc/root” (but putting ROOT in “/usr/local/[bin|lib]” is not really a good idea).
And of course, the “destination” subdirectories must not be the same as the ones in which you build ROOT.

Also, before running “configure”, make sure that you:
unset ROOTSYS

I’m not exactly sure about the filepath differences except that maybe when we ran make install it put the files in the right places? The files are located in both filepaths…

We went through our ~/.rootrc file and realized we were using a file meant for a previous distribution of ROOT that was archived on a CVS that we use for our research group to integrate ROOT with our local libraries. We replaced it with the system.rootrc in /etc/root/ and added our local library references and now it works! :smiley:

We may be back in touch with you but thank you so so so much for your help!!

If you have similar ROOT related files in both places (e.g. “/etc/root” and “/usr/local/root/etc”, “/usr/local/bin” and “/usr/local/root/bin”, “/usr/local/lib” and “/usr/local/root/lib”), that means that you have two separate independent ROOT installations. You’d better get rid of one of them, especially the one that resides in “/usr/local/[bin|lib]”.

Oh dear…

Can you clarify: do you mean the ROOT executables should not be in /usr/local/(bin or lib), or that the ROOT distribution directories shouldn’t be there?

I went into both file paths and I can run ./root just fine in both. Can you tell if it will be a big problem later on if I don’t remove one of them?

I’m thinking it might be better if I just completely remove ROOT altogether and rebuild from scratch the right way. What would be the best way to uninstall ROOT?

Honestly speaking, sooner or later, you will learn by hard that the policy of using a “system-provided” ROOT version (e.g. in “/usr/[bin|lib]” or “/usr/local/[bin|lib]”) is a dead end.
You will learn that you need something like three different versions of ROOT - just because something that works with a particular ROOT version is not working with another ones, or because some piece of your additional, experiment / analysis specific, software explicitly requires a particular ROOT version.
The safest approach is to “completely remove” (“purge”) all “system-provided” ROOT related packages (this includes any “official” packages that originate from your operating system’s repositories as well as any version that you yourself built) and install all needed versions of ROOT from scratch, each version in a different “version specific” ROOTSYS subdirectory (e.g. something like “/opt/ROOT/v5-32-04”, “/opt/ROOT/v5-34-18”, “/opt/ROOT/v5-34-00-patches” and so on).

I always install ROOT 5 using the ROOTSYS based method described in this old post.
The ROOTSYS based method is almost the same as the official “Location independent installation” method (do remember to “unset ROOTSYS” before running configure and make, if you want to use the official method) but the “ROOTSYS=/Where/You/Want/To/Install/root” subdirectory must be different from the “/Where/You/Unpacked/The/Source/Code/Of/root” subdirectory (i.e. in which you will build ROOT 5).
You can also easily build ROOT 5 “in-place” (with “unset ROOTSYS”).
If you prefer to use the “--prefix” method (i.e. the official “Fixed location installation” method), do always remember to add an appropriate “--etcdir” (no need to do it for ROOT 6) and do remember to “unset ROOTSYS” before running configure and make.
Note that the “--prefix” method produces a different “installation” / “binary distribution” subdirectory structure than the ROOTSYS based method and I have had problems with ROOT’s tutorials (and tests?) when using the “--prefix” method which never appeared when using the ROOTSYS based method (and that’s why I always advertise the ROOTSYS based method).

Building ROOT 6 requires the usage of the new CMake based building method.

Before trying to build ROOT, see the “Build Prerequisites” web page.
In any case, when you are building a new ROOT version, make always sure that nothing in your environment variables (i.e. “ROOTSYS”, “PATH”, “LD_LIBRARY_PATH”) points to another existing version of ROOT (and that’s another good reason why there should be no ROOT related files in “standard” system locations, like “/usr/[bin|lib]” or “/usr/local/[bin|lib]”), otherwise you may end up with a broken build. If you are re-building a particular version, remove the old “installation” / “binary distribution” subdirectory structure before configuring it again (and if you want to re-configure it, make sure that you started with a “fresh” source code, so that there are no remnants from previous builds, for example run “make distclean” or maybe better “make maintainer-clean” before configuring it again).

BTW. See also: Sourcing root for all users

P.S. In order to get rid of “undesired” ROOT versions, if you did “make install”, with ROOT 5 just “make uninstall”, while with ROOT 6, from the build subdirectory, you will need to execute something like “xargs rm < install_manifest.txt”. If it comes from your operating system’s repositories, just “completely remove” / “purge” (i.e. “remove with any associated configuration files”) all ROOT related packages. For example, on Ubuntu 14.04, execute “sudo apt-get purge root-system* root-plugin* libroot*” (afterwards check that the “/usr/lib/i386-linux-gnu/root5.34” and the “/usr/lib/x86_64-linux-gnu/root5.34” subdirectories disappeared completely).

3 Likes

Ok, thank you so much! That’s really good to know. It’s unfortunate that I didn’t know about the old-fashioned method that you described before I went about doing this. I wonder if it’s posted somewhere and I just missed it somehow? Anyways, thank you so much for all your help! :slight_smile:

Great post, Wile!

Axel.