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

Use BinaryBuilder.jl to package dependencies #447

Open
mihalybaci opened this issue Sep 30, 2020 · 80 comments
Open

Use BinaryBuilder.jl to package dependencies #447

mihalybaci opened this issue Sep 30, 2020 · 80 comments

Comments

@mihalybaci
Copy link

I have tried three times to install the GMT dependency for GMT.jl and so far have not been successful. On my first try, the version of GMT in the package repos of my OS (MX Linux/Debian) was too old (v5.4). Then I attempted to build GMT from source and ran into other issues regarding (I think) GDAL, which was also an older version (v2.3). Finally, on my new OS (Ubuntu 20.04) I have GMT version 6.0.0 and GDAL version 3.0.4, but trying to run the GMT tests gives me the following error message:

ERROR: LoadError: LoadError: could not load library "/usr/lib/x86_64-linux-gnu/libgmt.so"
/home/michael/.local/julia-1.5.2/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /lib/libgdal.so.26)

Note, each time I did end up with a working version of GMT, and the only problem appears be with GMT.jl reading the dependencies.

It would be hugely beneficial for users if GMT.jl to use BinaryBuilder.jl to ship GMT and its other dependencies with the code. This would greatly simplify the process for interested users.

@joa-quim
Copy link
Member

I'm sorry that you have had all those troubles but unix is a complicated world and things that I don't understand keep coming up. It happens that I was able to reproduce this problem in my WSL2 that has linux 18.04 and gcc 9. Googling showed up this . So my interpretation is that the problem is that julia was built with a gcc where that bug was not yet fixed and now the conflict comes from the Julia shipped libstdc++.so.6

Regarding the BinaryBuilder, well the main issue is that I don't know how create generic GMT builds for unix and MacOS. And also, BinaryBuilder is very unix-centric and on Windows we use Visual Studio, not gcc. I build the GMT installer with VS, not MinGW. So, it's quite complicated to create a GMT_jii ... and these linux issues don't help.

@mihalybaci
Copy link
Author

Thanks for the reply. I was actually able to fix the problem i posted above by compiling Julia#master from source, which used the updated version of the libraries. Unfortunately, I ran into a different issue having to do with GMT's postscriptlight. I was considering trying to figure out the binarybuilder myself, but I've never tried it before and would probably need a working version of GMT first.

@joa-quim
Copy link
Member

Yes, that kind of confirms the suspicion. On my side I made the experiment of just moving away the julia-1.5.2/bin/../lib/julia/libstdc++.so.6 and it now complains that

GMT [ERROR]: Unable to open GMT shared libgmt library: libnetcdf.so.13: cannot open shared object file: No such file or directory

but apparently it's a false alarm since the tests pass and I can open netcdf grids.

What is the problem with the postscript? Note that about this it might be more appropriate to post on the GMT forum.

@joa-quim
Copy link
Member

FYI

@joa-quim
Copy link
Member

If you want to give it a try, the master version now installs GMT automatically from Conda. But the Conda version on CentOS is half broken. It needs to install an extra lib (libnsl) that is not shipped with libc as with other distros.

@boriskaus
Copy link

I gave this another try and managed to get a BinaryBuilder version of GMT compiling on Mac & Windows:
JuliaPackaging/Yggdrasil#5199

Yet, there are some hiccups with the windows installation. Perhaps @joa-quim or others from the GMT have some idea what needs to be changed for that to compile?

@joa-quim
Copy link
Member

@boriskaus Thanks a lot for trying this. It's a really needed solution but unfortunately, and that's my personal view, the real problem lies on Unix that tries to force Windows be Unix and when it fails it blames Windows.

The GMT Windows build is perfectly solved with the VS build (took us several years of continuous improvements) and that is not going to be replaced by a far inferior MinGW build. But it still leaves out the *nix builds and that's where the effort should be focused. Unfortunately, even there the constrain of everything be build-able with MinGW too is severely harming the *nix side when the Win builds pose problems that have not yet been solve (e.g. GDAL, netCDF, and probably others).

I'll post this comments in the BinaryBuilder issue later today.

@boriskaus
Copy link

boriskaus commented Jul 25, 2022

I'm not sure I fully follow you.

The Linux and Mac BinaryBuilder versions already seem to compile just fine, so I guess that having that would already be very useful for GMT.jl (as Windows seems to work a bit better already with GMT.jl; Mac/Linux is a mess as I am repeatedly reminded about while using this in teaching).

Or are you saying that some executables are still missing for *nix builds?

