1function build_lsoda_mex()
2% BUILD_LSODA_MEX Compile the LSODA MEX solver
6% Compiles liblsoda C sources into a MEX function lsoda_mex.
7% The compiled MEX file
is placed in the same directory as
this script.
9% Requirements: a C compiler configured via mex -setup
11thisDir = fileparts(mfilename(
'fullpath'));
12srcDir = fullfile(thisDir,
'src');
14% List all C source files (excluding ewset.c and printcf.c)
16 fullfile(srcDir,
'lsoda_mex.c')
17 fullfile(srcDir, 'lsoda.c')
18 fullfile(srcDir, 'stoda.c')
19 fullfile(srcDir, 'correction.c')
20 fullfile(srcDir, 'prja.c')
21 fullfile(srcDir, 'solsy.c')
22 fullfile(srcDir, 'intdy.c')
23 fullfile(srcDir, 'cfode.c')
24 fullfile(srcDir, 'methodswitch.c')
25 fullfile(srcDir, 'orderswitch.c')
26 fullfile(srcDir, 'corfailure.c')
27 fullfile(srcDir, 'scaleh.c')
28 fullfile(srcDir, 'common.c')
29 fullfile(srcDir, 'vmnorm.c')
30 fullfile(srcDir, 'fnorm.c')
31 fullfile(srcDir, 'daxpy.c')
32 fullfile(srcDir, 'ddot.c')
33 fullfile(srcDir, 'dgefa.c')
34 fullfile(srcDir, 'dgesl.c')
35 fullfile(srcDir, 'dscal.c')
36 fullfile(srcDir, 'idamax.c')
37 fullfile(srcDir, 'strdup_printf.c')
40fprintf('Building lsoda_mex...\n');
44 '-output', fullfile(thisDir, 'lsoda_mex'), ...
47fprintf(
'lsoda_mex built successfully.\n');