juliamatlab / mexjulia

embedding Julia in the MATLAB process.
MIT License
52 stars 14 forks source link

path to julia-config.jl in mexjulia-rebranding/Jl.m incorrect for OS X installation #17

Closed Divisible8737 closed 7 years ago

Divisible8737 commented 7 years ago
  1. I cloned https://github.com/twadleigh/mexjulia/tree/rebranding
  2. Opened matlab, surfed to mexjulia-rebranding, verified that my C++ compiler was set up, and then ran
>> Jl.build
The path of the Julia executable is /Users/y9KAaixxegjR/Documents/Current_works/julia/usr/bin/julia
Error using Jl.build (line 89)
Assertion failed.

I placed a breakpoint at line 89 in Jl.m and found that

K>> cfg

cfg =

/Users/y9KAaixxegjR/Documents/Current_works/julia/usr/share/julia/julia-config.jl

but my julia-config.jl file is actually at:

/Users/y9KAaixxegjR/Documents/Current_works/julia/contrib/julia-config.jl

Here is my julia version info:

julia> versioninfo()
Julia Version 0.5.1-pre+2
Commit f0d40ec (2016-09-20 03:34 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin15.3.0)
  CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

And here is my Matlab version info:

>> version

ans =

9.0.0.341360 (R2016a)
Divisible8737 commented 7 years ago

P.S. I built julia with 'make' as per the instructions on github's main julia page.

twadleigh commented 7 years ago

As I mentioned in #18, the issue is that the build logic currently assumes an "installed" julia (e.g., one that you might get from running make install after make, or downloaded). I think the julia-config.jl script itself only works on a julia installation, and not a julia run from the source tree.

I don't believe there is any technical obstacle to getting mexjulia to run on a julia built in the source tree, it just needs to be done. The reason the build is done purely in MATLAB is to support those users who may not have a full build chain. However, to support those users who want to use mexjulia with a source-tree version of julia, we can assume they have a full build chain, in which case a separate build path implemented via a Makefile is probably appropriate.

Divisible8737 commented 7 years ago

OK, thanks, I went ahead and downloaded the distributed version of julia, now I get this error, which does not appear to be just a path issue:

>> Jl.build
The path of the Julia executable is /Applications/Julia-0.5.app/Contents/Resources/julia/bin/julia
The path of the Julia configuration script is /Applications/Julia-0.5.app/Contents/Resources/julia/share/julia/julia-config.jl
mex -largeArrayDims -O WARNING: Error during initialization of module GMP:
ErrorException("The dynamically loaded GMP library (version 4.2.1 with __gmp_bits_per_limb == 64)
does not correspond to the compile time version (version 6.1.0 with __gmp_bits_per_limb == 64).
Please rebuild 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.dylib provides version 8.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) WARNING: Error during initialization of module GMP:
ErrorException("The dynamically loaded GMP library (version 4.2.1 with __gmp_bits_per_limb == 64)
does not correspond to the compile time version (version 6.1.0 with __gmp_bits_per_limb == 64).
Please rebuild 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.dylib provides version 8.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) /Users/y9KAaixxegjR/Documents/Current_works/CodingProjects/mexjulia-rebranding/mexjulia.cpp WARNING: Error during initialization of module GMP:
ErrorException("The dynamically loaded GMP library (version 4.2.1 with __gmp_bits_per_limb == 64)
does not correspond to the compile time version (version 6.1.0 with __gmp_bits_per_limb == 64).
Please rebuild 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.dylib provides version 8.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)
Error using Jl.build (line 111)
Error: The input character is not valid in MATLAB statements or expressions.
``
twadleigh commented 7 years ago

The config script is no longer used.