The windows version is indeed not fully compiling, but we can certainly create a GMT_jll without windows support. I feel that we are not missing much, though, as I can get it to compile manually (I just don't know how to link the required libs to CMake likely because of my limited knowledge of CMake)

@joa-quim
Copy link
Member

I think that for now a workable solution is to have a BinaryBuilder for unix only (Mac included). I'll have then to find a way to use it only on non-Windows platforms and use the Windows installer for Windows.

What I meant to say is that the unix builds will be crippled because GDAL_jll is crippled as it does include netCDF + HDF. This has nothing to do with GMT nor CMake but with fact that because cross-platform build has not been able to build a GDAL with those libraries too (partially because the reason I said Windows-is-not-Unix). And they are quite handy in GMT. So quite a few specialized options will not be accessible to Unix users when using the GMT_jll

And, I would be delighted to know how you use GMT.jl in teaching. We could talk about nice examples that could go also to the being-reworked-manual.

@joa-quim
Copy link
Member

joa-quim commented Mar 2, 2023

Hi @boriskaus
Are you still interested in pursuing this? I think we can now make it work, but the recipe will need some changes.

@boriskaus
Copy link

Yes, I keep being interested to have this working, and I am guessing that many users of GMT.jl would also love to have a BB version.

@joa-quim
Copy link
Member

joa-quim commented Mar 2, 2023

Perfect, we should be able to do it now that GMT builds on MinGW ... despite some rocks in the way.

I guess that I must (or it's easier that way) find a way to make a tar ball available in github with the current master version that builds with MinGW.

@joa-quim
Copy link
Member

joa-quim commented Mar 2, 2023

But if you know how to fetch the source from GMT/#master that would be even better.

@boriskaus
Copy link

Yes it can be done with a bit commit; I’ll add that later

@joa-quim
Copy link
Member

@boriskaus I think the GMT_jll is ready to test. It worked for me on WSL-Ubuntu, Centos7 and an old Mac. The default is to use the GMT_jll artifact but that can be changed to use a system wide GMT with:

  • ENV["SYSTEMWIDE_GMT"] = 1;
  • import Pkg; Pkg.build("GMT")
  • restart Julia

To revert to the JLL artifact, from a clean REPL session

  • import Pkg; Pkg.build("GMT")
  • restart Julia

@boriskaus
Copy link

thanks! On Mac Silicon it fails with the following message:

     Testing Running tests...
ERROR: LoadError: SystemError: opening file "/Users/kausb/.julia/dev/GMT/deps/deps.jl": No such file or directory
Stacktrace:
  [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
    @ Base ./error.jl:176
  [2] #systemerror#80
    @ ./error.jl:175 [inlined]
  [3] systemerror
    @ ./error.jl:175 [inlined]
  [4] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing)
    @ Base ./iostream.jl:293
  [5] open
    @ ./iostream.jl:275 [inlined]
  [6] open(f::Base.var"#387#388"{String}, args::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./io.jl:382
  [7] open
    @ ./io.jl:381 [inlined]
  [8] read
    @ ./io.jl:462 [inlined]
  [9] _include(mapexpr::Function, mod::Module, _path::String)
    @ Base ./loading.jl:1484
 [10] include(mod::Module, _path::String)
    @ Base ./Base.jl:419
 [11] include(x::String)
    @ GMT ~/.julia/dev/GMT/src/GMT.jl:1
 [12] top-level scope
    @ ~/.julia/dev/GMT/src/GMT.jl:43
 [13] include
    @ ./Base.jl:419 [inlined]
 [14] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1554
 [15] top-level scope
    @ stdin:1
in expression starting at /Users/kausb/.julia/dev/GMT/src/GMT.jl:1
in expression starting at stdin:1

@joa-quim
Copy link
Member

The ".../deps/deps.jl" file is generated by compile. Nothing new here regarding to the master branch. It should be solvable by doing import Pkg; Pkg.build("GMT"). But I would like to understand why it happen. I see that you are using a deve'd version. My tests were all with regular installs. I did it again on Mac, after ] rm GMT and manually deleting all the GMT directories that Julia did not clean (shame Julia), like the .julia/packages/GMT and .julia/compiled/v1.9/GMT.
Then I restarted with ]add GMT#GMT_jl and all went +/-well.

The not so good experience is that it took ages to install (why?) and when we do ] test GMT it recompiles GMT again which takes quite some time. Why recompiling something that has just been installed from scratched and compiled?

Another thing you must be aware is that there is some Heisenbug that cause occasional segv's when running the tests when the GC tries to free some apparently non-valid memory. I've tried and tried to find/solve this but with no success. All I could find is that it seems related to the use of makecpt but nothing I can reproduce.

@boriskaus
Copy link

boriskaus commented Mar 21, 2023

Indeed, with compile it runs. Perhaps this is the same Heisenbug?

[ Info: 63...
STATPLOTS: Error During Test at /Users/kausb/.julia/dev/GMT/test/test_statplots.jl:1
  Got exception outside of a @test
  Something went wrong when calling the module. GMT error number = 79
  Stacktrace:
    [1] error(s::String)
      @ Base ./error.jl:35
    [2] gmt(::String)
      @ GMT ~/.julia/dev/GMT/src/gmt_main.jl:311
    [3] helper_showfig4modern(show::String)
      @ GMT ~/.julia/dev/GMT/src/common_options.jl:3894
    [4] subplot(fim::Symbol; stop::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
      @ GMT ~/.julia/dev/GMT/src/subplot.jl:128
    [5] subplot
      @ ~/.julia/dev/GMT/src/subplot.jl:45 [inlined]
    [6] cornerplot(arg1::Matrix{Float64}; first::Bool, kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:scatter,), Tuple{Bool}}})
      @ GMT ~/.julia/dev/GMT/src/statplots.jl:1291
    [7] macro expansion
      @ ~/.julia/dev/GMT/test/test_statplots.jl:90 [inlined]
    [8] macro expansion
      @ /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Test/src/Test.jl:1363 [inlined]
    [9] top-level scope
      @ ~/.julia/dev/GMT/test/test_statplots.jl:2
   [10] include(fname::String)
      @ Base.MainInclude ./client.jl:476
   [11] macro expansion
      @ ~/.julia/dev/GMT/test/runtests.jl:83 [inlined]
   [12] macro expansion
      @ /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Test/src/Test.jl:1363 [inlined]
   [13] top-level scope
      @ ~/.julia/dev/GMT/test/runtests.jl:21
   [14] include(fname::String)
      @ Base.MainInclude ./client.jl:476
   [15] top-level scope
      @ none:6
   [16] eval
      @ ./boot.jl:368 [inlined]
   [17] exec_options(opts::Base.JLOptions)
      @ Base ./client.jl:276
   [18] _start()
      @ Base ./client.jl:522
	GREENSPLINE
	MAPPROJECT
	PSMECA
	GADM
	MAKECPT
		MAKECPT - 0
		MAKECPT - 1
		MAKECPT - 2

signal (11): Segmentation fault: 11
in expression starting at /Users/kausb/.julia/dev/GMT/test/runtests.jl:5
gc_mark_loop at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
_jl_gc_collect at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
ijl_gc_collect at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
ijl_gc_pool_alloc at /Applications/Julia-1.8.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.8.dylib (unknown line)
iterate at ./compiler/ssair/ir.jl:467
iterate at ./compiler/ssair/ir.jl:459 [inlined]
count_added_node! at ./compiler/ssair/ir.jl:681
setindex! at ./compiler/ssair/ir.jl:810
setindex! at ./compiler/ssair/ir.jl:818 [inlined]
ir_inline_item! at ./compiler/ssair/inlining.jl:386

rerunning makes it proceed further:

Test Summary: | Pass  Error  Total     Time
GMT           |  464      2    466  2m40.7s
  PROJ4       |    3             3     4.7s
  GDALext     |   44            44     1.6s
  GDAL        |   29            29     4.8s
  TABLES      |    1             1     0.1s
  COMMON OPTS |  235           235    22.1s
  STATPLOTS   |           1      1    13.4s
  MISC        |   11            11     8.5s
ERROR: LoadError: Some tests did not pass: 464 passed, 0 failed, 2 errored, 0 broken.
in expression starting at /Users/kausb/.julia/dev/GMT/test/runtests.jl:5
ERROR: Package GMT errored during testing

2nd error:

GMT: Error During Test at /Users/kausb/.julia/dev/GMT/test/runtests.jl:5
  Got exception outside of a @test
  IOError: unlink("png.png"): no such file or directory (ENOENT)
  Stacktrace:
    [1] uv_error
      @ ./libuv.jl:97 [inlined]
    [2] unlink(p::String)
      @ Base.Filesystem ./file.jl:972
    [3] rm(path::String; force::Bool, recursive::Bool)
      @ Base.Filesystem ./file.jl:283
    [4] rm(path::String)
      @ Base.Filesystem ./file.jl:273
    [5] macro expansion
      @ ~/.julia/dev/GMT/test/runtests.jl:154 [inlined]
    [6] macro expansion
      @ /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Test/src/Test.jl:1363 [inlined]
    [7] top-level scope
      @ ~/.julia/dev/GMT/test/runtests.jl:21
    [8] include(fname::String)
      @ Base.MainInclude ./client.jl:476
    [9] top-level scope
      @ none:6
   [10] eval
      @ ./boot.jl:368 [inlined]
   [11] exec_options(opts::Base.JLOptions)
      @ Base ./client.jl:276
   [12] _start()
      @ Base ./client.jl:522

@joa-quim
Copy link
Member

joa-quim commented Mar 21, 2023

Yes, the Heisenbug is the one that causes the signal (11): Segmentation fault: 11. Several of the printings in test runs are to try to see if there is a pattern, which there is but only vaguely pointing to makecpt

The other error is even more worrisome because I got it too in my Codespaces/Ubuntu 20.04 but not in the other three environments where I tried (2 Linuxes and 1 MacOS/Big Sur). Now you are hitting it too. Don't know how to debug this.

@joa-quim
Copy link
Member

The failing test is the same as if one runs this single command

cornerplot(randn(50,3), scatter=true)

I suspect that it's due to a internal (from the C lib) call to gs. Can you please try installing ghostscript such that gs in the the path and then run that command above?

@joa-quim
Copy link
Member

joa-quim commented Mar 21, 2023

Bingo. Added GS to my Codespaces and now all tests pass. So now the problem is on how to solve this. We have a dependency on Ghostscript_jll but that does not add the binary dir to the path so the GMT lib is not able to find it.

@boriskaus
Copy link

Ghostscript_jll does come with the binary and the path to the binary, at least on my version of it.

@joa-quim
Copy link
Member

Yes, I know but the gs executable is not in the path so when from the GMT guts the gs executable is called, an error follows.
This is different from the situation where gs is called from a GMT wrapped module where I take care of passing in the gs full address.

julia> GMT.Ghostscript_jll.gs()[1]
"/home/j/.julia/artifacts/4883a6685d86b068da934537a444a6d170d71730/bin/gs"

julia> gs
ERROR: UndefVarError: `gs` not defined

@boriskaus
Copy link

You could do this:

julia> gs() = run(`$(GMT.Ghostscript_jll.gs())`)
gs (generic function with 1 method)

julia> gs()
GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
GS>

I'm not really understanding how you are using gs with GMT. Do you pass command-line arguments, for example?

The additional information that is available in GMT.Ghostscript_jll.gs() is important, as it sets the path to the dynamic libraries that are required to run gs. In most cases, you can therefore not simply call GMT.Ghostscript_jll.gs()[1].

@joa-quim
Copy link
Member

Ghostscript is used in GMT via the psconvert module. Fortunately, many years ago, I had the idea to add an option (-G) to psconvert that lets one specify which gs executable to use. That is what is used (under the hood) when we now call the psconvert from Julia (that call is made automatically to convert the result to PNG and others). And all this works well.

But. In some cases the GMT binary needs also to make a call to gs for some internal reasons, and in those cases it simply expects that gs is visible through PATH and those are the cases that now fail if we don't have a, lets say, globally installed ghostscript. I tried to find a way to change the system PATH from Julia but couldn't find a way. Not even this works.

julia> run(`echo PATH`)
PATH
Process(`echo PATH`, ProcessExited(0))

julia> run(`echo $PATH`)
ERROR: UndefVarError: `PATH` not defined

@boriskaus
Copy link

ok, I see.
If you call run on a binarybuilder package it sets the environmental variables, including PATH accordingly.
The content of the Ghostscript package, for example, is:

julia> GMT.Ghostscript_jll.gs().
cpus          dir           env           exec          flags         ignorestatus

