-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInstallmex.m
51 lines (46 loc) · 1.55 KB
/
Installmex.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
%%***********************************************************************
%% compile mex files
%%
%% NNLS, version 0:
%% Copyright (c) 2009 by
%% Kim-Chuan Toh and Sangwoon Yun
%%***********************************************************************
function Installmex
warning off
computer_model = computer;
%%
if strcmp(computer_model,'PCWIN')
str1 = [' ''',matlabroot,'\extern\lib\win32\lcc\libmwlapack.lib'' '];
str2 = [' ''',matlabroot,'\extern\lib\win32\lcc\libmwblas.lib'' '];
libstr = [str1,str2];
elseif strcmp(computer_model,'PCWIN64')
str1 = [' ''',matlabroot,'\extern\lib\win64\microsoft\libmwlapack.lib'' '];
str2 = [' ''',matlabroot,'\extern\lib\win64\microsoft\libmwblas.lib'' '];
libstr = [str1,str2];
else
libstr = ' -lmwlapack -lmwblas ';
end
if strfind(computer_model,'MAC')
mexcmd = 'mex -largeArrayDims -output ';
else
mexcmd = 'mex -O -largeArrayDims -output ';
end
cd PROPACKmod
cmd([mexcmd, 'reorth mexreorth.c',' ',libstr]);
cd ..
cd solver
fname{1} = 'mexsvec';
fname{2} = 'mexsmat';
fname{3} = 'mexProjOmega';
fname{4} = 'mexspconvert';
fname{5} = 'mexeig';
fname{6} = 'mexsvd';
for k = 1:length(fname)
cmd([mexcmd,' ',fname{k},' ',fname{k},'.c',' ',libstr]);
end
cd ..
%%***********************************************
function cmd(s)
fprintf(' %s\n',s);
eval(s);
%%***********************************************