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

GMT.jl v1.18.0 precompile failed under macOS Sonoma 14.7 #1542

Closed
melodyjulia opened this issue Sep 25, 2024 · 16 comments
Closed

GMT.jl v1.18.0 precompile failed under macOS Sonoma 14.7 #1542

melodyjulia opened this issue Sep 25, 2024 · 16 comments

Comments

@melodyjulia
Copy link

Please see the following error message:

ERROR: The following 1 direct dependency failed to precompile:

GMT [5752ebe1-31b9-557e-87aa-f909b540aa54]

Failed to precompile GMT [5752ebe1-31b9-557e-87aa-f909b540aa54] to "/Users/test/.julia/compiled/v1.10/GMT/jl_IEFmYy".
grdimage [ERROR]: Option -R parsing failure. Correct syntax:

  -R<west>/<east>/<south>/<north>[+r]
     Specify the min/max coordinates of your data region in user units. Use dd:mm[:ss] for regions given in arc degrees, minutes [and seconds]. Use -R<xmin>/<xmax>/<ymin>/<ymax>[+u<unit>] for regions given in projected coordinates, with <unit>
     selected from e|f|k|M|n|u [Default: e]. If +u is set, projected regions centered on (0,0) may be set via -R<halfwidth>[/<halfheight>]+u<unit>, where <halfheight> defaults to <halfwidth> if not given. Use [yyyy[-mm[-dd]]]T[hh[:mm[:ss[.xxx]]]]
     format for time axes. Append +r if -R specifies the coordinates of the lower left and upper right corners of a rectangular area.
     Alternatively, use -R<code><x0>/<y0>/<n_columns>/<n_rows> for origin and grid dimensions, where <code> is a 2-char combo from [T|M|B][L|C|R] (top/middle/bottom/left/center/right) and grid spacing must be specified via -I<dx>[/<dy>] (also see
     -r).
grdimage [ERROR]: Offending option -R32/1.976262583365e-323/3.024720436637e-314/1.976262583365e-323
ERROR: LoadError: Something went wrong when calling the module. GMT error number = 72
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] gmt(::String, ::GMT.GMTgrid{Float32, 2}, ::Vararg{Any})
    @ GMT ~/.julia/packages/GMT/XumeP/src/gmt_main.jl:170
  [3] finish_PS_module(::Dict{Symbol, Any}, ::Vector{String}, ::String, ::Bool, ::Bool, ::Bool, ::GMT.GMTgrid{Float32, 2}, ::Vararg{Any})
    @ GMT ~/.julia/packages/GMT/XumeP/src/common_options.jl:4449
  [4] grdimage(cmd0::String, arg1::Matrix{Float32}, arg2::Nothing, arg3::Nothing; first::Bool, kwargs::@Kwargs{})
    @ GMT ~/.julia/packages/GMT/XumeP/src/grdimage.jl:145
  [5] grdimage
    @ ~/.julia/packages/GMT/XumeP/src/grdimage.jl:51 [inlined]
  [6] grdimage (repeats 2 times)
    @ ~/.julia/packages/GMT/XumeP/src/grdimage.jl:225 [inlined]
  [7] macro expansion
    @ ~/.julia/packages/GMT/XumeP/src/GMT.jl:352 [inlined]
  [8] macro expansion
    @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:140 [inlined]
  [9] top-level scope
    @ ~/.julia/packages/GMT/XumeP/src/GMT.jl:332
 [10] include
    @ ./Base.jl:495 [inlined]
 [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::Nothing)
    @ Base ./loading.jl:2222
 [12] top-level scope
    @ stdin:3
@melodyjulia melodyjulia changed the title GMT.jl v1.18 precompile failed on macOS Sonoma 14.7 GMT.jl v1.18 precompile failed under macOS Sonoma 14.7 Sep 25, 2024
@melodyjulia melodyjulia changed the title GMT.jl v1.18 precompile failed under macOS Sonoma 14.7 GMT.jl v1.18.0 precompile failed under macOS Sonoma 14.7 Sep 25, 2024
@joa-quim
Copy link
Member

