Changeset 606 for trunk/src/compile.m


Ignore:
Timestamp:
Apr 7, 2013, 10:14:45 AM (8 years ago)
Author:
sommeria
Message:

bug on compilation solved (still to test with transform_field fct). faster browser inrtroduced. Various bug corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/compile.m

    r593 r606  
    66%FctName: name of the Matlab fct to compile (without .m extension)
    77%
    8 function compile (FctName)
     8function compile (FctName,SubfctPath)
    99if isempty(which('mcc'))
    1010    msgbox_uvmat('no Matlab compiler toolbox mcc installed')
    1111    return
    1212end
    13 display(['compiling ' FctName ' ...'])
     13disp(['compiling ' FctName ' ...'])
    1414% commands to compile civ_matlab and eventually other functions
    1515if ~exist('bin','dir')
     
    1919    end
    2020end
    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']);
     21if ~isempty(SubfctPath)
     22    SubfctPath=['-I ' SubfctPath];%string indicating the option of including the path SubfctPath
     23end
     24disp(['mcc -m -R -nojvm -R -nodisplay ' SubfctPath ' ' FctName '.m'])
     25eval(['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
     27system(['mv -f ' FctName ' bin/']);%move the binary file FctName to the subdir /bin
     28system(['sed -e ''''s#/' FctName '#/bin/' FctName '#'''' run_' FctName '.sh > ' FctName '.sh']);%modify the cmd file and copy it to [FctName '.sh']
     29system(['rm run_' FctName '.sh']);% remove the initial cmd file [run_' FctName '.sh]
     30system(['chmod +x ' FctName '.sh']); % set the cmd file to 'executable'
    2631display('** END **')
     32end
    2733
    2834
Note: See TracChangeset for help on using the changeset viewer.