Closed ZMAlt closed 3 years ago
Hi, Does your GMT installation works outside of Juia? I mean, from the command line. How did you install GMT?
I'm asking this because from the error message the problem seems to be that there is dependency conflict between the libcurl expected by GMT (requires version 10.0.0 or later
) and that firstly found in your system (but libcurl.4.dylib provides version 7.0.0
)
Hi. I download gmt DMG
from Github and add it to my PATH
. Is there any problem ?
export PATH="/Applications/GMT-6.0.0rc4.app/Contents/Resources/bin/:$PATH"
No, it should be fine.
@PaulWessel, @seisman Any idea where this libcurl dependency conflict is coming from in the GMT dmg?
But you didn’t answer. Does it work when you run gmt from the bash shell?
Sent from my iDedo
No dia 17/09/2019, às 02:23, Mao Zhou notifications@github.com escreveu:
Hi. I download gmt DMG from Github and add it to my PATH. Is there any problem ?
export PATH="/Applications/GMT-6.0.0rc4.app/Contents/Resources/bin/:$PATH" — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
of course
~ $ gmt
GMT - The Generic Mapping Tools, Version 6.0.0rc4 [64-bit] [4 cores]
(c) 1991-2019 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 LGP License (http://www.gnu.org/licenses/lgpl.html).
usage: gmt [options]
gmt <module name> [<module-options>]
options:
--help List descriptions of available GMT modules.
--new-script Write GMT modern mode script template to stdout.
--show-bindir Show directory with GMT executables.
--show-citation Show the most recent citation for GMT.
--show-cores Show number of available cores.
--show-datadir Show directory/ies with user data.
--show-dataserver Show URL of the remote GMT data server.
--show-doi Show the DOI for the current release.
--show-modules Show all module names.
--show-library Show path of the shared GMT library.
--show-plugindir Show directory for plug-ins.
--show-sharedir Show directory for shared GMT resources.
--version Print GMT version number.
if <module-options> is '=' we call exit (0) if module exist and non-zero otherwise.
macOS ships its own libcurl. Maybe GMT.jl found the system libcurl first.
$ otool -L /usr/lib/libcurl.4.dylib
/usr/lib/libcurl.4.dylib:
/usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 9.0.0)
/usr/lib/libcrypto.42.dylib (compatibility version 43.0.0, current version 43.0.0)
/usr/lib/libssl.44.dylib (compatibility version 45.0.0, current version 45.1.0)
/System/Library/Frameworks/LDAP.framework/Versions/A/LDAP (compatibility version 1.0.0, current version 2.4.0)
/System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos (compatibility version 5.0.0, current version 6.0.0)
/usr/lib/libapple_nghttp2.dylib (compatibility version 1.0.0, current version 1.24.1)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
$ otool -L /Applications/GMT-6.0.0rc4.app/Contents/Resources/lib/libcurl.4.dylib
/Applications/GMT-6.0.0rc4.app/Contents/Resources/lib/libcurl.4.dylib:
@executable_path/../lib/libcurl.4.dylib (compatibility version 10.0.0, current version 10.0.0)
@executable_path/../lib/libidn2.0.dylib (compatibility version 4.0.0, current version 4.6.0)
@executable_path/../lib/libpsl.5.dylib (compatibility version 9.0.0, current version 9.2.0)
@executable_path/../lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/../lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/../lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
I have a slightly different error with the same commands:
julia> using Libdl
julia> push!(Libdl.DL_LOAD_PATH, "/Applications/GMT-6.0.0rc4.app/Contents/Resources/lib")
julia> using GMT
julia> coast(region=:global, proj=:Winkel, frame=:g, area=10000,
land=:burlywood4, water=:wheat1, figsize=12, show=true)
ERROR: error compiling finish_PS_module: error compiling gmt: could not load library "libgmt"
dlopen(/Applications/GMT-6.0.0rc4.app/Contents/Resources/lib/libgmt.dylib, 1): Library not loaded: @executable_path/../lib/libgdal.26.dylib
Referenced from: /Applications/GMT-6.0.0rc4.app/Contents/Resources/lib/libgmt.dylib
Reason: image not found
That’s kind of what I thought. But why isn’t the libgmt.dylib pointing to the GMT’s libcurl? That’s the idea of having a bundle.
Can you please run otool on the libgmt.dylib?
Sent from my iDedo
No dia 17/09/2019, às 14:35, Dongdong Tian notifications@github.com escreveu:
macOS ships its own libcurl. Maybe GMT.jl found the system libcurl first.
$ otool -L /usr/lib/libcurl.4.dylib /usr/lib/libcurl.4.dylib: /usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 9.0.0) /usr/lib/libcrypto.42.dylib (compatibility version 43.0.0, current version 43.0.0) /usr/lib/libssl.44.dylib (compatibility version 45.0.0, current version 45.1.0) /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP (compatibility version 1.0.0, current version 2.4.0) /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos (compatibility version 5.0.0, current version 6.0.0) /usr/lib/libapple_nghttp2.dylib (compatibility version 1.0.0, current version 1.24.1) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
$ otool -L /Applications/GMT-6.0.0rc4.app/Contents/Resources/lib/libcurl.4.dylib /Applications/GMT-6.0.0rc4.app/Contents/Resources/lib/libcurl.4.dylib: @executable_path/../lib/libcurl.4.dylib (compatibility version 10.0.0, current version 10.0.0) @executable_path/../lib/libidn2.0.dylib (compatibility version 4.0.0, current version 4.6.0) @executable_path/../lib/libpsl.5.dylib (compatibility version 9.0.0, current version 9.2.0) @executable_path/../lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) @executable_path/../lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) @executable_path/../lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1) — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
$ otool -L libgmt.dylib
libgmt.dylib:
@executable_path/../lib/libgmt.6.0.0.dylib (compatibility version 6.0.0, current version 6.0.0)
@executable_path/../lib/libnetcdf.15.dylib (compatibility version 15.0.0, current version 15.0.0)
@executable_path/../lib/libcurl.4.dylib (compatibility version 10.0.0, current version 10.0.0)
@executable_path/../lib/libgdal.26.dylib (compatibility version 27.0.0, current version 27.1.0)
@executable_path/../lib/libpcre.1.dylib (compatibility version 4.0.0, current version 4.11.0)
@executable_path/../lib/libfftw3f.3.dylib (compatibility version 9.0.0, current version 9.8.0)
@executable_path/../lib/libfftw3f_threads.3.dylib (compatibility version 9.0.0, current version 9.8.0)
@executable_path/../lib/libopenblas-r1.dylib (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
@executable_path/../lib/libglib-2.0.0.dylib (compatibility version 5801.0.0, current version 5801.3.0)
@executable_path/../lib/libpostscriptlight.6.dylib (compatibility version 6.0.0, current version 6.0.0)
@executable_path/../lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
And let me guess. If you don’t do the step
push!(Libdl.DL_LOAD_PATH (that I needed once but probably should not be needed) and use your own GMT build, then the Julia wrapper works fine.
Sent from my iDedo
No dia 17/09/2019, às 14:45, Dongdong Tian notifications@github.com escreveu:
I have a slightly different error with the same commands:
julia> using Libdl julia> push!(Libdl.DL_LOAD_PATH, "/Applications/GMT-6.0.0rc4.app/Contents/Resources/lib") julia> using GMT julia> coast(region=:global, proj=:Winkel, frame=:g, area=10000, land=:burlywood4, water=:wheat1, figsize=12, show=true) ERROR: error compiling finish_PS_module: error compiling gmt: could not load library "libgmt" dlopen(/Applications/GMT-6.0.0rc4.app/Contents/Resources/lib/libgmt.dylib, 1): Library not loaded: @executable_path/../lib/libgdal.26.dylib Referenced from: /Applications/GMT-6.0.0rc4.app/Contents/Resources/lib/libgmt.dylib Reason: image not found — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Yes, the julia wrapper works with my own GMT build.
Thanks. So the question is what is OSX doing? It has a lib with rpath pointing to other libs but depending on how that lib is accessed the rpath are respected ... or not!!!!
PyGMT also has the some problem with the DMG package, but works with my own build.
If PyGMT
also accesses the gmt lib via an FFI then the problem should be the same.
This is similar to the issue we have with Matlab where Matlab tells gmt to use its netcdf despite libgmt pointing to another libnetcdf.
Yes, except that now we can't blame TMW.
We may need help from someone who understands how shared libraries find other shared libraries and how that is affected by linker flags. There has to be a way to prevent some rogue application from overriding the sequence of dependency in our shared library.
FYI, GMT from homebrew works for both GMT.jl and PyGMT.
The man ld command on macOS talks about linking and how symbols are resolved. I wonder if some of those options are needed but cannot fully understand what to do.
If we could figure out how this works we may solve the long-standing crap with MATLAB as well. We should try to understand link options better.
@ZMAlt As you see OSX plays mysterious tricks with us. I'm afraid that for the moment the recommendation install GMT from any of the other alternatives but the bundle. Because 6.0.0 is not yet officially released Homebrew does not have the formula yet, but, if you have homebrew, you can install GMTrc4 with
brew install https://raw.githubusercontent.com/claudiodsf/homebrew-core/GMT6.0.0/Formula/gmt.rb
One thing that surprised me in the otool output was that it says @executable_path/..
but shouldn't it be @rpath ...
? I thought (as if could understand anything that is described by the dylib man page (example)) rpath
was the way to create relocatables.
This is issue is also slightly different from the MEX one. Here the normal build works and it's the bundle, who also tries to protect from the dll hell, that doesn't.
@joa-quim OK! Thanks
@joa-quim have you considered using BinaryBuilder to provide the library?
@giordano Although GMT can be built without GDAL it would be too crippled without it and GDAL is a complex dependency (for example GDAL.jl is rather limited in drivers). On the other hand BinaryBuilder would require a MinGW build on Windows, which is something I'm not willing to accept. I understand how that would easy life for many users but for the moment out of my reach.
Let's see how the new Artifacts
in Julia 1.3 can change this game. But for now just install with homebrew as indicated above. It's soooooo easy.
MacOS gmt6 rc4