Sorry for that. But it is most weird. I've run the CI tests many times and they all build fine on MacOS too. Can you please try the master version to see if the problem persists?

@melodyjulia
Copy link
Author

yes, the master version also fails.

[5752ebe1] GMT v1.18.0 `https://github.com/GenericMappingTools/GMT.jl#master`
ERROR: The following 1 direct dependency failed to precompile:

GMT [5752ebe1-31b9-557e-87aa-f909b540aa54]

Failed to precompile GMT [5752ebe1-31b9-557e-87aa-f909b540aa54] to "/Users/test/.julia/compiled/v1.10/GMT/jl_cB66kl".
grdimage [ERROR]: Option -R parsing failure. Correct syntax:

  -R<west>/<east>/<south>/<north>[+r]
     Specify the min/max coordinates of your data region in user units. Use dd:mm[:ss] for regions given in arc degrees, minutes [and seconds]. Use -R<xmin>/<xmax>/<ymin>/<ymax>[+u<unit>] for regions given in projected coordinates, with <unit> selected from e|f|k|M|n|u [Default: e]. If +u is set, projected regions centered on (0,0) may be set via -R<halfwidth>[/<halfheight>]+u<unit>, where <halfheight> defaults to <halfwidth> if not given. Use [yyyy[-mm[-dd]]]T[hh[:mm[:ss[.xxx]]]] format for time axes. Append +r if -R specifies the coordinates of the lower left and upper right corners of a rectangular area.
     Alternatively, use -R<code><x0>/<y0>/<n_columns>/<n_rows> for origin and grid dimensions, where <code> is a 2-char combo from [T|M|B][L|C|R] (top/middle/bottom/left/center/right) and grid spacing must be specified via -I<dx>[/<dy>] (also see -r).
grdimage [ERROR]: Offending option -R32/1.976262583365e-323/3.0137358079401e-314/1.976262583365e-323
ERROR: LoadError: Something went wrong when calling the module. GMT error number = 72
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] gmt(::String, ::GMT.GMTgrid{Float32, 2}, ::Vararg{Any})
    @ GMT ~/.julia/packages/GMT/kzp1T/src/gmt_main.jl:170
  [3] finish_PS_module(::Dict{Symbol, Any}, ::Vector{String}, ::String, ::Bool, ::Bool, ::Bool, ::GMT.GMTgrid{Float32, 2}, ::Vararg{Any})
    @ GMT ~/.julia/packages/GMT/kzp1T/src/common_options.jl:4449
  [4] grdimage(cmd0::String, arg1::Matrix{Float32}, arg2::Nothing, arg3::Nothing; first::Bool, kwargs::@Kwargs{})
    @ GMT ~/.julia/packages/GMT/kzp1T/src/grdimage.jl:145
  [5] grdimage
    @ ~/.julia/packages/GMT/kzp1T/src/grdimage.jl:51 [inlined]
  [6] grdimage (repeats 2 times)
    @ ~/.julia/packages/GMT/kzp1T/src/grdimage.jl:225 [inlined]
  [7] macro expansion
    @ ~/.julia/packages/GMT/kzp1T/src/GMT.jl:357 [inlined]
  [8] macro expansion
    @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:140 [inlined]
  [9] top-level scope
    @ ~/.julia/packages/GMT/kzp1T/src/GMT.jl:337
 [10] include
    @ ./Base.jl:495 [inlined]
 [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::Nothing)
    @ Base ./loading.jl:2222
 [12] top-level scope
    @ stdin:3

@joa-quim
Copy link
Member

joa-quim commented Sep 26, 2024

Hmm, there is something to learn form this failure example. As I ssaid the CI tests run fine on MacOS so this has to be something local.

