Installed GMT.jl package and GMT v6.1.1 for Windows 64 bit. How can I start working with GMT package?

I installed GMT.jl package and installed GMT for 64 bit Windows. Added GMT to PATH also. From Windows command prompt I can run gmt, it is showing list of options:

But in Julia, it cannot detect gmt, showing message:

julia> using GMT

You don't seem to have GMT installed and I don't install it automatically.
You will have to do it yourself.
Download and install the official version at (the '..._win64.exe':
                 https://github.com/GenericMappingTools/gmt/releases

Can anyone please figure out? Is there anything else I need to do to start using GMT.jl module?

Ok, my guess is that you made previous attempts to using GMT while the GMT itself was not in the path (the NSIS installer software has a dumb bug and is not able to update paths that are longer than 1024 characters or so. Nothing I can do about it) and now it remembers that. Try this

run(`touch $(pathof(GMT))`)

and then start a new Julia session.

FYI, the master version of GMT.jl now tries to automatically install GMT via Conda (on unix) or that same installer on Windows.

@joa-quim Thank you for your response and for this information.
But for me, this line of code did not work. :slight_smile:

Yes indeed, initially when I installed GMT.jl package and tried using GMT, GMT was not installed and set to the PATH in computer, later I did that. I don’t know where/when exactly I did any wrong!

I removed GMT.jl package from Julia and reinstalled. Still Julia cannot detect GMT in computer, showing same message.

That is very strange. If GMT is in the path Julia will find it. The run(touch.. was only to force a new precompile. What does this print?

readlines(`gmt --version`)

In REPL it prints:

julia> readlines(`gmt --version`)
1-element Vector{String}:
 "6.1.1"

And if I run that line of code it throws error as below:

julia> run(`touch $(pathof(GMT))`)
ERROR: IOError: could not spawn `touch 'C:\Users\...\.julia\packages\GMT\wprG1\src\GMT.jl'`: no such file or directory (ENOENT)

Ok, so it found GMT but one need to force a rebuild to update that info in the prebuild cache (that was the intention of the toutch command but I forgot that it only works with dev'd versions).

Delete all files you find in .julia/compiled/v1.6/GMT/. This will force a rebuild.

1 Like

@joa-quim Thank you so much! It worked actually.
I can load and use GMT.jl module now without facing any warning/error. :slight_smile: