Slow startup revisited

Hi Axel,

Here it is:

[lgemedia@zabriskie last-34]$ export EXTRA_CLING_ARGS=' -v'

[lgemedia@zabriskie last-34]$ printenv | grep -i extra
EXTRA_CLING_ARGS= -v

[lgemedia@zabriskie last-34]$ root.exe
cling version ROOT_1.0~dev
Looking for C++ headers with:
  LC_ALL=C ccache   -xc++ -E -v /dev/null 2>&1 | sed -n -e '/^.include/,${' -e '/^ \/.*++/p' -e '}'
Looking for C++ headers in "/usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11:/usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/x86_64-redhat-linux:/usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/backward"
Found:
 /usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11
 /usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/x86_64-redhat-linux
 /usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/backward
clang version 9.0.1 
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: 
Found candidate GCC installation: /../lib/gcc/x86_64-redhat-linux/11
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/11
Selected GCC installation: /../lib/gcc/x86_64-redhat-linux/11
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /data2/root_install/etc
 /data2/root_install/etc//cling
 /data2/root_install/etc//cling/plugins/include
 /data2/root_install/include
 /usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11
 /usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/x86_64-redhat-linux
 /usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/backward
 /usr/local/include
 /data2/root_install/etc//cling/lib/clang/9.0.1/include
 /usr/include
End of search list.
'/usr/include/module.modulemap' does not exist. Mounting '/data2/root_install/etc/cling/libc.modulemap' as '/usr/include/module.modulemap'
'/usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/module.modulemap' does not exist. Mounting '/data2/root_install/etc/cling/std.modulemap' as '/usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/module.modulemap'
modulemap.overlay.yaml
{
 'version': 0,
 'roots': [
{ 'name': '/usr/include', 'type': 'directory',
'contents': [
   { 'name': 'libc.modulemap', 'type': 'file',
  'external-contents': '/data2/root_install/etc/cling/libc.modulemap'
}
 ]
 },
{ 'name': '/usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11', 'type': 'directory',
'contents': [
   { 'name': 'std.modulemap', 'type': 'file',
  'external-contents': '/data2/root_install/etc/cling/std.modulemap'
}
 ]
 }]
 }
 ]
 }
Adding runtime include paths:
  ""
Added include paths:
Added include paths:
  /data2/root_install/include
Setting up system headers with clang:
ignoring nonexistent directory "/include"
ignoring duplicate directory "/data2/root_install/include"
#include "..." search starts here:
#include <...> search starts here:
 /data2/root_install/etc
 /data2/root_install/etc//cling
 /data2/root_install/etc//cling/plugins/include
 /data2/root_install/include
 /usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11
 /usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/x86_64-redhat-linux
 /usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/backward
 /usr/local/include
 /data2/root_install/etc//cling/lib/clang/9.0.1/include
 /usr/include
End of search list.
#include "cling/Interpreter/RuntimeUniverse.h"
namespace cling { class Interpreter; namespace runtime { Interpreter* gCling=(Interpreter*)0x1c397e0;
RuntimeOptions* gClingOpts=(RuntimeOptions*)0x1c3995c;}}
extern "C" int __cxa_atexit(void (*f)(void*), void*, void*)  noexcept;
#define __dso_handle ((void*)0x1c397e0)
extern "C" int atexit(void(*f)())  throw ()  { return __cxa_atexit((void(*)(void*))f, 0, __dso_handle); }
extern "C++" int at_quick_exit(void(*f)())  throw ()  { return __cxa_atexit((void(*)(void*))f, 0, __dso_handle); }
   ------------------------------------------------------------------
  | Welcome to ROOT 6.26/06                        https://root.cern |
  | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Jul 29 2022, 16:42:00                 |
  | From heads/latest-stable@274b476a                                |
  | With c++ (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2)                |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |
   ------------------------------------------------------------------

root [0] 

Best,
Luiz


ROOT Version: 6.26.04
Platform: Fedora 35
Compiler: gcc version 11.3.1 20220421 (Red Hat 11.3.1-3) (GCC)


Hi Luiz,