Can you check if you have these files, gmt.conf and/or gmt.history in the directory from which you are running julia when the error occurs, and if yes delete them and try again.

@melodyjulia
Copy link
Author

melodyjulia commented Sep 26, 2024

There is no gmt.conf, but gmt.history does exist. I deleted gmt.history and tried again, precompile fails with the same error message.

@joa-quim
Copy link
Member

OK, I changed slightly the precompiling command that is failing (added a explicit limits option) and committed it. Try updating again. It should not fail for the same reason, but who knows what it can invent now.

@melodyjulia
Copy link
Author

It works now. Thank you very much!
By the way, is it possible that this is related to macOS running on an ARM core?

@joa-quim
Copy link
Member

I have no idea at all why it fails only for you (that I know of) and would like to find the cause but I'm afraid that for now only you can do it (this error may resurface again under other circumstances).

Does this now works or it gives a similar error?

grdimage(rand(Float32,32,32))

@melodyjulia
Copy link
Author

melodyjulia commented Sep 27, 2024

No, it does not work:

makecpt [ERROR]: Option T: min >= max
ERROR: Something went wrong when calling the module. GMT error number = 72
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] gmt(::String)
    @ GMT ~/.julia/packages/GMT/kHXP0/src/gmt_main.jl:170
  [3] (::GMT.var"#equalize#249")(d::Dict{Symbol, Any}, arg1::GMTgrid{Float32, 2}, cptname::String, opt_T::String)
    @ GMT ~/.julia/packages/GMT/kHXP0/src/common_options.jl:2561
  [4] add_opt_cpt(d::Dict{…}, cmd::String, symbs::Matrix{…}, opt::Char, N_args::Int64, arg1::GMTgrid{…}, arg2::Nothing, store::Bool, def::Bool, opt_T::String, in_bag::Bool)
    @ GMT ~/.julia/packages/GMT/kHXP0/src/common_options.jl:2594
  [5] get_cpt_set_R(d::Dict{Symbol, Any}, cmd0::String, cmd::String, opt_R::String, got_fname::Int64, arg1::GMTgrid{Float32, 2}, arg2::Nothing, arg3::Nothing, prog::String)
    @ GMT ~/.julia/packages/GMT/kHXP0/src/common_options.jl:2733
  [6] common_get_R_cpt
    @ ~/.julia/packages/GMT/kHXP0/src/common_options.jl:4883 [inlined]
  [7] grdimage(cmd0::String, arg1::Matrix{Float32}, arg2::Nothing, arg3::Nothing; first::Bool, kwargs::@Kwargs{})
    @ GMT ~/.julia/packages/GMT/kHXP0/src/grdimage.jl:117
  [8] grdimage
    @ ~/.julia/packages/GMT/kHXP0/src/grdimage.jl:51 [inlined]
  [9] grdimage
    @ ~/.julia/packages/GMT/kHXP0/src/grdimage.jl:225 [inlined]
 [10] grdimage(arg1::Matrix{Float32})
    @ GMT ~/.julia/packages/GMT/kHXP0/src/grdimage.jl:225
 [11] top-level scope
    @ REPL[1]:1
Some type information was truncated. Use `show(err)` to see complete types.

@ZMAlt
Copy link
Contributor

ZMAlt commented Sep 27, 2024

Hi, both. There is also a precompile error in my private repo CI. I think it's related to this issue. The report is as follows.

OS of CI: macos lastest.

