comparison src/ltpda_polyreg/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.14 2011/05/04 12:50:12 ingo Exp $
6 %
7 function compile(varargin)
8
9 %% Settings
10
11 PACKAGE_NAME = 'ltpda_polyreg';
12 RELEASE = version('-release');
13
14 % compile variables
15 src = './ltpda_polyreg.c ';
16 include = '';
17
18 % install these files
19 files = {sprintf('ltpda_polyreg.%s', mexext), ...
20 'ltpda_polyreg.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 disp(sprintf('* Compiling %s for %s', PACKAGE_NAME, platform));
53
54 %% Compile ltpda_polyreg
55 extras = '';
56 switch os
57 case 'PCWIN64'
58 cmd = sprintf('mex -f mexopts_XP64bit.bat -v %s %s %s', extras, include, src)
59 case 'PCWIN'
60 cmd = sprintf('mex -v %s %s %s', extras, include, src)
61 case 'MACI'
62 cmd = sprintf('mex -f mexopts.sh -v %s %s %s', extras, include, src)
63 case 'MACI64'
64 cmd = sprintf('mex -v %s %s %s', extras, include, src)
65 case 'GLNX86'
66 cmd = sprintf('mex -v %s %s %s', extras, include, src)
67 case 'GLNXA64'
68 cmd = sprintf('mex -v %s %s %s', extras, include, src)
69 end
70 eval(cmd)
71
72 if nargin==0
73 return % It is not necessary to copy the mex file.
74 else
75 installPoint = varargin{1};
76 end
77 mkdir(installPoint)
78 for f = files
79 fi = char(f);
80 disp(sprintf(' - installing %s', fi));
81 copyfile(fi, installPoint);
82 end
83 end
84
85