I recently installed Julia on my Windows 10 machine using the given installer, opened cmd, then julia, added Plots package then did the following:
using Plots
gr()
plot(1:10)
A firewall permission message appeared asking if I’d grant permission to gksqt (which I’m sure is the gr plot window manager thing), but why does it ask for it?
The plot is shown with no error even if I don’t answer the firewall prompt.
@jheinen would be able to answer this better than I.
From my limited understanding, GR uses a separate driver program, gksqt.exe that acts as a server to manage the QT framework. The Julia package GR.jl communicates with gksqt.exe over network sockets in order to create plots. If you would like to avoid this, there are other GKS workstation types you can use.
You can find the source code for the GR framework here:
Yes. GR needs the socket to communicate with GKS QtTerm, which in turn requires its own event loop. The same applies to the GKSTerm.app under macOS - here the driver must run even in a master thread. Whether there are other ways to implement this form of IPC under Windows is not known to me.
Thanks for the info @jheinen. Would be nice if there could be a fix at some point since it is “annoying” to always get the warning message (under macOS)
and having to manually “allow” it each time a new plot window is triggered.
Yes, I have the firewall enabled on macOS. I cannot add a rule as I the gksqt “app” is not available from within the firewall application options (adding a rule to Julia bundle does not fix the issue neither). gksqt only shows up in the firewall exceptions upon the pop-up window arrives and I click “Allow”.
Also ()this may be unrelated though) until very recently Plots.jl was triggering the GKS QTerm app while it triggers gksqt.
Yes, it occurs with the macOS firewall (I have activated since years). Until recently there was no issue with Plots.jl and the GKS QTerm. But more or less in phase with the switch from Julia 1.5.4 to Julia 1.6 the GKS QTerm now became gksqt and prompts for firewall access all the times (highly annoying). Also, it seems gksqt is a corrupted version of GKS QTerm since one cannot close it without having to quit and the interaction with Julia is less stable (more crashes then previously).
Ah, well it might be the switch to using GR_jll.jl rather that the GR tarball.
This will switch you back to the tarball version of the binaries.
julia> ENV["JULIA_GR_PROVIDER"] = "GR"
(@v1.6) pkg> build GR
You can figure which binary provider you are using by checking the value of GR.gr_provider[]. The two valid values are either “BinaryBuilder” (GR_jll) or “GR” (tarball).
If that fails you can try reverting GR to an earlier version such as v0.55.0. That can be done using the following command:
This fixes both GKS QtTerm “deprecation mode” issue and also does no longer prompt for firewall access.
Before reverting to v0.55.0 I tried with both suggested JULIA_GR_PROVIDER but this did not impact the behaviour of plotting. I will file an issue as suggested so a fix could be found for the latest version.
I would suggest giving ENV["JULIA_GR_PROVIDER"] = "GR" another try and rebuilding the latest GR and confirming GR.gr_provider[] has the right value. This would at least allow us to confirm that something changed with the tarballs between v0.55.0 and v0.57.x. @jheinen might be able to hunt down what is causing the issue.
I followed everything you said and plotting OK. But my avast anti-virus program caught gksqr.exe that it is infected by IDP.Generic virus… I did not put it in quarantine but allowed an exception by ignoring it… I hope I did right. what do you say Sir?