Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows x64] Fails to export images #28

Closed
dourouc05 opened this issue Jul 12, 2016 · 16 comments
Closed

[Windows x64] Fails to export images #28

dourouc05 opened this issue Jul 12, 2016 · 16 comments

Comments

@dourouc05
Copy link

On Windows, when trying to export simple plots, I get the following error message:

---------------------------
GKS
---------------------------
gsplugin.dll: can't load library
---------------------------
OK   
---------------------------

I use the following script to trigger the error:

using GR
GR.plot([1,2],[1,2])
GR.savefig("F:/a.png")

With a Plots.jl script, the same error appears:

using Plots
Plots.gr()
Plots.plot([1,2],[1,2])
Plots.savefig("F:/a.png")

However, both perfectly show a window with the plot in it.

I guess something went wrong with the installation of GR. I use version 0.13.0, installed directly with Pkg.install("GR"); Julia is 0.4.6, x64, on Windows 10 x64. I have a file C:\Users\Thibaut\.julia\v0.4\GR\deps\gr\gsplugin.dll, so it seems it is not missing.

Looking with Dependency Walker (http://www.dependencywalker.com/) at that file, it looks like it's missing a file: gsdll64.dll. It looks like Ghostscript, so I downloaded it (http://ghostscript.com/download/gsdnld.html) and put the corresponding DLL in the same folder. For Dependency Walker, everything looks OK… but I still get the same error!

capture

Is there any missing dependency hidden somewhere? Or a bug of another kind?

@jheinen
Copy link
Owner

jheinen commented Jul 13, 2016

There is a bug in GR 0.18.0. We are working on version 0.19.0, which will be built using MingW64 on Windows. This will solve the problem ...

@dourouc05
Copy link
Author

Thank you for your quick answer! Would you have an expected date for GR 0.19? I cannot see anything on your website…

@jheinen
Copy link
Owner

jheinen commented Jul 13, 2016

I hope we can deploy 0.19.0 next week ...

@jheinen
Copy link
Owner

jheinen commented Aug 11, 2016

@dourouc05 : Did 0.19.1 solve your problem?

@dourouc05
Copy link
Author

Sorry for the delay.

No, the update did not solve this issue: just making a Pkg.update() and retrying my code snippets gave the same results.

Then, I tried to Pkg.rm("GR") (I had to delete the package folder manually, because of its deps folder, as this was not entirely done when removing the package: libgks.dll and libgr.dll remained), then to Pkg.add("GR") again, but the problem is still the same.

---------------------------
GKS
---------------------------
gsplugin.dll: can't load library
---------------------------
OK   
---------------------------

(If I try directly through GR or through a layer like Plots, I get the same result.)

julia> versioninfo()
Julia Version 0.4.6
Commit 2e358ce (2016-06-19 17:16 UTC)
Platform Info:
  System: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

If I can do other tests to help you understand what's happening, please ask!

@dourouc05
Copy link
Author

Actually, I think the issue is worse than that: on a headless server (Linux, RHEL 7.2), I get a very similar error message. With the same script as before:

julia> using GR

julia> plot([1,2],[3,4]); savefig("/home/cuvelier/1.png")
ERROR: error compiling plot_data: error compiling __plot_data#1__: could not load library "/home/cuvelier/.julia/v0.4/GR/deps/gr/lib/libGR3.so"
libGL.so.1: cannot open shared object file: No such file or directory
 in plot at /home/cuvelier/.julia/v0.4/GR/src/jlgr.jl:833
 in plot at /home/cuvelier/.julia/v0.4/GR/src/GR.jl:1234

The Julia version is slightly older (it would be possible to update it, but I'm not root on that machine).

julia> versioninfo()
Julia Version 0.4.5
Commit 2ac304d (2016-03-18 00:58 UTC)
Platform Info:
  System: Linux (x86_64-redhat-linux)
  CPU: Intel(R) Core(TM) i7 CPU       X 990  @ 3.47GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

Or is this issue completely different from the previous one? (It seems GR is looking for something around OpenGL? Is a X server absolutely required, even if I don't draw anything on the screen? That would sound strange… and indicate there is a missing test when installing GR.jl.)

@jheinen
Copy link
Owner

jheinen commented Aug 25, 2016

GR requires a default Desktop environment which should contain the package mesa-libGL. 3D rendering is done using off-screen rendering using OpenGL.

We could catch that condition thus disabling all GR3 functionality and accelerated output in GR, e.g. surface(). I'll check this.

@jheinen
Copy link
Owner

jheinen commented Aug 25, 2016

@dourouc05 : On my Windows 10 VM, I had to remove temporary files and folders (using the system tools) to get the correct binaries installed in the deps folder. Otherwise, Windows seems to extract a cached archive and "skips" the requested download during the build process!? I didn't find out where these cached files were located, but using Microsoft's clean up procedure helped ...

@dourouc05
Copy link
Author

I tried reinstalling GR.jl after cleaning everything I could (with the Disk Clean-up tool, also for system files), but it did not change the result. To make sure this is the problem, I downloaded by hand the GR binaries (http://gr-framework.org/downloads/gr-0.19.1-Windows-x86_64.tar.gz) and installed them in GR (after deleting the deps/gr and deps/downloads folders)… and the result is still the same.

I could not find a GR function (in the C API) that returns the version: that would be an easy check to ensure the downloaded version is the expected one (even though it seems there is something for the Python module).

@jheinen
Copy link
Owner

jheinen commented Aug 25, 2016

@dourouc05 : Ok, please download http://gr-framework.org/downloads/gr-latest-Windows-x86_64.tar.gz. I should have mentioned that I used the GR master branch. Sorry for the inconvenience ...

@dourouc05
Copy link
Author

No problem, it's really nice that you spend time to help me, thank you! There is a change in error message with those new binaries (still in a popup):

---------------------------
GKS
---------------------------
Ghostscript support not compiled in
---------------------------
OK   
---------------------------

It's much less scary, but I'm still clueless about how to export PNGs.

@jheinen
Copy link
Owner

jheinen commented Aug 25, 2016

@dourouc05 : We obviously have a problem with our build system. I'll check (and test) this before making more recommendations ... :-)

@pfitzseb
Copy link
Contributor

pfitzseb commented Sep 1, 2016

Latest gr binaries seem to work on Windows! 🎉

@jheinen
Copy link
Owner

jheinen commented Sep 1, 2016

@pfitzseb : So you were faster than me making an announcement. But I had to apply another patch fixing a problem with filenames containing multiple periods, which caused Plots savefig and IJulia inline graphics (SVG) to fail on Windows. New binaries are currently being build and will be available in about 1h.

@pfitzseb
Copy link
Contributor

pfitzseb commented Sep 1, 2016

Great! Thanks for fixing that :)
Works perfectly with the Plots.jl/Juno combination now.

@dourouc05
Copy link
Author

The precompiled master branch also works on my side! Thanks for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants