comparison src/ltpda_dft/compile.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % Compile package within MATLAB
2 %
3 % M Hewitson 22-01-07
4 %
5 % $Id: compile.m,v 1.20 2011/05/04 12:50:12 ingo Exp $
6 %
7 function compile(varargin)
8
9 %% Settings
10
11 PACKAGE_NAME = 'ltpda_dft';
12 RELEASE = version('-release');
13
14 % compile variables
15 src = './ltpda_dft.c ';
16 include = '';
17
18 % install these files
19 files = {sprintf('ltpda_dft.%s', mexext), ...
20 'ltpda_dft.m'};
21
22
23 %% Set variables for this platform
24
25 os = computer;
26 switch os
27 case 'PCWIN' % Windows
28 platform = 'Windows PC';
29 mexPkg = 'windows';
30 case 'PCWIN64' % Windows 64-bit
31 platform = 'Windows PC 64-bit';
32 mexPkg = 'windows64';
33 case 'GLNX86' % Linux
34 platform = 'Linux PC';
35 mexPkg = 'linux';
36 case 'GLNXA64' % Linux
37 platform = 'Linux PC 64-bit';
38 mexPkg = 'linux64';
39 case 'MAC' % Mac PPC
40 platform = 'PPC Mac';
41 mexPkg = 'macppc';
42 case 'MACI' % Mac intel
43 platform = 'Intel Mac';
44 mexPkg = 'macintel';
45 case 'MACI64' % 64-bit Intel Mac
46 platform = 'Intel Mac 64-bit';
47 mexPkg = 'maci64';
48 otherwise
49 error('### compile: unknown platform');
50 end
51
52
53
54 disp(sprintf('* Compiling %s for %s', PACKAGE_NAME, platform));
55
56 %% Compile test_ltpda_lpsd
57 extras = '';
58 switch os
59 case 'PCWIN64'
60 cmd = sprintf('mex -f mexopts_XP64bit.bat -v %s %s %s', extras, include, src)
61 case 'PCWIN'
62 cmd = sprintf('mex -v %s %s %s', extras, include, src)
63 case 'MACI'
64 cmd = sprintf('mex -f mexopts.sh -v %s %s %s', extras, include, src)
65 case 'MACI64'
66 cmd = sprintf('mex -v %s %s %s', extras, include, src)
67 case 'GLNX86'
68 cmd = sprintf('mex -v %s %s %s', extras, include, src)
69 case 'GLNXA64'
70 cmd = sprintf('mex -v %s %s %s', extras, include, src)
71 end
72 eval(cmd)
73
74 if nargin==0
75 return % It is not necessary to copy the mex file.
76 else
77 installPoint = varargin{1};
78 end
79 mkdir(installPoint)
80 for f = files
81 fi = char(f);
82 disp(sprintf(' - installing %s', fi));
83 copyfile(fi, installPoint);
84 end
85 end
86