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

Artifact and GMT 6.5.0 ghostscript mismatch (with suggested fixes) #1584

Open
seanricardoford opened this issue Nov 7, 2024 · 2 comments
Open

Comments

@seanricardoford
Copy link

GMT.jl rules!

When running GMT.jl 1.21.1 while having a build of GMT 6.5.0 one gets an error:
gs: Interpreter revision (9550) does not match gs_init.ps revision (10021)

The error is due to the fact that:

  • GMT.jl 1.21.1 uses artifact Ghostscript version 9.55.0
  • GMT 6.5.0 (kindly) ships with Ghostscript version 10.02.1 which now asks to set environmental variable GS_LIB (looks like this changed from gs 9->10)
  • Ghostscript requires any gs_init.ps found to have listed version (in this case, 10021, on first line) to be the same as the executable (in this case, 9550)

Here are 2 suggested fixes:

  1. Requires a patch:
  • unset GS_LIB in psconvert System call (e.g., System call [unset GS_LIB; '/xxx/.julia/artifacts/xxx/bin/gs ...'])
  1. Can be done by user:
  • delete the environmental variable at startup (e.g., delete!(ENV, "GS_LIB") in ~/.julia/config/startup.jl)
@joa-quim
Copy link
Member

joa-quim commented Nov 7, 2024

Hi,

Thanks for the report and suggestions. But I'm afraid I'm having troubles in understanding the issue (my dev setup is a bit messy, though under control, so I like to think). Some comments/questions

When running GMT.jl 1.21.1 while having a build of GMT 6.5.0

GMT.jl, unless specifically instructed to, ignores the system installed GMT. So quite likely what you are using is the GMT dev version shipped in the GMT_jll (type GMTver on REPL and you should see v"6.6.0")

GMT.jl 1.21.1 uses artifact Ghostscript version 9.55.0

I have no control on this. GMT.jl has Ghostscript_jll as dependency and it looks that it's falling behind in updating.

GMT 6.5.0 (kindly) ships with Ghostscript version 10.02.1

Nope, it actually ships with gd2.24 (or close) but an installed official gs version takes precedence. Anyway, this should not affect the use in GMT.jl that, as you said, uses the Ghostscript_jll artifact.

What command did you run to get that warning/error?

@seanricardoford
Copy link
Author

seanricardoford commented Nov 8, 2024

From what it looks like, GMT.jl uses a System Call to run the ghostscript artifact to convert the GMT-produced postscript. Upon doing so the artifact-installed ghostscript looks for any system environmental variables as it has been built to do. One of those variables is GS_LIB. If it finds it, then one check it does is to see if the version listed in $GS_LIB/gs_init.ps is the same as the gs executable.

In my case (and, I image other busy mac GMT devotees), I have the macOS bundle binary for 6.5.0 where the accompanying bundled ghostscript needs the GS_LIB environmental variable to be set export GS_LIB=$GMTHOME/share/ghostscript/Resource/Init (see Note 1 in GMT_PROMPT). To complicate things, this was not necessary in earlier ghostscript installations (so users of, for example, GMT 6.1.1 never had to set GS_LIB).

So, its no problem to use an artifact for ghostscript 9.55.0 in GMT.jl, its just that users need to know how to "hide" the GS_LIB environmental variable from it (if its not for version 9.55.0). In my post, I offer two suggestions; the first requires a change to GMT.jl, the second can be done by the user.

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

2 participants