Is ROOT slower if built with -DCMAKE_BUILD_TYPE="Debug"?

Hello everyone,

Sorry for creating another topic. Question from the title. Will ROOT be slower if I compile it from source with the Debug option, compared to the precompiled binary that I can find on the website? If yes, is there a way to let both coexist and run one or the other selectively (I would run the one with the Debug option if I need to inspect TObjects while debugging, and the default one otherwise)?

When you compile a program in debug mode it is always slower that an optimized version. You can install/compile a debug version (from source) and switch form a version to an other using:

source where_ROOT_is_installed/bin/

Okay, thank you. My concern was that sourcing wouldn’t be enough if two versions are there.

My other concern is whether I can source while another istance of ROOT is already running. For example I run

$ source root-6.18.04/bin/
$ root -l some-very-long-macro.cpp

and while this runs I’m developing something else and my IDE calls

$ source root-debugversion/bin/
$ root -l macro-developing.cpp

Will this be okay or will it have some bad consequences?

Hi @renyhp,
mainly what does it to set some environment variables in the shell/session from which it’s is sourced (namely PATH, LD_LIBRARY_PATH and a few others). So you can source two different ROOT versions from two different terminals and run them concurrently without a problem.


Okay, got it, thank you very much!

Sorry for reusing this thread, I hope it’s not a problem.

Is sourcing even necessary? Will this

$ source root-no-debug/bin/
$ root-debug/bin/root.exe mymacro.C

possibly cause any problem?

EDIT: Nevermind, I should have tried before posting instead of the other way around. Sorry for pinging.

What I’m really trying to do is getting VSCode to call the debug version of ROOT properly, and using the optimized version for any other case. I have opened an issue on the vscode github but I still can’t manage to do that. Maybe I’ll compile root with the RelWithDebugInfo configuration and use that one for both debugging and running.