-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmexCompile.m
More file actions
42 lines (37 loc) · 905 Bytes
/
mexCompile.m
File metadata and controls
42 lines (37 loc) · 905 Bytes
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
function mexCompile(optArgs)
% Description:
% Compile all of the MEX C functions together.
%
% Author:
% Alex Cappiello (acappiel@andrew.cmu.edu)
%
% Date:
% 6-4-13
% Updated:
% 6-26-13
%
% Inputs:
% optArgs: Cell array of strings representing additional compilation
% options. See 'doc mex' for info.
%
% Outputs:
% Compiled binaries.
if (nargin < 1)
optArgs = {};
end
if ispc
blaslib = fullfile(matlabroot, ...
'extern', 'lib', 'win64', 'microsoft', 'libmwblas.lib');
lapacklib = fullfile(matlabroot, ...
'extern', 'lib', 'win64', 'microsoft', 'libmwlapack.lib');
else
blaslib = '-lmwblas';
lapacklib = '-lmwlapack';
end
compile('twoElecFock.c', optArgs);
compile('mm.c', [optArgs {blaslib}]);
compile('elementWiseCombine.c', optArgs);
end
function compile(filename, optArgs)
mex(filename, optArgs{:});
end