thank you for your reply, I had messed up the re-opening of the old post (Slow startup - #18 by OtaviusDecius), you should be able to reply there now. In any case, @Axel fyi.

OK so this is what sometimes takes ages:

That’s missing the compiler’s name (where all those spaces are)… I am traveling now but I will need to find out why cling doesn’t state any compiler here.

Do you have the file ./interpreter/cling/lib/Interpreter/cling-compiledata.h? If so, could you attach it? (it’s only there in a build directory I believe).

Hi Axel,

cd /data2/root_build/interpreter/cling/lib/Interpreter

[lgemedia@zabriskie Interpreter]$ more cling-compiledata.h

#define CLING_CXX_INCL “/usr/lib/gcc/x86_64-redhat-linux/11/…/…/…/…/include/c++/11:/usr/lib/gcc/x86_64-redhat-linux/11/…/…/…/
…/include/c++/11/x86_64-redhat-linux:/usr/lib/gcc/x86_64-redhat-linux/11/…/…/…/…/include/c++/11/backward”
#define CLING_INCLUDE_PATHS “”

#define CLING_CXX_RLTV "ccache "

By the way, my other computer that starts up Root fast shows:

LC_ALL=C c++ -xc++ -E -v /dev/null 2>&1 | sed -n -e ‘/^.include/,${’ -e ‘/^ /.*++/p’ -e ‘}’

Thanks
Luiz

Here is my CMakeCache.txt in the attachment.

CMakeCache.txt (145.9 KB)

The other computer (DELL) shows:

[lgemedia@yeager Interpreter]$ more cling-compiledata.h

#define CLING_CXX_INCL "/usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11:/usr/lib/gcc/x86_64-redhat-linux/

11/…/…/…/…/include/c++/11/x86_64-redhat-linux:/usr/lib/gcc/x86_64-redhat-linux/11/…/…/…/…/include/c++/11/backward"
#define CLING_INCLUDE_PATHS “”

  #define CLING_CXX_RLTV "c++  "

So things work well with c++ but not so with ccache… We use ccache for out CI, too - I’ll find out what its CLING_CXX_RLTV + verbose output says. I’ll be back!

1 Like

OK back with good news: we use ccache but our ./interpreter/cling/lib/Interpreter/cling-compiledata.h says

      #define CLING_CXX_RLTV "x86_64-linux-gnu-g++-9  "

How do you tell cmake to use ccache? The way we do it is through the cmake flag -Dccache=On - that allows us to understand what’s happening, without “hiding” the compiler.

Recompiling with -Dccache=on works!

cmake -Dccache=On -DCMAKE_INSTALL_PREFIX=…/root_install …/root_src

Root starts very fast now:

[lgemedia@zabriskie ~]$ time root.exe -b -n -q; time root.exe -l -n -q-q
   ------------------------------------------------------------------
  | Welcome to ROOT 6.26/06                        https://root.cern |
  | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Nov 02 2022, 10:03:00                 |
  | From heads/latest-stable@274b476a                                |
  | With c++ (GCC) 11.3.1 20220421 (Red Hat 11.3.1-3)                |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |
   ------------------------------------------------------------------

real	0m2.025s
user	0m0.790s
sys	0m1.195s
root: unrecognized option '-q-q'
Try 'root --help' for more information.

real	0m1.900s
user	0m0.723s
sys	0m1.139s

My cling-compiledata.h continues showing the ccache:

[lgemedia@zabriskie Interpreter]$ more cling-compiledata.h

    #define CLING_CXX_INCL "/usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11:/usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/x86_64-redhat-linux:/usr/
lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/backward"
    #define CLING_INCLUDE_PATHS ""
  
      #define CLING_CXX_RLTV "ccache  "

Thanks and cheers,
Luiz

Correcting:

time root.exe -b -n -q; time root.exe -l -n -q
   ------------------------------------------------------------------
  | Welcome to ROOT 6.26/06                        https://root.cern |
  | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Nov 02 2022, 10:03:00                 |
  | From heads/latest-stable@274b476a                                |
  | With c++ (GCC) 11.3.1 20220421 (Red Hat 11.3.1-3)                |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |
   ------------------------------------------------------------------

real	0m1.861s
user	0m0.649s
sys	0m1.156s

real	0m1.852s
user	0m0.670s
sys	0m1.123s

Good - but cling-compiledata.h should really be fixed. Removing it and rebuilding should work…

Ok, but after removing it I should use the regular cmake build command with no -Dccache=On, correct?

Indeed - removing it just triggers CMake to recreate it - and this time hopefully correctly so. You might have to still override earlier settings, with -DCMAKE_CXX_COMPILER=$(which g++) -DCMAKE_C_COMPILER=$(which gcc) - check your cling-compiledata.h and CMakeCache.txt, please.

Hi Axel,

I guess I have a problem with gcc or g++ installation:

[lgemedia@zabriskie Interpreter]$ which gcc

/usr/lib64/ccache/gcc

[lgemedia@zabriskie Interpreter]$ which g++

/usr/lib64/ccache/g++

Removing the build and install directories and issuing the command:

cmake -DCMAKE_CXX_COMPILER=(which g++) -DCMAKE_C_COMPILER=(which gcc) -DCMAKE_INSTALL_PREFIX=…/root_install …/root_src

I am still getting:
[lgemedia@zabriskie Interpreter]$ more cling-compiledata.h

#define CLING_CXX_INCL “/usr/lib/gcc/x86_64-redhat-linux/11/…/…/…/…/include/c++/11:/usr/lib/gcc/x86_64-redhat-linux/11/…/…/…/
…/include/c++/11/x86_64-redhat-linux:/usr/lib/gcc/x86_64-redhat-linux/11/…/…/…/…/include/c++/11/backward”
#define CLING_INCLUDE_PATHS “”

#define CLING_CXX_RLTV "ccache "

Luiz

It turns out that removing the package ccache.x86_64 (C/C++ compiler cache) fixed better the problem.

Thanks
Luiz

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.