GMT wrapper

67 views
Skip to first unread message

J Luis

unread,
Nov 12, 2015, 8:53:20 PM11/12/15
to julia-geo
Hi,

I would like to invite you to test the GMT wrapper. Note that it's not yet a registered package so one presumably has to install it with

Pkg.clone(“git://github.com/joa-quim/GMT.jl.git”)

I say presumably because never tried it like that.

Also, it needs the freshy freshy just released GMT5.2 and its shared libs must be in user's path. Also want to add that I only tested it on Windows.

Joaquim

Fabian Gans

unread,
Nov 13, 2015, 8:37:06 AM11/13/15
to julia-geo
Thanks for sharing,

I am currently trying to get the package running on MacOS, but still with no success with linking libgmt 5.2.
Are there Mac Users out there who were successful? This is what I tried:

First I tried to install the dmg and then add my /Applications/GMT-5.2.1.app/Contents/Resources/lib/ to Libdl.DL_LOAD_PATH which made julia find libgmt.dylib but not libnetcdf.7.dylib, which is in the same directory.

I also tried building GMT from source but am still having trouble setting CofigUser.cmake to point to the correct libnetcdf.

Installing through MacPorts is not possible yet, beacause it only supports GMT5.1.

Any ideas?

J Luis

unread,
Nov 13, 2015, 9:16:58 AM11/13/15
to julia-geo
Fabian,

Sorry if can't give you much help for your setting. Finding libs in OSX is a damn night mare with the story of the libs carrying hardwired the location where they were built). What I can tell you is that I built GMT5.2 several times from source and didn't have to tell cmake where netcdf was (nor the rest of its dependencies btw) ... but I use Homebrew.

You may also want to ask this question in the GMT forum since there are many OSX users there (devs included)

Joaquim

J Luis

unread,
Nov 17, 2015, 9:16:19 AM11/17/15
to julia-geo
Fabien, I cannot even make it find libgmt.dylib. How did you you add the lib to Libdl.DL_LOAD_PATH?

I only manage to get errors

julia> push!(DL_LOAD_PATH, "/Users/j/programs/gmt5/lib")
ERROR: UndefVarError: DL_LOAD_PATH not defined

julia> Libdl.DL_LOAD_PATH="/Users/j/programs/gmt5/lib"
ERROR: cannot assign variables in other modules

julia> Libdl.DL_LOAD_PATH
2-element Array{ByteString,1}:
 "@executable_path/../lib/julia"
 "@executable_path/../lib"

(ghrr, things on unix are sooo complicated)

Fabian Gans

unread,
Nov 17, 2015, 9:33:33 AM11/17/15
to julia-geo
One combination you did not try:

julia> push!(Libdl.DL_LOAD_PATH, "/Users/j/programs/gmt5/lib")

I did not have time yet to try Homebrew, but hope to do soon...

J Luis

unread,
Nov 17, 2015, 10:12:26 AM11/17/15
to julia-geo
Thanks. There must be a easier way of configuring things on unix but this one works. I mean the wrapper works for me.
There is one PR to update the Homebrew GMT5 formula waiting for merging. When available I hope that brew users won't have to do no extra configs but we'll have to wait and see.
I think it worked for me because homebrew installs in /usr/local/lib that has system visibility and hence all libgmt dependencies where found.

Fabian Gans

unread,
Nov 18, 2015, 4:42:08 AM11/18/15
to julia-geo
Thanks for investigating. The method that worked for me was to add the gmt.rb formula to .julia/v0.4/Homebrew/deps/usr/Library/Formula/ I modified the formula so that it downloads the most recent version of GMT and then

using Homebrew
Homebrew.add("gmt")
using GMT

just worked. If you want to, I can create an issue at Homebrew.jl to include the GMT formula.
The interface looks very promising, I will try it during the next days....

J Luis

unread,
Nov 18, 2015, 9:11:18 AM11/18/15
to julia-geo
Fabian, there is already a PR at Homebrew to update the formula to GMT5.2.1

https://github.com/Homebrew/homebrew-science/pull/3012

don't know how that would play with one at Homebrew.jl. Actually I never investigated Homebrew.jl (I go very rarely to the MacSide of my computer) and it puzzles me to have brew universe inside .julia

Thanks for testing. There is one serious issue with the wrapper that is the fact that it, not very often, randomly crashes. I suspect it has to do with the fact that I use 'pointer()' at several instances and Jameson warned be against using it. But I simply can't make it work with Ref{}s. Everything I try errors. So help on this is much well come.
Reply all
Reply to author
Forward
0 new messages