juliamatlab / mexjulia

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

mex file does not build in Jl.m for an OSX installation #18

Closed Divisible8737 closed 7 years ago

Divisible8737 commented 7 years ago

This is a continuation of issue #9, running on OSX El Capitan.

  1. I hacked the correct file path for julia-config.jl into Jl.m (adding an extra line of code)
  2. The next error I get when running Jl.build is
>> Jl.build
The path of the Julia configuration script is /Users/y9KAaixxegjR/Documents/Current_works/julia/contrib/julia-config.jl
Error using Jl.build (line 108)
Error: The input character is not valid in MATLAB statements or
expressions.

With a breakpoint on 108

% build the mex file
Line 106: src = fullfile(Jl.this_dir, 'mexjulia.cpp');
Line 107: mex_cmd = 'mex -largeArrayDims -O %s %s %s %s';
Line 108: eval(sprintf(mex_cmd, cflags, ldflags, src, ldlibs));

The variables are:

K>> src
src =
/Users/y9KAaixxegjR/Documents/Current_works/CodingProjects/mexjulia-rebranding/mexjulia.cpp

K>> mex_cmd
mex_cmd =
mex -largeArrayDims -O %s %s %s %s

sprintf(mex_cmd, cflags, ldflags, src, ldlibs)

ans =

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.")
-DJULIA_ENABLE_THREADING=1 -fPIC -DJULIA_INIT_DIR=\"/Users/y9KAaixxegjR/Documents/Current_works/julia/usr/lib\" -I/Users/y9KAaixxegjR/Documents/Current_works/julia/usr/include/julia 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.")
-L/Users/y9KAaixxegjR/Documents/Current_works/julia/usr/lib /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.")
-Wl,-rpath,/Users/y9KAaixxegjR/Documents/Current_works/julia/usr/lib -ljulia

Perhaps this is an issue with how I am building julia?

twadleigh commented 7 years ago

Can I presume that you build your own julia but don't use make install? I think in that case the assumptions of julia-config.jl don't work. I also have been assuming an installed julia. I don't believe there should be any obstacle to supporting this, but it would involve having more/separate logic for building in this case.

twadleigh commented 7 years ago

I've made lots of updates to the build process. I'm closing this. Please open new issues as you find them.