GR.jl
GR.jl copied to clipboard
error when qt4 not installed on system
I'm not sure if this is actually GR's fault, but on my system (Arch linux 4.18), the QT package is QT version 5, and GR looks for QT version 4:
julia> using Plots; gr(); plot(rand(10))
/home/dave/.julia/packages/GR/joQgG/src/../deps/gr/bin/gksqt: error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory
connect: Connection refused
GKS: can't connect to GKS socket application
Did you start 'gksqt'?
I fixed this by also installing the qt4
package from the package manager; I'm only reporting this in case you want to handle it on the GR end.
I'm still having this issue on Arch Linux.
Even though qt5 is stated as a dependency in the documentation (http://gr-framework.org/julia.html#installation), GR seems to request the qt4 library:
/home/username/.julia/packages/GR/KGODl/src/../deps/gr/bin/gksqt: error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory
connect: Connection refused
GKS: can't connect to GKS socket application
Did you start 'gksqt'?
GKS: Open failed in routine OPEN_WS
Julia version is 1.1.0 and qt5-base is installed.
I'm currently trying to install qt4 from AUR to see if the error goes away, but this is not a great solution because it takes a long time to build from source. I'm also not sure why qt4 is required, because the documentation (see above) says otherwise.
I realize now that on Arch Linux a generic compatibility version is used that links against qt4, it even says so in the documentation (there's also comment https://github.com/jheinen/GR.jl/issues/145#issuecomment-418626789). I guess a solution would be to provide a dedicated package for Arch which uses qt5?
We either could add Arch Linux as one of the supported OSs or use the CentOS/RedHat 7 version (with support for Qt5) for generic compatibility. We will discuss this in our team ...
More generally, Qt4 has been EOL for a while, so it would make sense to default to Qt5.
Comment about why Archlinux doesn't support Qt4 any more: https://aur.archlinux.org/packages/qt4/#pinned-693093
I think now GR supports Qt5? Now I can use GR.jl
on Arch Linux without having installed qt4
package from AUR.
Yes, previously our generic Linux build (based on CentOS 6) was used for ArchLinux and now we provide a build directly for ArchLinux. As a result, the Qt version from the ArchLinux repos is used.
I am running Julia 1.2 on Alpine Linux (musl libc system) and I'm having similar issue.
Trying to plot with GR gives
sh: /home/ecs/.julia/packages/GR/ZI5OE/src/../deps/gr/bin/gksqt: not found
Investigating gksqt
with ldd
gives
/lib64/ld-linux-x86-64.so.2 (0x7f5ebcdb5000)
Error loading shared library libQtGui.so.4: No such file or directory (needed by gksqt)
Error loading shared library libQtNetwork.so.4: No such file or directory (needed by gksqt)
Error loading shared library libQtCore.so.4: No such file or directory (needed by gksqt)
I see 2 problems here. First, the same people are discussing on this issue, that Qt-4 is EOL but GR expects it. The Qt4 package isn't available in Alpine since it was officially retired upstream.
Second, it looks like gksqt
assumes a glibc system?
On musl there is ld-musl-x86_64.so.1
but no ld-linux-x86-64.so.2
We could probably setup a separate CI runner for musl libc
systems, but we can't provide binaries for each Linux flavour. I'll discuss this with my colleagues ...
I just ran into this issue (Linux w/ Manjaro / Arch). Could plot using Jupyter notebook, but not in the REPL. Tried to update the Qt5 install and that had no effect. Found @kleinschmidt comment (OP) searching web for solution and that fixed it (installing Qt4 in addition)! A GKS Qt Term now pops up with the plot.
$ sudo pacman -Su qt4
error I was seeing before installing qt4:
julia> p = plot(1:10, rand(10))
/home/e/.julia/packages/GR/f1Iqi/src/../deps/gr/bin/gksqt: error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory
connect: Connection refused
GKS: can't connect to GKS socket application
Did you start 'gksqt'?
GKS: Open failed in routine OPEN_WS
There is this announcement for dropping qt4 support from Arch, so concerned a bit for the future... https://lists.archlinux.org/pipermail/arch-dev-public/2019-April/029560.html Thanks!
I've managed to build GR runtime on my system and to install /usr/bin/gksqt
with qt5 support. How to make this package to use it instead of downloaded broken one?
What is your Linux distribution and version? In the meantime, we have support for different Linux flavors and can probably add new ones.
lsb_release
cat /etc/*release
uname -a
I use Gentoo Linux AMD64. I've set GRDIR=/usr and it works.
# lsb_release
LSB Version: n/a
# cat /etc/*release
Gentoo Base System release 2.6
DISTRIB_ID="Gentoo"
NAME=Gentoo
ID=gentoo
PRETTY_NAME="Gentoo/Linux"
ANSI_COLOR="1;32"
HOME_URL="https://www.gentoo.org/"
SUPPORT_URL="https://www.gentoo.org/support/"
BUG_REPORT_URL="https://bugs.gentoo.org/"
# uname -a
Linux localhost 4.19.86-gentoo-x86_64 #1 SMP PREEMPT Mon Dec 23 16:39:38 MSK 2019 x86_64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz GenuineIntel GNU/Linux
have you solved this problem? i met the same error:
error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory
OS: Gentoo Linux x64 qt: qtgui-5.13.2 julia: latest
Did you try to build and install GR from source. I've always thought that's really the idea behind Gentoo, right?
i install GR by
] add GR Plots
] build GR
i try to update qtgui from 5.13.2 to 5.14.1-r4. but this error libQtGui.so.4: cannot open shared object file: No such file or directory
still exists when i plot(rand(10))
. it prove it is not due to version of qtgui. so what may be the real reason?
As mentioned before, you might try to install GR from source, as we don't yet provide binary packages for Gentoo.
so what should i do to solve this problem? ] build GR
looks like not useful.
let me try to make sciapp/gr...
although it has an errorqt.qpa.xcb: QXcbConnection: XCB error: 146 (Unknown), sequence: 201, resource id: 0, major code: 139 (Unknown), minor code: 20
, but the figure appears successful! thanks!
On my Arch Linux system, the issue was that the build.jl
file used by GR.jl was not detecting Arch Linux properly. Thus, the pre-compiled GR binary being downloaded was the generic one (which requires Qt4), instead of the one specific to Arch Linux (which requires Qt5).
My fix was first to amend the build.jl
file in ~/.julia/packages/GR/2wKV9/deps
as follows:
Amend the line:
elseif id == "arch" || id_like == "arch"
To:
elseif id == "arch" || id_like == "arch" || id_like == "archlinux"
Then, in the julia
repl, rebuild GR with ]build GR
Note that you will need to replace 2wKV9
in the folder path above to the folder corresponding to the version of GR being built. I found the corresponding folder from the output to ]build GR
:
Building GR → `~/.julia/packages/GR/2wKV9/deps/build.log`
Thanks for the hint. I fixed this in GR master.
Just to refine the answer from Freed-Wu, one needs to install the sci-visualization/gr package on Gentoo. As of today, the package is masked for amd64. Thus one has to unmarsk it so that one can emerge sci-visualization/gr.
thanks! let me take a try!