Changeset 25747


Ignore:
Timestamp:
11/12/20 17:00:08 (4 years ago)
Author:
jdquinn
Message:

BUG: Need to find path to gmsh before calling in situations where it is not already in PATH (e.g. binaries).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m

    r25344 r25747  
    1515%      md.mesh=gmshplanet('radius',6000,'resolution',100);
    1616
     17        %Find path to gmsh
     18        paths = {...
     19                [issmdir() 'bin/gmsh'],...
     20                [issmdir() 'externalpackages/gmsh/install/gmsh']...
     21        };
     22        disp(paths{1})
     23        gmshpath = '';
     24        for i=paths
     25                if exist(i{1},'file'),
     26                        gmshpath = i{1};
     27                        break;
     28                end
     29        end
     30        if isempty(gmshpath),
     31                error('gmsh not found, make sure it is properly installed');
     32        end
     33
    1734        % Get Gmsh version
    18         [s,r]=system(['gmsh -info 2>&1 | command grep ''Version'' | sed -e ''s/Version[[:blank:]]*:[[:blank:]]//'' | cut -d ''.'' -f1']);
     35        [s,r]=system([gmshpath ' -info 2>&1 | command grep ''Version'' | sed -e ''s/Version[[:blank:]]*:[[:blank:]]//'' | cut -d ''.'' -f1']);
    1936        if s~=0,
    2037                error(r);
     
    119136        end
    120137
    121         %Find path to gmsh
    122         paths = {[issmdir() '/bin/gmsh'],[issmdir() '/externalpackages/gmsh/install/gmsh']};
    123         gmshpath = '';
    124         for i=paths
    125                 if exist(i{1},'file'),
    126                         gmshpath = i{1};
    127                         break;
    128                 end
    129         end
    130         if isempty(gmshpath),
    131                 error('gmsh not found, make sure it is properly installed');
    132         end
    133 
    134138        % Call gmsh
    135139        %
Note: See TracChangeset for help on using the changeset viewer.