where env includes the environment:

julia> GMT.Ghostscript_jll.gs().env
40-element Vector{String}:
 "XPC_FLAGS=0x0"
 "COMMAND_MODE=unix2003"
 "PATH=/Users/kausb/.julia/artifa"  256 bytes  "omebrew/opt/python/libexec/bin"
 "PWD=/Users/kausb/.julia/dev/GMT"
 "DISPLAY=/private/tmp/com.apple.launchd.a3pn6YlwX0/org.xquartz:0"
 "XPC_SERVICE_NAME=0"
 "TERM_PROGRAM=vscode"
 "HOMEBREW_PREFIX=/opt/homebrew"
 "VSCODE_GIT_ASKPASS_NODE=/Applic"  79 bytes  "ents/MacOS/Code Helper (Plugin)"
 "SHELL=/bin/bash"
 
 "INFOPATH=/opt/homebrew/share/info:"
 "_=/usr/local/bin/julia"
 "HOMEBREW_REPOSITORY=/opt/homebrew"
 "USER=kausb"
 "BASH_CONF=bash_profile"
 "TERM=xterm-256color"
 "HOME=/Users/kausb"
 "TERM_PROGRAM_VERSION=1.76.2"
 "COLORTERM=truecolor"

The 3rd entry is the PATH. If you add directories there, it should in principle be aware of it once you call the binary with run(...)

I suppose that you would therefore have to do something along these lines for the gmt binary, which I guess is what you use to call psconvert.

An alternative approach, which I did not test yet, is to explicitly ship the gs executable when we generate the GMT_jll package, rather than just making it a dependency. in that case it'll probably put it in the same directory as the gmt binary.

@joa-quim
Copy link
Member

I think that it would solve the case if run(...) worked, but (for me PATH is the first entry)

julia> run(`GMT.Ghostscript_jll.gs().env[1]`)
ERROR: LoadError: parsing command `GMT.Ghostscript_jll.gs().env[1]`: special characters "#{}()[]<>|&*?~;" must be quoted in commands

julia> run(`PATH=/home/j/.julia/artifacts/4883a6685d86b068da934537a444a6d170d71730/bin`)
ERROR: IOError: could not spawn `PATH=/home/j/.julia/artifacts/4883a6685d86b068da934537a444a6d170d71730/bin`: no such file or directory (ENOENT)

Packaging the gs binary is a possibility but I would leave it to a real last resort. There are other files that would need to along as well (the shared lib, fonts, etc))

@boriskaus
Copy link

boriskaus commented Mar 22, 2023

yes, that is because you cannot simply run the path to the executable, as this does not set the correct environmental variables (including dynamics libraries etc.).
You can run:

Julia> run(`$(GMT.Ghostscript_jll.gs())`)
GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.

you can also check that GMT.Ghostscript_jll.gs() is of type Cmd:

julia> typeof(GMT.Ghostscript_jll.gs())
Cmd

the user guide explains that these are structs that contain the environmental variables. So if you run this, it will set that before executing.

There is actually a simple way to replace certain environmental variables using addenv. We can add the path to gs to the gmt Cmd object in the following way:

julia> env = GMT.GMT_jll.gmt().env;
julia> ind = findall(startswith.(env,"PATH="))[1]
julia> path_gmt = env[ind][6:end]
"/Users/kausb/.julia/artifacts/b1a055a9c307b137556560efcc2cee3a6405dfd7/bin:/Users/kausb/.julia/artifacts/f987f10c94bc56fe3589d9b30a6e2f419402a31c/bin:/Users/kausb/.julia/artifacts/185bfeaa5186fb47cdc2236f5624f52e74a59cbf/bin:/Users/kausb/.julia/artifacts/9472204d25ab69d52d571b650fdc9d562455ca4a/bin:/Users/kausb/.julia/artifacts/86c32a34b06c15b5ec8d4f694c2b91435253f209/bin:/Users/kausb/.julia/artifacts/dfa09fc5bd33a68e75b575d8d6565a89814949c2/bin:/Users/kausb/.julia/artifacts/689b6368f94a3d130dce98f67b83f245bebdcbe0/bin:/Users/kausb" ⋯ 889 bytes ⋯ "Users/kausb/.julia/artifacts/1a7e22e66b523d9cb884cf85c3ec065b5fb3e5c3/bin:/Users/kausb/.julia/artifacts/bf37190b92ac2fc3dd5e7073ff7ec7bbfd10343f/bin:/Users/kausb/.julia/artifacts/0d9e7c35bc21411c7d9c194f790e30a95a4a5795/bin:/Users/kausb/.julia/artifacts/57273092253ad3a7bf9733122480db4d6dc9c4b5/bin:/opt/petsc/petsc-3.16.4-opt/bin/:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/opt/homebrew/opt/python/libexec/bin"

