Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"It appears the mexjulia MEX function is missing" #7

Open
jonniedie opened this issue Apr 9, 2021 · 8 comments
Open

"It appears the mexjulia MEX function is missing" #7

jonniedie opened this issue Apr 9, 2021 · 8 comments

Comments

@jonniedie
Copy link

Following the steps in the README, I get this error in MATLAB:

>> jl.eval('2+2')
Error using jl.check_initialized (line 133)
It appears the mexjulia MEX function is missing. Consider building
"Mex.jl".\n

Error in jl.mexn (line 15)
            jl.check_initialized;

Error in jl.eval (line 38)
            [varargout{:}] = jl.mexn(nargin, 'Mex.jl_eval', varargin{:});

I tried this by building with Julia 1.5.3 and Julia 1.6.0 and got the same thing. Any thoughts?

@jebej
Copy link
Owner

jebej commented Apr 9, 2021

The package doesn't work on 1.6 yet. For 1.5, I'll need more details:
What does mex -setup C++ say?

If it looks fine, you'll need to look at the build log file in the deps folder of the package.

@jonniedie
Copy link
Author

>> mex -setup C++
MEX configured to use 'Microsoft Visual C++ 2017' for C++ language compilation.

And the build.log says

Error using mex
Unknown file extension ''.

C:\Users\jdiegelm\.julia\packages\Mex\ZlRZN\deps is not on the MATLAB path. Adding it and saving...

@jebej
Copy link
Owner

jebej commented Apr 9, 2021

Looks like the mex call itself is failing. You should be able to open the jldict.mat file in the mexjulia folder. Could you then copy here the mex_cmd string? e.g. mine looks like:

mex LDFLAGS='-L"C:\Users\Jeremy\AppData\Local\Julia-1.5.4\bin" $LDFLAGS' -v -largeArrayDims -outdir "C:\Users\Jeremy\.julia\dev\Mex\deps\..\mexjulia" -O -I"C:\Users\Jeremy\AppData\Local\Julia-1.5.4\include\julia" -DJULIA_ENABLE_THREADING "C:\Users\Jeremy\.julia\dev\Mex\deps\mexjulia.cpp" C:\Users\Jeremy\AppData\Local\Julia-1.5.4\lib\libjulia.dll.a

You can also run the command directly in matlab and see what it outputs, in case the log file was missing some lines.

@jonniedie
Copy link
Author

'mex LDFLAGS='-L"C:\Users\jdiegelm\AppData\Local\Programs\Julia 1.5.3\bin" $LDFLAGS' -v -largeArrayDims -outdir "C:\Users\jdiegelm\.julia\packages\Mex\ZlRZN\deps\..\mexjulia" -O -I"C:\Users\jdiegelm\AppData\Local\Programs\Julia 1.5.3\include\julia" -DJULIA_ENABLE_THREADING "C:\Users\jdiegelm\.julia\packages\Mex\ZlRZN\deps\mexjulia.cpp" C:\Users\jdiegelm\AppData\Local\Programs\Julia 1.5.3\bin\libjulia.dll.a'

Running it I get the error:

>> mex LDFLAGS='-L"C:\Users\jdiegelm\AppData\Local\Programs\Julia 1.5.3\bin" $LDFLAGS' -v -largeArrayDims -outdir "C:\Users\jdiegelm\.julia\packages\Mex\ZlRZN\deps\..\mexjulia" -O -I"C:\Users\jdiegelm\AppData\Local\Programs\Julia 1.5.3\include\julia" -DJULIA_ENABLE_THREADING "C:\Users\jdiegelm\.julia\packages\Mex\ZlRZN\deps\mexjulia.cpp" C:\Users\jdiegelm\AppData\Local\Programs\Julia 1.5.3\bin\libjulia.dll.a
Verbose mode is on.
Error using mex
Unknown file extension ''.

@jebej
Copy link
Owner

jebej commented Apr 9, 2021

Ok, it looks fine. The only thing I can think of is that this is because you are using Visual C++, which I have never tried. I am using MinGW, installed via the MATLAB plugin interface.

@jonniedie
Copy link
Author

Hm. I just installed MinGW and switched to that using mex -setup C++ and I'm getting the same errors.

@bardo84
Copy link

bardo84 commented Jul 17, 2021

with Julia 1.6.2 and MinGW64 I'm getting
Error using mex g++: error: c:\users\xxx\appdata\local\programs\julia-1.6.2\bin\libjulia.dll.a: No such file or directory
whereas library path is pointing to bin
julia> dlpath("libjulia.dll") "c:\\users\\xxx\\appdata\\local\\programs\\julia-1.6.2\\bin\\libjulia.dll"

Related to the following?
https://github.com/JuliaLang/julia/issues/29812

@kongdd
Copy link

kongdd commented Aug 20, 2021

I am using Rtools MinGW64, and faced with the same question.
Any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants