source: issm/branches/trunk-jpl-damage/src/m/utils/OS/ismumps.m@ 12197

Last change on this file since 12197 was 12197, checked in by cborstad, 13 years ago

changed issmtier() to issmdir()

File size: 734 bytes
Line 
1function flag=ismumps()
2%ISMUMPS - figure out if MUMPS package was compiled with ISSM
3%
4% Usage:
5% flag=ismumps();
6
7
8configfile=[issmdir() '/config.h'];
9if ~exist(configfile,'file'),
10 error(['File ' configfile ' not found. ISSM has not been configured yet!']);
11end
12
13%go through the file, and recover the line we want
14flag=2;
15fid=fopen(configfile,'r');
16if(fid==-1), error(['could not open file: ' configfile]); end
17
18while(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
29end
30fclose(fid);
31if flag==2,
32 error('could not determine whether MUMPS was or was not compiled');
33end
Note: See TracBrowser for help on using the repository browser.