Home | News | Documentation | Download

Running in batch mode?


Please read tips for efficient and successful posting and posting code

_ROOT Version: 6.22/02
_Platform: WLS2 - Ubuntu 20
Compiler: Not Provided


Hi, I’ve just installed ROOT and I wanted to see how to do some graphs.
I installed ROOT on WSL2 on a Windows10 pc, running Ubuntu20. Everything seems working fine, except for the fact that I can’t show any graph.
I tried

root[0] TF1 f1("func1","sin(x)/x",0,10)
(TF1 &) Name: func1 Title: sin(x)/x
root[1] f1.Draw()
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1

but it does not show any file.
Moreover, if I open ROOT and then I try ‘.demo’, it says

root[0] .demo
Error in <TRint::ProcessLine>: Cannot show demos in batch mode!

So I suppose I am running in batch mode.
I’ve seen that to run in batch mode you have to call ‘root -b’, while I only write ‘root’ to open it.
I really can’t understand what I am doing wrong, maybe I should reinstall everything? Or there is an easier way?

Thank you :slight_smile:

Welcome to the ROOT forum!
In order to have graphics, you need to have a X11 server (e.g. XMing) installed and running. See for example this topic

1 Like

Thank you for your answer! :slight_smile: I followed the instructions in the topic that you suggested, but it didn’t work.
Anyway, we found another solution that I write so it could be useful for other beginners like me.

I installed MobaXterm instead of XMing and from there installed Root dependencies and Root itself. Then from there .demo works perfectly.