Error: image [ERROR]: Option -R parsing failure. Correct syntax:

  -R<west>/<east>/<south>/<north>[+r]
     Specify the min/max coordinates of your data region in user units. Use dd:mm[:ss] for regions given in arc degrees, minutes [and seconds]. Use -R<xmin>/<xmax>/<ymin>/<ymax>[+u<unit>] for regions given in projected coordinates, with <unit> selected from e|f|k|M|n|u [Default: e]. If +u is set, projected regions centered on (0,0) may be set via -R<halfwidth>[/<halfheight>]+u<unit>, where <halfheight> defaults to <halfwidth> if not given. Use [yyyy[-mm[-dd]]]T[hh[:mm[:ss[.xxx]]]] format for time axes. Append +r if -R specifies the coordinates of the lower left and upper right corners of a rectangular area.
     Alternatively, use -R<code><x0>/<y0>/<n_columns>/<n_rows> for origin and grid dimensions, where <code> is a 2-char combo from [T|M|B][L|C|R] (top/middle/bottom/left/center/right) and grid spacing must be specified via -I<dx>[/<dy>] (also see -r).
Error: image [ERROR]: Offending option -R32/1.976262583365e-323/3.0318073854064e-314/1.976262583365e-323
ERROR: LoadError: Something went wrong when calling the module. GMT error number = 72
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] gmt(::String, ::GMT.GMTgrid{Float32, 2}, ::Vararg{Any})
    @ GMT ~/.julia/packages/GMT/XumeP/src/gmt_main.jl:170
  [3] finish_PS_module(::Dict{Symbol, Any}, ::Vector{String}, ::String, ::Bool, ::Bool, ::Bool, ::GMT.GMTgrid{Float32, 2}, ::Vararg{Any})
    @ GMT ~/.julia/packages/GMT/XumeP/src/common_options.jl:4449
  [4] grdimage(cmd0::String, arg1::Matrix{Float32}, arg2::Nothing, arg3::Nothing; first::Bool, kwargs::@Kwargs{})
    @ GMT ~/.julia/packages/GMT/XumeP/src/grdimage.jl:145
  [5] grdimage
    @ ~/.julia/packages/GMT/XumeP/src/grdimage.jl:51 [inlined]
  [6] grdimage (repeats 2 times)
    @ ~/.julia/packages/GMT/XumeP/src/grdimage.jl:225 [inlined]
  [7] macro expansion
    @ ~/.julia/packages/GMT/XumeP/src/GMT.jl:352 [inlined]
  [8] macro expansion
    @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:140 [inlined]
  [9] top-level scope
    @ ~/.julia/packages/GMT/XumeP/src/GMT.jl:332
 [10] include
    @ ./Base.jl:495 [inlined]
 [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)
    @ Base ./loading.jl:2222
 [12] top-level scope
    @ stdin:3
