source: trunk/src/compile.m @ 593

Last change on this file since 593 was 593, checked in by sommeria, 11 years ago

add fucntion 'compile' to compile any matlab fct for series

File size: 879 bytes
RevLine 
[593]1%'compile': compile a Matlab function, create a binary in a subdirectory /bin
2%--------------------------------------------------------------------
3% compile (FctName)
4%
5%INPUT:
6%FctName: name of the Matlab fct to compile (without .m extension)
7%
8function compile (FctName)
9if isempty(which('mcc'))
10    msgbox_uvmat('no Matlab compiler toolbox mcc installed')
11    return
12end
13display(['compiling ' FctName ' ...'])
14% commands to compile civ_matlab and eventually other functions
15if ~exist('bin','dir')
16    [success,errormsg]=mkdir('bin');
17    if success~=1
18        display(errormsg)
19    end
20end
21eval(['mcc -m -R -nojvm -R -nodisplay ' FctName '.m']);
22system(['mv -f ' FctName ' bin/']);
23system(['sed -e ''''s#/' FctName '#/bin/' FctName '#'''' run_' FctName '.sh > ' FctName '.sh']);
24system(['rm run_' FctName '.sh']);
25system(['chmod +x ' FctName '.sh']);
26display('** END **')
27
28
29
Note: See TracBrowser for help on using the repository browser.