0

I need to compile simulink code and generate dll daily basis. For this purpose I develop everything by the use of the Linux version of MATLAB. After this I start a VirtualBox and compile the simulink block and generate a dll. Due to the memory usage I would like to know if there are other solutions which does not required so many memory.

1 Answer 1

0

Finally I found the answer, The cross compiler solves the problem, in case of error I edit the makefile and recompile it.

try
    rtwbuild(modelName);
catch
    % If it is linux try to compile using cross compiler
    % This required the cross compile to be installed
    disp('Compilation faild');
    if strcmp(computer, 'GLNXA64')
        disp('Trying to compile for linux using cross-compiler')
        cd([modelName '_ert_shrlib_rtw'])
        C_FILE  = 'wesys_control.mk';

        fid  = fopen(C_FILE,'r');
        f=fread(fid,'*char')';
        fclose(fid);

        % Replacing the stop time        
        f = strrep(f,'CC = gcc','CC = i686-w64-mingw32-gcc');
        f = strrep(f,'LD = gcc','LD = i686-w64-mingw32-gcc');
        f = strrep(f,'CPP = g++','CPP = i686-w64-mingw32-g++');
        f = strrep(f,'CPP_LD = g++','CPP_LD = i686-w64-mingw32-g++');
        f = strrep(f,'AR = ar','AR = i686-w64-mingw32-ar');


        fid  = fopen(C_FILE,'w');
        fprintf(fid,'%s',f);
        fclose(fid);

        !make -f wesys_control.mk all
        cd ('..')
    end
end

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .