-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompileSparsePOP.m
More file actions
46 lines (43 loc) · 1.72 KB
/
Copy pathcompileSparsePOP.m
File metadata and controls
46 lines (43 loc) · 1.72 KB
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
% Compiling Mex Files
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This file is a component of SparsePOP
% Copyright (C) 2007 SparsePOP Project
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
MexFlags = ' -O2 -Dlinux=1 -DMATLAB_MEX_FILE -DOCTAVE ';
LIBfiles = strcat(' conversion.cpp spvec.cpp polynomials.cpp sup.cpp ', ...
' clique.cpp mysdp.cpp Parameters.cpp ');
OBJfiles = strrep(LIBfiles,'.cpp','.o');
mpwd=pwd;
mpath=mfilename('fullpath');
mpath=mpath(1:strchr(mpath,filesep,1,'last'));
cd(strcat(mpath,filesep,'subPrograms',filesep,'Mex'));
fprintf('Compiling Libraries...');
command = ['mex -c ' MexFlags LIBfiles];
eval(command);
fprintf('done\n');
fprintf('Generating mexconv1...');
command = ['mex ' MexFlags ' mexconv1.cpp' OBJfiles ];
eval(command);
fprintf('done\n');
fprintf('Generating mexconv2...');
command = ['mex ' MexFlags ' mexconv2.cpp ' OBJfiles ];
eval(command);
fprintf('done\n');
cd(mpwd);
fprintf('Compilation finished successfully.\n');