Line | |
---|
1 | function flag=ismumps()
|
---|
2 | %ISMUMPS - figure out if MUMPS package was compiled with ISSM
|
---|
3 | %
|
---|
4 | % Usage:
|
---|
5 | % flag=ismumps();
|
---|
6 |
|
---|
7 |
|
---|
8 | configfile=[issmdir() '/config.h'];
|
---|
9 | if ~exist(configfile,'file'),
|
---|
10 | error(['File ' configfile ' not found. ISSM has not been configured yet!']);
|
---|
11 | end
|
---|
12 |
|
---|
13 | %go through the file, and recover the line we want
|
---|
14 | flag=2;
|
---|
15 | fid=fopen(configfile,'r');
|
---|
16 | if(fid==-1), error(['could not open file: ' configfile]); end
|
---|
17 |
|
---|
18 | while(true),
|
---|
19 | tline=fgets(fid);
|
---|
20 | if ~ischar(tline), break, end
|
---|
21 | if strncmp(tline,'/* #undef _HAVE_MUMPS_ */',25),
|
---|
22 | flag=0;
|
---|
23 | break;
|
---|
24 | end
|
---|
25 | if strncmp(tline,'#define _HAVE_MUMPS_',20),
|
---|
26 | flag=1;
|
---|
27 | break;
|
---|
28 | end
|
---|
29 | end
|
---|
30 | fclose(fid);
|
---|
31 | if flag==2,
|
---|
32 | error('could not determine whether MUMPS was or was not compiled');
|
---|
33 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.