Changeset 606 for trunk/src/compile.m
- Timestamp:
- Apr 7, 2013, 10:14:45 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/compile.m
r593 r606 6 6 %FctName: name of the Matlab fct to compile (without .m extension) 7 7 % 8 function compile (FctName )8 function compile (FctName,SubfctPath) 9 9 if isempty(which('mcc')) 10 10 msgbox_uvmat('no Matlab compiler toolbox mcc installed') 11 11 return 12 12 end 13 disp lay(['compiling ' FctName ' ...'])13 disp(['compiling ' FctName ' ...']) 14 14 % commands to compile civ_matlab and eventually other functions 15 15 if ~exist('bin','dir') … … 19 19 end 20 20 end 21 eval(['mcc -m -R -nojvm -R -nodisplay ' FctName '.m']); 22 system(['mv -f ' FctName ' bin/']); 23 system(['sed -e ''''s#/' FctName '#/bin/' FctName '#'''' run_' FctName '.sh > ' FctName '.sh']); 24 system(['rm run_' FctName '.sh']); 25 system(['chmod +x ' FctName '.sh']); 21 if ~isempty(SubfctPath) 22 SubfctPath=['-I ' SubfctPath];%string indicating the option of including the path SubfctPath 23 end 24 disp(['mcc -m -R -nojvm -R -nodisplay ' SubfctPath ' ' FctName '.m']) 25 eval(['mcc -m -R -nojvm -R -nodisplay ' SubfctPath ' ' FctName '.m'])% compile the source file [FctName .m], which produces a binary file FctName and a cmd file [run_' FctName '.sh] 26 %eval(['mcc -m -R -nojvm -R -nodisplay ' FctName '.m'])% compile the source file [FctName .m], which produces a binary file FctName and a cmd file [run_' FctName 27 system(['mv -f ' FctName ' bin/']);%move the binary file FctName to the subdir /bin 28 system(['sed -e ''''s#/' FctName '#/bin/' FctName '#'''' run_' FctName '.sh > ' FctName '.sh']);%modify the cmd file and copy it to [FctName '.sh'] 29 system(['rm run_' FctName '.sh']);% remove the initial cmd file [run_' FctName '.sh] 30 system(['chmod +x ' FctName '.sh']); % set the cmd file to 'executable' 26 31 display('** END **') 32 end 27 33 28 34
Note: See TracChangeset
for help on using the changeset viewer.