Skip to content
Snippets Groups Projects
Commit 88668d6a authored by Federico Felici's avatar Federico Felici
Browse files

Cleanup build method

parent 1ef448de
No related branches found
No related tags found
No related merge requests found
......@@ -555,7 +555,26 @@ classdef SCDclass_expcode
end
function build(obj)
fprintf('\n=== Building %s ===',obj.name);
fprintf('\n=== Building %s ===\n',obj.name);
% make list of nodes to compile
compileslx_list = cell(0);
for inode=1:8
nodeinfo=obj.(sprintf('node%02d',inode));
for icpu = 1:nodeinfo.ncpu
if nodeinfo.cpuactive(icpu)
compileslx_list = [compileslx_list;
sprintf('SCD_rtccode_%02d_%02d',inode,icpu)]; %#ok<AGROW>
end
end
end
if isempty(compileslx_list)
fprintf('No active nodes found, no .slx to compile. Done\n');
return
end
% set CodeGen folder for this expcode (allows fast rebuilding)
CodeGenFolder = fullfile(fileparts(mfilename('fullpath')),'gencodes',...
sprintf('CodeGenFolder-%d',obj.maincode));
......@@ -564,18 +583,20 @@ classdef SCDclass_expcode
'CodeGenFolder',CodeGenFolder,...
'createdir',true);
% check env variable
assert(~isempty(getenv('RTCCODE_LIBPATH')),'RTCCODE_LIBPATH environment variable needs to be defined to compile');
% set configuration settings for compilation
SCDconf_setCODEconf('configurationSettingsCODEicc')
for inode=1:8
nodeinfo=obj.(sprintf('node%02d',inode));
for icpu = 1:nodeinfo.ncpu
if nodeinfo.cpuactive(icpu)
cpuslxname = sprintf('SCD_rtccode_%02d_%02d',inode,icpu);
fprintf(' *** Buiding Node %s ***\n',cpuslxname);
rtwbuild(cpuslxname);
end
end
% Build
for mynodeslx = compileslx_list
fprintf(' *** Buiding Node %s ***\n',mynodeslx{1});
rtwbuild(mynodeslx{1});
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment