Closed mckelvin closed 11 years ago
@xuhdev I'm sorry that I didn't have Matlab installed in my PC and I just wrote the "as-is" code without testing the Matlab Compiler yet. Please wait for my latter commits.
btw, this may helps but i didn't test it yet.
@xuhdev I tested it on Linux 3.9.7-1-ARCH x86_64 / Matlab R2013a
and it works fine.Please re-check it again.
Could you paste your output here please?
Say we have a *.m
file with:
1+1
the output of the Matlab Compiler:
< M A T L A B (R) >
Copyright 1984-2013 The MathWorks, Inc.
R2013a (8.1.0.604) 64-bit (glnxa64)
February 15, 2013
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.
ans =
2
Press ENTER or type command to continue
the output of the Octave Compiler:
GNU Octave, version 3.6.4
Copyright (C) 2013 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'.
Octave was configured for "x86_64-unknown-linux-gnu".
Additional information about Octave is available at http://www.octave.org.
Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html
Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type `news'.
ans = 2
Press ENTER or type command to continue
actually the Octave Compiler is much faster than the Matlab Compiler but with a larger priority(60).
Thanks, does the test performed under terminal environment without GUI support?
@xuhdev this test is performed in terminator
(a GUI terminal program under X11) with the output above, and no GUI window will pop up. I also tested it under a tty just now, and it works too.
OK then, please do me a favor. Run the following two commands in your terminal,
$ matlab
$ matlab some.m
what happens? Does the Matlab GUI launch? For me, the GUI program launches. Thanks
@xuhdev yes, both of these two commands will launch the Matlab GUI without running the some.m
Sorry that I was on a vacation. I upgrade my matlab to version 2013a but it still doesn't work. Would you mind test it on other platforms such as OS X or Windows? Thanks!
@xuhdev Sorry, I don't have any other platforms installed on my PC. Can you detail the problem on your platform? What happens if you:
create foo.m
in the current working directory with:
x = 1
and then execute matlab -nodisplay -nosplash -r foo,exit
on a terminal?
< M A T L A B (R) >
Copyright 1984-2013 The MathWorks, Inc.
R2013a (8.1.0.604) 64-bit (maci64)
February 15, 2013
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.
x =
1
What do you think of suppressing the welcome message?
@xuhdev I also get the same output, and SingleCompile also give the same output in my platform! I can't figure out how the problem comes in your plarform, could you do some tweak to fix that on your platform?
The welcome message is OK, in my view, just KISS.
Here's the patch:
diff --git a/autoload/SingleCompile/templates/matlab.vim b/autoload/SingleCompile/templates/matlab.vim
index 9830435..2ca750c 100644
--- a/autoload/SingleCompile/templates/matlab.vim
+++ b/autoload/SingleCompile/templates/matlab.vim
@@ -19,10 +19,10 @@
function! SingleCompile#templates#matlab#Initialize()
call SingleCompile#SetCompilerTemplate('matlab', 'matlab', 'MathWorks MATLAB',
- \'matlab', '', '')
+ \'matlab', '-nodisplay -nosplash -r "$(FILE_TITLE)$; exit"', '')
call SingleCompile#SetPriority('matlab', 'matlab', 50)
call SingleCompile#SetCompilerTemplate('matlab', 'octave', 'GNU Octave',
- \'octave', '', '')
+ \'octave', '-nodisplay -nosplash -r "$(FILE_TITLE)$; exit"', '')
call SingleCompile#SetPriority('matlab', 'octave', 60)
endfunction
Could you test whether octave works properly in this case, please? Thanks
@xuhdev I've fixed this in https://github.com/mckelvin/SingleCompile/commit/c2a14ed237a899abec08f11b4a938d2fa03f7e97 , I guess you may forget to pull the latest code in my repo.
Oh I see! What about octave? Do they share the same command line interface?
@xuhdev no extra params are needed for the octave compiler. as:
$ octave /tmp/foo.m
GNU Octave, version 3.6.4
Copyright (C) 2013 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'.
Octave was configured for "x86_64-unknown-linux-gnu".
Additional information about Octave is available at http://www.octave.org.
Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html
Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type `news'.
x = 1
OK thanks!
Thanks for your PR.
I tried with my matlab. The GUI program launched and actually the script is not executed. I'm on OS X.