julia not finding /usr/lib/libz.dylib on OSX 10.9

781 views
Skip to first unread message

Kevin Squire

unread,
Nov 29, 2013, 3:08:36 PM11/29/13
to juli...@googlegroups.com
From this issue: https://github.com/kmsquire/GZip.jl/issues/10#issuecomment-29527536

A user on v0.3.0-prerelease was attempting to use GZip.jl (through Gadfly.jl), and was getting an error trying to load the library:
julia> dlopen("libz")
ERROR: could not load module libz: dlopen(libz.dylib, 1): image not found
 in dlopen at c.jl:19
julia> _zlib=dlopen("libz.1.dylib")
ERROR: could not load module libz.1.dylib: dlopen(libz.1.dylib.dylib, 1): image not found
 in dlopen at c.jl:19

julia> _zlib=dlopen("libz.1")
ERROR: could not load module libz.1: dlopen(libz.1.dylib, 1): image not found
 in dlopen at c.jl:19

The strange thing is that the library is located at `/usr/lib/libz.dylib`, and is found using Elliot's shlib_list() (from https://github.com/JuliaLang/julia/pull/4925):
julia> shlib_list() |> x->filter(y->contains(y,"libz"), x)
1-element Array{String,1}:
 "/usr/lib/libz.1.dylib"
It works if he includes the full path:

julia> _zlib=dlopen("/usr/lib/libz.1.dylib")
Ptr{Void} @0x00007fc445730060

Some questions/requests:

1) Is this specific to Tobias' system, or is does it happen on other Mavericks systems?  I had no problems on Snow Leopard (10.7).
2) Could llvm or some other component be pulling in a version of zlib that is masking the system version?

Any thoughts or suggestions appreciated--thanks!

Kevin

Matt Bauman

unread,
Dec 2, 2013, 10:47:23 AM12/2/13
to juli...@googlegroups.com
On Friday, November 29, 2013 3:08:36 PM UTC-5, Kevin Squire wrote:

1) Is this specific to Tobias' system, or is does it happen on other Mavericks systems?  I had no problems on Snow Leopard (10.7).
2) Could llvm or some other component be pulling in a version of zlib that is masking the system version?

I can't speak to question 2, but on my Mavericks system I can load libz without trouble and shlib_list reports it in the same location.  So there's something else going on.

julia> shlib_list() |> x->filter(y->contains(y,"libz"), x)
1-element Array{String,1}:
 
"/usr/lib/libz.1.dylib"


julia
> dlopen("libz")
Ptr{Void} @0x00007fcaa350f7d0

julia> versioninfo()
Julia Version 0.3.0-prerelease+282
Commit c3565dc (2013-12-02 04:53 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.0.0)
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)
  LAPACK: libopenblas
  LIBM: libopenlibm

Kevin Squire

unread,
Dec 2, 2013, 4:06:42 PM12/2/13
to juli...@googlegroups.com
Hi Matt,

Thanks a lot for testing. It turns out that the user had set DYLD_FALLBACK_LIBRARY_PATH, and had not included the default library directories.  (see https://github.com/kmsquire/GZip.jl/issues/10#issuecomment-29642741). 

Who knew.

Cheers,
  Kevin

Viral Shah

unread,
Dec 7, 2013, 2:49:41 AM12/7/13
to juli...@googlegroups.com
I think we should look for this environment variable on the mac during startup, and issue a warning, given how often this comes up.

-viral

Elliot Saba

unread,
Dec 7, 2013, 5:32:34 AM12/7/13
to Julia Dev
Yeah, I agree.  We could throw this into contrib/mac/juliarc.jl so that users can remove the check if they wish.
-E
Reply all
Reply to author
Forward
0 new messages