source: issm/trunk-jpl/src/m/utils/OS/ismumps.m@ 11466

Last change on this file since 11466 was 11466, checked in by Eric.Larour, 13 years ago

Fixed issues with the MUMPS solver. Up to now, we never checked that the MUMPS
solver had been compiled. Now added this check in Solverx.cpp.
Also worked on the default solvers if MUMPS is not available -> solver.m and model.m and ismumps.m

File size: 735 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=[issmtier() '/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.