forked from sdemyanov/ConvNet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompile.m
47 lines (43 loc) · 1.22 KB
/
compile.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
function [] = compile(indices)
clear mex;
kBuildFolder = './c++/build';
if (~exist(kBuildFolder, 'dir'))
mkdir(kBuildFolder);
end;
if (~isempty(find(indices == 1, 1)))
mex ./c++/cnntrain_mex.cpp ...
"./c++/sources/*.cpp" ...
-I"./c++/include/" ...
-lut ...
-outdir ./c++/build ...
-largeArrayDims ...
COMPFLAGS="/openmp $COMPFLAGS" ...
CXXFLAGS="\$CXXFLAGS -fopenmp" ...
LDFLAGS="\$LDFLAGS -fopenmp";
disp('cnntrain_mex compiled');
end;
if (~isempty(find(indices == 2, 1)))
mex ./c++/classify_mex.cpp ...
"./c++/sources/*.cpp" ...
-I"./c++/include/" ...
-lut ...
-outdir ./c++/build ...
-largeArrayDims ...
COMPFLAGS="/openmp $COMPFLAGS" ...
CXXFLAGS="\$CXXFLAGS -fopenmp" ...
LDFLAGS="\$LDFLAGS -fopenmp";
disp('classify_mex compiled');
end;
if (~isempty(find(indices == 3, 1)))
mex ./c++/genweights_mex.cpp ...
"./c++/sources/*.cpp" ...
-I"./c++/include/" ...
-lut ...
-outdir ./c++/build ...
-largeArrayDims ...
COMPFLAGS="/openmp $COMPFLAGS" ...
CXXFLAGS="\$CXXFLAGS -fopenmp" ...
LDFLAGS="\$LDFLAGS -fopenmp";
disp('genweights_mex compiled');
end;
end