-
Notifications
You must be signed in to change notification settings - Fork 1
/
builder.m
executable file
·52 lines (46 loc) · 1.4 KB
/
builder.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
function result = builder(f2t,ofn,eb)
% Function specific information
global functionsToThread outputFunctionName benchmarking; % Only way to pass to post codegen functions
functionsToThread = f2t;%{'GenCRC','AddNoise','CheckCRC'};
additionalSourceFiles = {'flowMP.h'};
outputFunctionName = {ofn};%{'RX'};
benchmarking = eb;
% Include mfiles
addpath(genpath('mfiles'));
% Coder config setup
cfg = coder.config('exe');
cfg.CustomSource = ['mainPD_',ofn,'_gen.cpp:flowMP.cpp:graph.cpp'];
%cfg.GenerateCodeReplacementReport = true;
if ispc % Windows
cfg.CustomLibrary = 'C:\Boost\lib\';
cfg.CustomInclude = 'C:\Boost\include\boost-1_49\';
end
cfg.CustomInclude = 'src/:include/';
cfg.TargetLang='C++';
cfg.PostCodeGenCommand = 'setbuildargsBoost(buildInfo)';
cfg.BuildConfiguration='Faster Runs';
cfg.EnableOpenMP = false;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Do Not Edit Below
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
enableDebugging = false;
% Run Codegen
if enableDebugging
result = codegen('-config','cfg',...
functionsToThread{:},...
additionalSourceFiles{:},...
'-o',outputFunctionName{:},...
'-v','-g');
else
result = codegen('-config','cfg',...
functionsToThread{:},...
additionalSourceFiles{:},...
'-o',outputFunctionName{:},...
'-v');
end
% % Run Code
% !./RX
%
% % Run C++ profiler and graph maker
% !gprof RX | gprof2dot | dot -Tpng -o output.png
end