julia> path_gs = GMT.Ghostscript_jll.PATH_list[1]
"/Users/kausb/.julia/artifacts/0d9e7c35bc21411c7d9c194f790e30a95a4a5795/bin"
julia> path_gmt_gs = path_gmt*":"* path_gs;
julia> gmt_exec = addenv(GMT.GMT_jll.gmt(), ("PATH"=> path_gmt_gs))
setenv(`/Users/kausb/.julia/artifacts/57273092253ad3a7bf9733122480db4d6dc9c4b5/bin/gmt`,["XPC_FLAGS=0x0", "COMMAND_MODE=unix2003", "PATH=/Users/kausb/.julia/artifacts/b1a055a9c307b137556560efcc2cee3a6405dfd7/bin:/Users/kausb/.julia/artifacts/f987f10c94bc56fe3589d9b30a6e2f419402a31c/bin:/Users/kausb/.julia/artifacts/185bfeaa5186fb47cdc2236f5624f52e74a59cbf/bin:/Users/kausb/.julia/artifacts/9472204d25ab69d52d571b650fdc9d562455ca4a/bin:/Users/kausb/.julia/artifacts/86c32a34b06c15b5ec8d4f694c2b91435253f209/bin:/Users/kausb/.julia/artifacts/dfa09fc5bd33a68e75b575d8d6565a89814949c2/bin:/Users/kausb/.julia/artifacts/689b6368f94a3d130dce98f67b83f245bebdcbe0/bin:/Users/kausb/.julia/artifacts/825c20e9fb9976a6dc62e1a442018fed80992c1b/bin:/Users/kausb/.julia/artifacts/3e6cbbf76c070bcec6c7db17999b509ac4b46c0d/bin:/Users/kausb/.julia/artifacts/41d2d4f312d93b56961767987cf48ea1f6d6fadc/bin:/Users/kausb/.julia/artifacts/9cd88b624c5c9ad34fec9c61621c56d465a8c717/bin:/Users/kausb/.julia/artifacts/e30df1d228e442d6b680e2ec8adf98bc9535908f/bin:/Users/kausb/.julia/artifacts/6db94dab8e98dab5bc4428a316ba3f44540bdef2/bin:/Users/kausb/.julia/artifacts/4a1a8201c8ca970558b4321430d5aae3fca6833d/bin:/Users/kausb/.julia/artifacts/df3881e810714d6a09467fe85a6fde79385fe702/bin:/Users/kausb/.julia/artifacts/e6b9fb44029423f5cd69e0cbbff25abcc4b32a8f/bin:/Users/kausb/.julia/artifacts/413111420faa4e2aeaa383c075eaa213402d939c/bin:/Users/kausb/.julia/artifacts/c325a23bc1f6521474cef5f634f18c8ab311bb02/bin:/Users/kausb/.julia/artifacts/0db9c3f6cf936a0da49e2ba954ba3e10bed6ad72/bin:/Users/kausb/.julia/artifacts/1a7e22e66b523d9cb884cf85c3ec065b5fb3e5c3/bin:/Users/kausb/.julia/artifacts/bf37190b92ac2fc3dd5e7073ff7ec7bbfd10343f/bin:/Users/kausb/.julia/artifacts/0d9e7c35bc21411c7d9c194f790e30a95a4a5795/bin:/Users/kausb/.julia/artifacts/57273092253ad3a7bf9733122480db4d6dc9c4b5/bin:/opt/petsc/petsc-3.16.4-opt/bin/:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/opt/homebrew/opt/python/libexec/bin:/Users/kausb/.julia/artifacts/0d9e7c35bc21411c7d9c194f790e30a95a4a5795/bin", "PWD=/Users/kausb/.julia/dev/GMT", "DISPLAY=/private/tmp/com.apple.launchd.a3pn6YlwX0/org.xquartz:0", "XPC_SERVICE_NAME=0", "TERM_PROGRAM=vscode", "HOMEBREW_PREFIX=/opt/homebrew", "VSCODE_GIT_ASKPASS_NODE=/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)", "SHELL=/bin/bash"  …  "FONTCONFIG_FILE=/Users/kausb/.julia/artifacts/e6b9fb44029423f5cd69e0cbbff25abcc4b32a8f/etc/fonts/fonts.conf", "INFOPATH=/opt/homebrew/share/info:", "_=/usr/local/bin/julia", "HOMEBREW_REPOSITORY=/opt/homebrew", "USER=kausb", "BASH_CONF=bash_profile", "TERM=xterm-256color", "HOME=/Users/kausb", "TERM_PROGRAM_VERSION=1.76.2", "COLORTERM=truecolor"])

at this stage,gmt_exec is a Cmd object that includes the path to the gs binary, so if you call the executable while using run, it should be aware of gs. I haven't tested this, though.

@joa-quim
Copy link
Member

Thanks, very clever and I was expecting it to work but it still fails to run

cornerplot(randn(50,3), scatter=true)

I think the reason why it fails is the same that after running run(`gmt_exec`), run(`printenv`) does not show any of the gmt_exe PATH contents. Looks like those are two completely distinct PATHs.

@boriskaus
Copy link

boriskaus commented Mar 23, 2023

correct, every time run is called it uses a new environment. Yet, you can pass the same PATH as above in the following manner:

julia> terminal_com = Cmd(`printenv`, env=("PATH"=>path_gmt_gs,));
julia> run(terminal_com);
PATH=/Users/kausb/.julia/artifacts/b1a055a9c307b137556560efcc2cee3a6405dfd7/bin:/Users/kausb/.julia/artifacts/f987f10c94bc56fe3589d9b30a6e2f419402a31c/bin:/Users/kausb/.julia/artifacts/185bfeaa5186fb47cdc2236f5624f52e74a59cbf/bin:/Users/kausb/.julia/artifacts/9472204d25ab69d52d571b650fdc9d562455ca4a/bin:/Users/kausb/.julia/artifacts/86c32a34b06c15b5ec8d4f694c2b91435253f209/bin:/Users/kausb/.julia/artifacts/dfa09fc5bd33a68e75b575d8d6565a89814949c2/bin:/Users/kausb/.julia/artifacts/689b6368f94a3d130dce98f67b83f245bebdcbe0/bin:/Users/kausb/.julia/artifacts/825c20e9fb9976a6dc62e1a442018fed80992c1b/bin:/Users/kausb/.julia/artifacts/3e6cbbf76c070bcec6c7db17999b509ac4b46c0d/bin:/Users/kausb/.julia/artifacts/41d2d4f312d93b56961767987cf48ea1f6d6fadc/bin:/Users/kausb/.julia/artifacts/9cd88b624c5c9ad34fec9c61621c56d465a8c717/bin:/Users/kausb/.julia/artifacts/e30df1d228e442d6b680e2ec8adf98bc9535908f/bin:/Users/kausb/.julia/artifacts/6db94dab8e98dab5bc4428a316ba3f44540bdef2/bin:/Users/kausb/.julia/artifacts/4a1a8201c8ca970558b4321430d5aae3fca6833d/bin:/Users/kausb/.julia/artifacts/df3881e810714d6a09467fe85a6fde79385fe702/bin:/Users/kausb/.julia/artifacts/e6b9fb44029423f5cd69e0cbbff25abcc4b32a8f/bin:/Users/kausb/.julia/artifacts/413111420faa4e2aeaa383c075eaa213402d939c/bin:/Users/kausb/.julia/artifacts/c325a23bc1f6521474cef5f634f18c8ab311bb02/bin:/Users/kausb/.julia/artifacts/0db9c3f6cf936a0da49e2ba954ba3e10bed6ad72/bin:/Users/kausb/.julia/artifacts/1a7e22e66b523d9cb884cf85c3ec065b5fb3e5c3/bin:/Users/kausb/.julia/artifacts/bf37190b92ac2fc3dd5e7073ff7ec7bbfd10343f/bin:/Users/kausb/.julia/artifacts/0d9e7c35bc21411c7d9c194f790e30a95a4a5795/bin:/Users/kausb/.julia/artifacts/57273092253ad3a7bf9733122480db4d6dc9c4b5/bin:/opt/petsc/petsc-3.16.4-opt/bin/:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/opt/homebrew/opt/python/libexec/bin:/Users/kausb/.julia/artifacts/0d9e7c35bc21411c7d9c194f790e30a95a4a5795/bin

Along the same lines, we can verify that gs is available:

julia> run(Cmd(`which gs`, env=("PATH"=>path_gmt_gs,)));
/Users/kausb/.julia/artifacts/0d9e7c35bc21411c7d9c194f790e30a95a4a5795/bin/gs

If we only pass the PATH, the gmt executable will not work as it doesn't find the required dynamic libraries:

julia> run(Cmd(`gmt`, env=("PATH"=>path_gmt_gs,)));
dyld[83538]: Library not loaded: @rpath/libnetcdf.19.dylib
  Referenced from: <F6F32940-EE6D-3C19-96A0-24E64727DFAE> /Users/kausb/.julia/artifacts/57273092253ad3a7bf9733122480db4d6dc9c4b5/bin/gmt
  Reason: tried: '/Users/kausb/.julia/artifacts/57273092253ad3a7bf9733122480db4d6dc9c4b5/bin/../lib/libnetcdf.19.dylib' (no such file), '/Users/kausb/.julia/artifacts/57273092253ad3a7bf9733122480db4d6dc9c4b5/bin/../lib/libnetcdf.19.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS@rpath/libnetcdf.19.dylib' (no such file), '/Users/kausb/.julia/artifacts/57273092253ad3a7bf9733122480db4d6dc9c4b5/bin/../lib/libnetcdf.19.dylib' (no such file), '/Users/kausb/.julia/artifacts/57273092253ad3a7bf9733122480db4d6dc9c4b5/bin/../lib/libnetcdf.19.dylib' (no such file), '/usr/local/lib/libnetcdf.19.dylib' (no such file), '/usr/lib/libnetcdf.19.dylib' (no such file, not in dyld cache)
ERROR: failed process: Process(setenv(`gmt`,["PATH=/Users/kausb/.julia/artifacts/b1a055a9c307b137556560efcc2cee3a6405dfd7/bin:/Users/kausb/.julia/artifacts/f987f10c94bc56fe3589d9b30a6e2f419402a31c/bin:/Users/kausb/.julia/artifacts/185bfeaa5186fb47cdc2236f5624f52e74a59cbf/bin:/Users/kausb/.julia/artifacts/9472204d25ab69d52d571b650fdc9d562455ca4a/bin:/Users/kausb/.julia/artifacts/86c32a34b06c15b5ec8d4f694c2b91435253f209/bin:/Users/kausb/.julia/artifacts/dfa09fc5bd33a68e75b575d8d6565a89814949c2/bin:/Users/kausb/.julia/artifacts/689b6368f94a3d130dce98f67b83f245bebdcbe0/bin:/Users/kausb/.julia/artifacts/825c20e9fb9976a6dc62e1a442018fed80992c1b/bin:/Users/kausb/.julia/artifacts/3e6cbbf76c070bcec6c7db17999b509ac4b46c0d/bin:/Users/kausb/.julia/artifacts/41d2d4f312d93b56961767987cf48ea1f6d6fadc/bin:/Users/kausb/.julia/artifacts/9cd88b624c5c9ad34fec9c61621c56d465a8c717/bin:/Users/kausb/.julia/artifacts/e30df1d228e442d6b680e2ec8adf98bc9535908f/bin:/Users/kausb/.julia/artifacts/6db94dab8e98dab5bc4428a316ba3f44540bdef2/bin:/Users/kausb/.julia/artifacts/4a1a8201c8ca970558b4321430d5aae3fca6833d/bin:/Users/kausb/.julia/artifacts/df3881e810714d6a09467fe85a6fde79385fe702/bin:/Users/kausb/.julia/artifacts/e6b9fb44029423f5cd69e0cbbff25abcc4b32a8f/bin:/Users/kausb/.julia/artifacts/413111420faa4e2aeaa383c075eaa213402d939c/bin:/Users/kausb/.julia/artifacts/c325a23bc1f6521474cef5f634f18c8ab311bb02/bin:/Users/kausb/.julia/artifacts/0db9c3f6cf936a0da49e2ba954ba3e10bed6ad72/bin:/Users/kausb/.julia/artifacts/1a7e22e66b523d9cb884cf85c3ec065b5fb3e5c3/bin:/Users/kausb/.julia/artifacts/bf37190b92ac2fc3dd5e7073ff7ec7bbfd10343f/bin:/Users/kausb/.julia/artifacts/0d9e7c35bc21411c7d9c194f790e30a95a4a5795/bin:/Users/kausb/.julia/artifacts/57273092253ad3a7bf9733122480db4d6dc9c4b5/bin:/opt/petsc/petsc-3.16.4-opt/bin/:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/opt/homebrew/opt/python/libexec/bin:/Users/kausb/.julia/artifacts/0d9e7c35bc21411c7d9c194f790e30a95a4a5795/bin"]), ProcessSignaled(6)) [0]

Yet, if you pass the full environment from gmt_exec, it'll do the job:

julia> run(Cmd(`gmt`, env=gmt_exec.env));

        GMT - The Generic Mapping Tools, Version 6.5.0_2414ba2_2023.03.12 [MP] [12 cores]
        (c) 1991-2023 The GMT Team (https://www.generic-mapping-tools.org/team.html).

        Supported in part by the US National Science Foundation (http://www.nsf.gov/)
        and volunteers from around the world.

        GMT is distributed under the GNU LGPL License (http://www.gnu.org/licenses/lgpl.html).
        Dependencies: netCDF, GDAL, PCRE, FFTW, LAPACK, ZLIB, Ghostscript, GraphicsMagick, FFmpeg.

usage: gmt [options]
       gmt <module name> [<module-options>]

julia> run(Cmd(`gs`, env=gmt_exec.env));
GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.

The cool thing about Cmd and run is that it'll take care about the differences in doing this on windows vs *nix systems.

@joa-quim
Copy link
Member

Not sure, GMT also needs to use libcurl directly.

This libcurl shit is transversal to many packages and the problem has been, unfortunately, more or less ignored and the level of support barely above the minimums.

@joa-quim
Copy link
Member

In the afternoon (now I have to go to the fish market) I'll raise this question in the forum again.

@boriskaus
Copy link

If it is a dependency of GDAL_jll it should be downloaded automatically before compiling GMT_jll

As mose pointed out this appears to be unrelated to julia, but rather how libcurl is being maintained.

personally, I don’t have the slightest clue what this actually does…

@joa-quim
Copy link
Member

It is related to Julia in the sense that on master they updated libcurl to 8.0.1 but not in the 1.9 (and previous) branches. And now we have this shit. I also don't understand why we need a libCURL_jll at all since Julia comes with that library already. And not say that libCURL_jll itself also depends only on 7.73

I don’t have the slightest clue what this actually does…

It's for internet access.

@boriskaus
Copy link

LibCURL 8.0.1 is available:
JuliaPackaging/Yggdrasil@cfca7ec

@joa-quim
Copy link
Member

PRs submitted (compat with also 8.0.1). Let's see what we get.

@boriskaus
Copy link

As long as GDAL_jll remains only compatible with the old version of libcurl I expect that issues remain.
Ideally it is only a matter to create a PR with a build that is compatible with 8.0.1

@joa-quim
Copy link
Member

Any idea on how to set a compat version range? This (in the PR) fails

image

@joa-quim
Copy link
Member

joa-quim commented Apr 15, 2023

As long as GDAL_jll remains only compatible with the old version of libcurl I expect that issues remain.

That was exactly what I thought when asked

but you saw the ( nearly incomprehensible to me, given the range of possibilities) answer.

@boriskaus
Copy link

Try leaving the compat argument out altogether

@joa-quim
Copy link
Member

joa-quim commented Apr 15, 2023

Had already tried with "7.73 - 8.0.1", which seems to have passed. Let's see.

@joa-quim
Copy link
Member

So, compat="7.73.0, 8.0.1" worked on Yggdrasil but not on the jll registry
Beautiful.

@joa-quim
Copy link
Member

joa-quim commented Apr 16, 2023

As I guessed the shit is now on GDAL side

image

and ofc, they are having exactly the same problem as we did.

@boriskaus
Copy link

Yup, you need to push an update to GDAL_jll that is compiled versus the new libcurl.

@joa-quim
Copy link
Member

GDAL is warned, now only 1656 more to go (and saying this is not a Julia problem ...)
image

@boriskaus
Copy link

It’s indeed a libcurl problem, who changed the main version number. Without that there would be no issues.

@joa-quim
Copy link
Member

Merged GMT_jll branch on master. Let's see how smooth the transition will be.

@joa-quim
Copy link
Member

GMT_jll is now the official install method. Thanks again @boriskaus

@boriskaus
Copy link

boriskaus commented May 29, 2023

great, thanks a lot!
The README.md file perhaps needs updating in this case (seems to refer to the previous way of installing this).

@joa-quim
Copy link
Member

joa-quim commented May 29, 2023

I have colleagues in Lisbon that know you. Maybe one day I'll bug you if the long intended try of Lamem ever happens. Feel free to ask if GMT can be of more help in your group of packages.

And yes, I must do some updates in the README. I've created a backdoor to allow using a local build of GMT that needs to be documented also.

@boriskaus
Copy link

For now we mostly use it in GeophysicalModelGenerator where it is already very handy to download topography datasets of a certain region. The main complaint of users was that GMT would not work; with GMT_jll that issue should hopefully be solved.

@joa-quim
Copy link
Member

BTW, I'm working on a better, or at least a GMT, version of GeogRegions.
Basically all functionality is already there, but a friendlier interface won't hurt.

@boriskaus
Copy link

boriskaus commented May 29, 2023

hmm, in fact adding GMT as a dependency causes all kinds of compatibility issues, as can be seen here. Only seems to work well on Julia 1.8.
Not sure what the best way is to solve that..

@joa-quim
Copy link
Member

joa-quim commented May 29, 2023

Yes, we know that (remember #447 (comment)).
I've opened issues in GDAL and GEOS warning about the libCURLpocalypse but nothing has happened yet.
You can only use nightly on Windows, otherwise 1.9 works fine.

And for it (nightly) to work on Windows we must manually comment the *_jll entries in Project.toml.
Btw, do you know if we can put conditional inclusions in Project.toml? Something like:

if !Sys.iswindows()
    GMT_jll = "b68b8c3f-ed99-5bef-9675-4739d9426b26"
    GDAL_jll = "a7073274-a066-55f0-b90d-d619367d196c"
    PROJ_jll = "58948b4f-47e0-5654-a9ad-f609743f8632"
    Ghostscript_jll = "61579ee1-b43e-5ca0-a5da-69d92c66a64b"
end

@boriskaus
Copy link

so it seems that this breaks my code under some circumstances. See here
The error message is:

[Session GMT (1)]: Error returned from GMT API: GMT_FILE_NOT_FOUND (16)
[1136](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1137)
Error:  [ERROR]: File /workspace/destdir/share/matlab/jet.cpt was not found
[1137](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1138)
Error:  [ERROR]: Cannot find file /workspace/destdir/share/matlab/jet.cpt
[1138](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1139)
Error:  [ERROR]: File /workspace/destdir/share/matlab/jet.cpt not found
[1139](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1140)
[Session GMT (2)]: Error returned from GMT API: GMT_FILE_NOT_FOUND (16)
[1140](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1141)
ERROR: LoadError: Something went wrong when calling the module. GMT error number = 16
[1141](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1142)
Stacktrace:
[1142](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1143)
  [1] error(s::String)
[1143](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1144)
    @ Base ./error.jl:35
[1144](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1145)
  [2] gmt(::String)
[1145](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1146)
    @ GMT ~/.julia/packages/GMT/XFncV/src/gmt_main.jl:157
[1146](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1147)
  [3] make_color_column_(d::Dict{Symbol, Any}, cmd::String, len_cmd::Int64, N_args::Int64, n_prev::Int64, is3D::Bool, got_Ebars::Bool, arg1::GMT.GMTdataset{Float64, 2}, arg2::Nothing, mz::Nothing, n_col::Int64)
[1147](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1148)
    @ GMT ~/.julia/packages/GMT/XFncV/src/psxy.jl:963
[1148](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1149)
  [4] make_color_column(d::Dict{Symbol, Any}, cmd::String, opt_i::String, len_cmd::Int64, N_args::Int64, n_prev::Int64, is3D::Bool, got_Ebars::Bool, bar_ok::Bool, bar_fill::Vector{String}, arg1::GMT.GMTdataset{Float64, 2}, arg2::Nothing)
[1149](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1150)
    @ GMT ~/.julia/packages/GMT/XFncV/src/psxy.jl:918
[1150](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1151)
  [5] common_plot_xyz(::String, ::GMT.GMTdataset{Float64, 2}, ::String, ::Bool, ::Bool, ::Pair{Symbol, Any}, ::Vararg{Pair{Symbol, Any}})
[1151](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1152)
    @ GMT ~/.julia/packages/GMT/XFncV/src/psxy.jl:198
[1152](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1153)
  [6] plot(arg1::Matrix{Float64}; first::Bool, kw::Base.Pairs{Symbol, Any, NTuple{7, Symbol}, NamedTuple{(:marker, :lc, :ls, :lw, :C, :colorbar, :Vd), Tuple{Symbol, Symbol, Symbol, Int64, Symbol, Bool, Int64}}})
[1153](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1154)
    @ GMT ~/.julia/packages/GMT/XFncV/src/plot.jl:122
[1154](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1155)
  [7] plot
[1155](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1156)
    @ ~/.julia/packages/GMT/XFncV/src/plot.jl:101 [inlined]
[1156](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1157)
  [8] macro expansion
[1157](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1158)
    @ ~/.julia/packages/GMT/XFncV/src/GMT.jl:304 [inlined]
[1158](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1159)
  [9] top-level scope
[1159](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1160)
    @ ~/.julia/packages/PrecompileTools/EqjW2/src/workloads.jl:136
[1160](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1161)
 [10] include
[1161](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1162)
    @ ./Base.jl:457 [inlined]
[1162](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1163)
 [11] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
[1163](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1164)
    @ Base ./loading.jl:2010
[1164](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1165)
 [12] top-level scope
[1165](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1166)
    @ stdin:2
[1166](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1167)
in expression starting at /home/runner/.julia/packages/GMT/XFncV/src/GMT.jl:1
[1167](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1168)
in expression starting at stdin:2
[1168](https://github.com/UniMainzGeo/LaMEM/actions/runs/5115221683/jobs/9196712488#step:6:1169)
ERROR: LoadError: Failed to precompile GMT [5752ebe1-31b9-557e-87aa-f909b540aa54] to "/home/runner/.julia/compiled/v1.9/GMT/jl_ArD7HE".

@joa-quim
Copy link
Member

So it's not finding /workspace/destdir/share/matlab/jet.cpt but how comes it is looking for jet.cpt in that directory. Its location is

.julia\artifacts\49ddd67a39d3e0f2c7e309821ec74e592b3c8dda\share\cpt\matlab

does this also fail?
makecpt(:jet)

Any way to reproduce this?

@boriskaus
Copy link

I can't reproduce this locally, only under the CI pipeline which makes debugging rather difficult

@joa-quim
Copy link
Member

That's what I feared. GMT looks for an environment variable called GMT6_SHAREDIR or GMT_SHAREDIR to point to other than the default share dir. Is it possible that something in that action sets this env var.
Can you add a printenv | grep GMT6_SH in the action to see if something pops up?

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