Open abmnmj opened 7 years ago
Jl.mex
does now require an extra integer argument. I think you may be looking at README.md
for master
. The README.md
for the rebranding
branch includes an example of calling Jl.mex
with the extra integer argument.
I hope to merge rebranding
branch into master
soon (this week?) to avoid this sort of confusion.
Thanks for testing mexjulia
out. Please do keep opening issues as you find them.
Yes, you're right -- I was using the example in the trunk version of README.md
. Sorry for the noise!
Unfortunately I now get an error that crashes MATLAB when running the double_it
example. I get consistent crashes if I run each command in README.md
(except Jl.include('my_own_julia_code.jl')
) in order, one-at-a-time, when running Jl.mex(1, 'double_it', a)
. I've tried multiple times, also using a pristine installation of mexjulia
, and it crashes MATLAB every time.
"Interestingly", I once tried running the double_it.m
script (instead of running the commands line-by-line) which did work, and after that I could run Jl.mex(1, 'double_it', a)
a few times more. Unfortunately I cannot repeat this (and not for lack of trying...). :smile:
If I instead run the double_it.m
script immediately after starting MATLAB, it will run without problems multiple times. If I then call Jl.eval('warn("Oh, no!")');
I get (with MATLAB responsive):
>> Jl.eval('warn("Oh, no!")');
Error using mexjulia
OutOfMemoryError()
in yieldto(::Task, ::ANY) at .\event.jl:136
in wait() at .\event.jl:169
in stream_wait(::Task) at .\stream.jl:44
in uv_write(::Base.PipeEndpoint, ::Ptr{UInt8}, ::UInt64) at .\stream.jl:820
in unsafe_write(::Base.PipeEndpoint, ::Ptr{UInt8}, ::UInt64) at .\stream.jl:830
in write(::Base.PipeEndpoint, ::Array{UInt8,1}) at .\io.jl:175
in print at .\strings\io.jl:70 [inlined]
in with_output_color(::Function, ::Symbol, ::Base.PipeEndpoint, ::String, ::Vararg{String,N}) at .\util.jl:302
in print_with_color(::Symbol, ::Base.PipeEndpoint, ::String, ::Vararg{String,N}) at .\util.jl:306
in #warn#936(::String, ::Bool, ::Void, ::Void, ::Void, ::Int64, ::Function, ::Base.PipeEndpoint, ::String,::Vararg{String,N}) at .\util.jl:340
in warn(::Base.PipeEndpoint, ::String) at .\util.jl:332
in #warn#937(::Array{Any,1}, ::Function, ::String, ::Vararg{String,N}) at .\util.jl:350
in warn(::String) at .\util.jl:350
in collect(::Base.Generator{Array{MATLAB.MxArray,1},Mex.##5#6}) at .\array.jl:307
in jl_eval(::Array{MATLAB.MxArray,1}) at F:\software\Julia\mexjulia\branches\rebranding\jl\Mex.jl:72
in jl_mex(::Array{Ptr{Void},1}, ::Array{Ptr{Void},1}) at F:\software\Julia\mexjulia\branches\rebranding\jl\Mex.jl:54
Error in Jl.mex (line 10)
[varargout{:}] = mexjulia('jl_mex', varargin{:});
Error in Jl.eval (line 16)
[varargout{:}] = Jl.mex(nargin, 'Mex.jl_eval', varargin{:});
After this I can still run all the example commands in README.md
without any crash. However, after a few more executions of Jl.eval('warn("Oh, no!")');
it stops giving any output.
Then Jl.eval('println("Hello, world!")');
acts up instead:
>> Jl.eval('println("Hello, world!")');
Error using mexjulia
schedule: Task not runnable
in enq_work(::Task) at .\event.jl:77
in uv_writecb_task(::Ptr{Void}, ::Int32) at .\stream.jl:873
in process_events(::Bool) at .\libuv.jl:82
in wait() at .\event.jl:147
in stream_wait(::Task) at .\stream.jl:44
in uv_write(::Base.PipeEndpoint, ::Ptr{UInt8}, ::UInt64) at .\stream.jl:820
in unsafe_write(::Base.PipeEndpoint, ::Ptr{UInt8}, ::UInt64) at .\stream.jl:830
in unsafe_write(::Base.PipeEndpoint, ::Base.RefValue{UInt8}, ::Int64) at .\io.jl:155
in write(::Base.PipeEndpoint, ::Char) at .\io.jl:194
in print(::Base.PipeEndpoint, ::Char) at .\char.jl:45
in print(::Base.PipeEndpoint, ::String, ::Char, ::Vararg{Char,N}) at .\strings\io.jl:19
in println(::String) at .\coreio.jl:5
in collect(::Base.Generator{Array{MATLAB.MxArray,1},Mex.##5#6}) at .\array.jl:307
in jl_eval(::Array{MATLAB.MxArray,1}) at F:\software\Julia\mexjulia\branches\rebranding\jl\Mex.jl:72
in jl_mex(::Array{Ptr{Void},1}, ::Array{Ptr{Void},1}) at F:\software\Julia\mexjulia\branches\rebranding\jl\Mex.jl:54
Error in Jl.mex (line 10)
[varargout{:}] = mexjulia('jl_mex', varargin{:});
Error in Jl.eval (line 16)
[varargout{:}] = Jl.mex(nargin, 'Mex.jl_eval', varargin{:});
Finally, this makes MATLAB unresponsive:
>> Jl.eval('warn("Oh, no!")');
and I have to kill it in the Task Manager.
I wonder if the issue that you report here is related to #28.
Running the
Jl.mex
example causes an error.The two first examples in the Readme work:
The file for the third example is in the Matlab path
and is included
Make an input array:
And call
double_it.jl
witha
:Looking at the following lines in
Jl.m
it appears that the first argument ofmex
should be the number of output arguments (ifnout
can be interpreted as "number of outputs")but
nout
contains the file name