in expression starting at /Users/runner/.julia/packages/GMT/XumeP/src/GMT.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile GMT [5752ebe1-31b9-557e-87aa-f909b540aa54] to "/Users/runner/.julia/compiled/v1.10/GMT/jl_NSvxDa".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:2468
  [3] compilecache
    @ ./loading.jl:2340 [inlined]
  [4] (::Base.var"#968#969"{Base.PkgId})()
    @ Base ./loading.jl:1974
  [5] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile ~/hostedtoolcache/julia/1.10.5/aarch64/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
  [6] #mkpidlock#6
    @ ~/hostedtoolcache/julia/1.10.5/aarch64/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
  [7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
    @ FileWatching.Pidfile ~/hostedtoolcache/julia/1.10.5/aarch64/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
  [8] #invokelatest#2
    @ ./essentials.jl:894 [inlined]
  [9] invokelatest
    @ ./essentials.jl:889 [inlined]
 [10] maybe_cachefile_lock(f::Base.var"#968#969"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base ./loading.jl:2983
 [11] maybe_cachefile_lock
    @ ./loading.jl:2980 [inlined]
 [12] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1970
 [13] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1812
 [14] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [15] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [16] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1803
 [17] macro expansion
    @ ./loading.jl:1790 [inlined]
 [18] macro expansion
    @ ./lock.jl:267 [inlined]
 [19] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1753
 [20] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [21] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [22] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1746
 [23] include
    @ ./Base.jl:495 [inlined]
 [24] 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::Nothing)
    @ Base ./loading.jl:2222
 [25] top-level scope
    @ stdin:3
in expression starting at /Users/runner/work/Project/Project/GeoSubs/src/GeoSubs.jl:1
in expression starting at stdin:3
  ✗ GeoSubs
  95 dependencies successfully precompiled in 72 seconds. 8 already precompiled.

ERROR: LoadError: The following 1 direct dependency failed to precompile:

GeoSubs [d0309c17-d891-4dc0-a6e9-907595b5e534]

Failed to precompile GeoSubs [d0309c17-d891-4dc0-a6e9-907595b5e534] to "/Users/runner/.julia/compiled/v1.10/GeoSubs/jl_aojIpT".
Error: e [ERROR]: Option -R parsing failure. Correct syntax:

  -R<west>/<east>/<south>/<north>[+r]
     Specify the min/max coordinates of your data region in user units. Use dd:mm[:ss] for regions given in arc degrees, minutes [and seconds]. Use -R<xmin>/<xmax>/<ymin>/<ymax>[+u<unit>] for regions given in projected coordinates, with <unit> selected from e|f|k|M|n|u [Default: e]. If +u is set, projected regions centered on (0,0) may be set via -R<halfwidth>[/<halfheight>]+u<unit>, where <halfheight> defaults to <halfwidth> if not given. Use [yyyy[-mm[-dd]]]T[hh[:mm[:ss[.xxx]]]] format for time axes. Append +r if -R specifies the coordinates of the lower left and upper right corners of a rectangular area.
     Alternatively, use -R<code><x0>/<y0>/<n_columns>/<n_rows> for origin and grid dimensions, where <code> is a 2-char combo from [T|M|B][L|C|R] (top/middle/bottom/left/center/right) and grid spacing must be specified via -I<dx>[/<dy>] (also see -r).
Error: e [ERROR]: Offending option -R32/1.976262583[365](https://github.com/ZMAlt/Project/actions/runs/11030713129/job/30635888040?pr=34#step:4:366)e-323/3.0318073854064e-314/1.976262583365e-323
ERROR: LoadError: Something went wrong when calling the module. GMT error number = 72
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] gmt(::String, ::GMT.GMTgrid{Float32, 2}, ::Vararg{Any})
    @ GMT ~/.julia/packages/GMT/XumeP/src/gmt_main.jl:170
  [3] finish_PS_module(::Dict{Symbol, Any}, ::Vector{String}, ::String, ::Bool, ::Bool, ::Bool, ::GMT.GMTgrid{Float32, 2}, ::Vararg{Any})
    @ GMT ~/.julia/packages/GMT/XumeP/src/common_options.jl:4449
  [4] grdimage(cmd0::String, arg1::Matrix{Float32}, arg2::Nothing, arg3::Nothing; first::Bool, kwargs::@Kwargs{})
    @ GMT ~/.julia/packages/GMT/XumeP/src/grdimage.jl:145
  [5] grdimage
    @ ~/.julia/packages/GMT/XumeP/src/grdimage.jl:51 [inlined]
  [6] grdimage (repeats 2 times)
    @ ~/.julia/packages/GMT/XumeP/src/grdimage.jl:225 [inlined]
  [7] macro expansion
    @ ~/.julia/packages/GMT/XumeP/src/GMT.jl:352 [inlined]
  [8] macro expansion
    @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:140 [inlined]
  [9] top-level scope
    @ ~/.julia/packages/GMT/XumeP/src/GMT.jl:332
 [10] include
    @ ./Base.jl:495 [inlined]
 [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)
    @ Base ./loading.jl:2222
 [12] top-level scope
    @ stdin:3
in expression starting at /Users/runner/.julia/packages/GMT/XumeP/src/GMT.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile GMT [5752ebe1-31b9-557e-87aa-f909b540aa54] to "/Users/runner/.julia/compiled/v1.10/GMT/jl_NSvxDa".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:2468
  [3] compilecache
    @ ./loading.jl:2340 [inlined]
  [4] (::Base.var"#968#969"{Base.PkgId})()
    @ Base ./loading.jl:1974
  [5] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile ~/hostedtoolcache/julia/1.10.5/aarch64/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
  [6] #mkpidlock#6
    @ ~/hostedtoolcache/julia/1.10.5/aarch64/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
  [7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
    @ FileWatching.Pidfile ~/hostedtoolcache/julia/1.10.5/aarch64/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
  [8] #invokelatest#2
    @ ./essentials.jl:894 [inlined]
  [9] invokelatest
    @ ./essentials.jl:889 [inlined]
 [10] maybe_cachefile_lock(f::Base.var"#968#969"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base ./loading.jl:2983
 [11] maybe_cachefile_lock
    @ ./loading.jl:2980 [inlined]
 [12] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1970
 [13] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1812
 [14] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [15] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [16] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1803
 [17] macro expansion
    @ ./loading.jl:1790 [inlined]
 [18] macro expansion
    @ ./lock.jl:267 [inlined]
 [19] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1753
 [20] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [21] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [22] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1746
 [23] include
    @ ./Base.jl:495 [inlined]
 [24] 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::Nothing)
    @ Base ./loading.jl:2222
 [25] top-level scope
    @ stdin:3
in expression starting at /Users/runner/work/Project/Project/GeoSubs/src/GeoSubs.jl:1
in expression starting at stdin:
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types ~/hostedtoolcache/julia/1.10.5/aarch64/share/julia/stdlib/v1.10/Pkg/src/Types.jl:70
 [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, _from_loading::Bool, kwargs::@Kwargs{io::IOContext{Base.PipeEndpoint}})
   @ Pkg.API ~/hostedtoolcache/julia/1.10.5/aarch64/share/julia/stdlib/v1.10/Pkg/src/API.jl:1700
 [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::IOContext{Base.PipeEndpoint}, kwargs::@Kwargs{})
   @ Pkg.API ~/hostedtoolcache/julia/1.10.5/aarch64/share/julia/stdlib/v1.10/Pkg/src/API.jl:159
 [4] precompile(pkgs::Vector{Pkg.Types.PackageSpec})
   @ Pkg.API ~/hostedtoolcache/julia/1.10.5/aarch64/share/julia/stdlib/v1.10/Pkg/src/API.jl:148
 [5] precompile
   @ ~/hostedtoolcache/julia/1.10.5/aarch64/share/julia/stdlib/v1.10/Pkg/src/API.jl:147 [inlined]
 [6] precompile(pkg::String)
   @ Pkg.API ~/hostedtoolcache/julia/1.10.5/aarch64/share/julia/stdlib/v1.10/Pkg/src/API.jl:146
 [7] top-level scope
   @ ~/work/_temp/5c6a7573-190d-[407](https://github.com/ZMAlt/Project/actions/runs/11030713129/job/30635888040?pr=34#step:4:408)0-977b-958f2cf09d53:21
in expression starting at /Users/runner/work/_temp/5c6a7573-190d-4070-977b-958f2cf09d53:19
Error: Process completed with exit code 1.

@joa-quim
Copy link
Member

joa-quim commented Sep 27, 2024 via email

@ZMAlt
Copy link
Contributor

ZMAlt commented Sep 27, 2024

Something is wrong in these lines, but I don't know why.

GMT.jl/src/common_options.jl

Lines 2699 to 2701 in 95a6da2

if (opt_R == "" && (!IamModern[1] || (IamModern[1] && FirstModern[1])) ) # No -R ovewrite by accident
cmd *= sprintf(" -R%.14g/%.14g/%.14g/%.14g", range[1], range[2], range[3], range[4])
end

julia> grdimage(rand(Float32,32,32))
(range, cmd) = ([1.0, 32.0, 1.0, 32.0, 0.0007270574569702148, 0.9993302226066589], " -JX15c/0 -Baf -BWSen -n+a")
cmd = " -JX15c/0 -Baf -BWSen -n+a -R32/3.0491549511702e-314/0/3.0785113476674e-314"

@joa-quim
Copy link
Member

No, that is not the original problem. That error happens when makecpt tries to make color map out of a nonsense limits.
The problem is that in the failing cases you don't get this as it should be

grdimage(rand(Float32,32,32), Vd=2)
"grdimage  -JX15c/0 -Baf -BWSen -n+a -R1/32/1/32 -C -P -K > c:\\TMP/GMTjl_j.ps"

@joa-quim
Copy link
Member

Can you please see what happen at this line?
https://github.com/GenericMappingTools/GMT.jl/blob/master/src/utils_types.jl#L2166

The error originates in the fact that it's failing to generate the right x,y coordinate vectors. Here both nx and ny should be equal to 32.

@ZMAlt
Copy link
Contributor

ZMAlt commented Sep 29, 2024

This line is good.

julia> grdimage(rand(Float32,32,32), Vd=2)
(nx, ny) = (32, 32)
x = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0]
y = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0]
(range, cmd) = ([1.0, 32.0, 1.0, 32.0, 0.0007783174514770508, 0.997594952583313], " -JX15c/0 -Baf -BWSen -n+a")
cmd = " -JX15c/0 -Baf -BWSen -n+a -R32/3.0454798774601e-314/0/3.1242331785699e-314"
(cmd, "34") = (" -JX15c/0 -Baf -BWSen -n+a -R32/3.0454798774601e-314/0/3.1242331785699e-314", "34")
makecpt [ERROR]: Option T: min >= max
ERROR: Something went wrong when calling the module. GMT error number = 72
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] gmt(::String)
    @ GMT ~/.julia/dev/GMT/src/gmt_main.jl:170
  [3] (::GMT.var"#equalize#249")(d::Dict{Symbol, Any}, arg1::GMTgrid{Float32, 2}, cptname::String, opt_T::String)
    @ GMT ~/.julia/dev/GMT/src/common_options.jl:2561
  [4] add_opt_cpt(d::Dict{Symbol, Any}, cmd::String, symbs::Matrix{Symbol}, opt::Char, N_args::Int64, arg1::GMTgrid{Float32, 2}, arg2::Nothing, store::Bool, def::Bool, opt_T::String, in_bag::Bool)
    @ GMT ~/.julia/dev/GMT/src/common_options.jl:2594
  [5] get_cpt_set_R(d::Dict{Symbol, Any}, cmd0::String, cmd::String, opt_R::String, got_fname::Int64, arg1::GMTgrid{Float32, 2}, arg2::Nothing, arg3::Nothing, prog::String)
    @ GMT ~/.julia/dev/GMT/src/common_options.jl:2736
  [6] common_get_R_cpt
    @ ~/.julia/dev/GMT/src/common_options.jl:4886 [inlined]
  [7] grdimage(cmd0::String, arg1::Matrix{Float32}, arg2::Nothing, arg3::Nothing; first::Bool, kwargs::@Kwargs{Vd::Int64})
    @ GMT ~/.julia/dev/GMT/src/grdimage.jl:117
  [8] grdimage
    @ ~/.julia/dev/GMT/src/grdimage.jl:51 [inlined]
  [9] grdimage
    @ ~/.julia/dev/GMT/src/grdimage.jl:225 [inlined]
 [10] top-level scope
    @ REPL[3]:1

(gmt_test) pkg> st
Status `~/Desktop/gmt_test/Project.toml`
  [5752ebe1] GMT v1.18.0 `~/.julia/dev/GMT`

@ZMAlt
Copy link
Contributor

ZMAlt commented Sep 29, 2024

I think the original problem is about sprintf function. This function produces wrong results of -R and -T options.
If I replace this funciton with @sprintf of Printf package, it works.

@joa-quim
Copy link
Member

Fixed.

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