Julia: v0.5: libgit2.dylib requires version 9.0.0 or later, but libcurl.4.dylib provides version 7.0.0

Created on 26 Sep 2016  路  7Comments  路  Source: JuliaLang/julia

Crash during Julia startup on macOS, v0.5. Incompatible library version for libcurl.4.dylib.
Does anybody know how to fix?

exec '/Applications/Julia-0.5.app/Contents/Resources/julia/bin/julia'
fatal: error thrown and no exception handler available.
Base.InitError(mod=:LibGit2, error=ErrorException("could not load library "libgit2"
dlopen(libgit2.dylib, 1): Library not loaded: @rpath/libcurl.dylib
  Referenced from: /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia//libgit2.dylib
  Reason: Incompatible library version: libgit2.dylib requires version 9.0.0 or later, but libcurl.4.dylib provides version 7.0.0"))
rec_backtrace at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/stackwalk.c:84
record_backtrace at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/task.c:232 [inlined]
jl_throw at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/task.c:550
jl_errorf at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/builtins.c:78
jl_dlerror at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/dlload.c:69
jl_load_dynamic_library_ at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/dlload.c:209
jl_get_library at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/runtime_ccall.cpp:152
jl_load_and_lookup at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/runtime_ccall.cpp:163
jlplt_git_libgit2_init_24776 at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
__init__ at ./libgit2/libgit2.jl:538
jlcall___init___24772 at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
jl_call_method_internal at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1942
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia.h:1392 [inlined]
jl_module_run_initializer at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:83
_julia_init at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/init.c:742
julia_init at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/task.c:283
main at /Applications/Julia-0.5.app/Contents/Resources/julia/bin/julia (unknown line)

[Process completed]
libgit2 mac

All 7 comments

Do you have some kind of LD_LIBRARY_PATH set?

Very similar error happening on openSUSE for version 0.6 dev.
24 hours ago a git pull followed by a make && make testall ran fine. This morning I had an error in make:

...
patching file tests/online/badssl.c
CMake Error: The current CMakeCache.txt directory /home/colin/Downloads/julia6/deps/scratch/libgit2-211e117a0590583a720c53172406f34186c543bd/CMakeCache.txt is different than the directory /home/colin/Downloads/julia/deps/scratch/libgit2-211e117a0590583a720c53172406f34186c543bd where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
CMake Error: The source "/home/colin/Downloads/julia6/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/CMakeLists.txt" does not match the source "/home/colin/Downloads/julia/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/CMakeLists.txt" used to generate cache.  Re-run cmake with a different source directory.
/home/colin/Downloads/julia6/deps/libgit2.mk:66: recipe for target 'scratch/libgit2-211e117a0590583a720c53172406f34186c543bd/build-configured' failed
make[1]: *** [scratch/libgit2-211e117a0590583a720c53172406f34186c543bd/build-configured] Error 1
Makefile:81: recipe for target 'julia-deps' failed
make: *** [julia-deps] Error 2

as in the OP.
I thought I had fixed this with make -C deps distclean-libgit2 distclean-mbedtls distclean-libssh2 which allowed make to run to the end. However now Julia 0.6 fails to launch with:

> julia6
fatal: error thrown and no exception handler available.
Base.InitError(mod=:LibGit2, error=ErrorException("error initializing LibGit2 module"))

as above. Prebuilt Julia 0.5 works fine. There are a number of different versions of libgit2 available from openSUSE repos (libgit2-22, libgit2-glib) but none have been installed to this point so not sure what I would use as a path in LD_LIBRARY_PATH which is currently empty and has not been recently cleared to my knowledge.

@colbec your problem is likely different, and a consequence of https://github.com/JuliaLang/julia/pull/18658 which is only on 0.6-dev, not 0.5. Open a separate issue? (edit: done as #18693)

@ViralBShah thanks, DYLD_LIBRARY_PATH was set to /usr/lib, once I cleared it up, it started to work.
Btw, could you please explain in a few words why it interfered?

I also had the original problem and also had a DYLD_LIBRARY_PATH set that included /usr/lib. Apparently, at least in Mac 10.11.6 (I don't know about 10.12 yet), /usr/lib contains "compatibility version 7.0.0, current version 8.0.0" of libcurl.dylib. The directory /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia contains version 9.0.0 of libcurl.dylib. Julia v0.5 requires libcurl v9 but my DYLD_LIBRARY_PATH had it looking in /usr/lib first. I fixed the problem for me by putting the v9 libcurl.dylib in a directory that appears before /usr/lib in my DYLD_LIBRARY_PATH.

@ericsobel yep, so this may be considered as a bug - once Julia comes with pre-packaged libs, no variables or other stuff should make it look for them in other places. Only if the lib couldn't be found locally, then search in the system. What do you think, @ViralBShah?

No, that's what the DYLD_LIBRARY_PATH exists for: it is a user command that forces the system to ignore the prepackaged libs and instead use the libraries on its path. It's also why you should avoid setting it (and it's cousins, such as LD_LIBRARY_PATH) globally and should never set it to a system path (such as /usr/lib)

Was this page helpful?
0 / 5 - 0 ratings