Changeset 24942


Ignore:
Timestamp:
06/01/20 10:01:04 (5 years ago)
Author:
jdquinn
Message:

CHG: Moved Gmsh version setting to issm_options.m4 and IssmConfig.cpp because we do not rely on value of ISSM_DIR when testing binaries

Location:
issm/trunk-jpl
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/jenkins/ross-debian_linux-binaries-solid_earth

    r24919 r24942  
    3333        --with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
    3434        --with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
     35        --with-gmsh-dir=${ISSM_DIR}/externalpackages/gmsh/install
    3536'
    3637
  • issm/trunk-jpl/m4/issm_options.m4

    r24919 r24942  
    515515
    516516                AC_MSG_CHECKING(for Dakota version)
    517                 dnl TODO:       Check if this method applies to all other versions of
    518                 dnl             (it should as long as the Dakota binaries have been
    519                 dnl             compiled). If so, we can remove the other methods of
    520                 dnl             getting the version.
     517                dnl TODO:       Check if this method applies to all other versions of 
     518                dnl                     Dakota (it should as long as the Dakota binaries have been
     519                dnl             compiled). If so, we can remove the other methods of 
     520                dnl                     getting the version.
    521521                dnl
    522522                DAKOTA_VERSION_OUTPUT=`${DAKOTA_ROOT}/bin/dakota -v`
     
    22992299        AM_CONDITIONAL([NEOPZ], [test "x${HAVE_NEOPZ}" == "xyes"])
    23002300        dnl }}}
     2301        dnl Gmsh{{{
     2302        AC_MSG_CHECKING([for Gmsh])
     2303        AC_ARG_WITH(
     2304                [gmsh-dir],
     2305                AS_HELP_STRING([--with-gmsh-dir=DIR], [Gmsh root directory]),
     2306                [GMSH_ROOT=${withval}],
     2307                [GMSH_ROOT="no"]
     2308        )
     2309        if test "x${GMSH_ROOT}" == "xno"; then
     2310                HAVE_GMSH=no
     2311        else
     2312                HAVE_GMSH=yes
     2313                if ! test -d "${GMSH_ROOT}"; then
     2314                        AC_MSG_ERROR([Gmsh directory provided (${GMSH_ROOT}) does not exist!]);
     2315                fi
     2316        fi
     2317        AC_MSG_RESULT([${HAVE_GMSH}])
     2318        AM_CONDITIONAL([GMSH], [test "x${HAVE_GMSH}" == "xyes"])
     2319
     2320        if test "x${HAVE_GMSH}" == "xyes"; then
     2321                AC_DEFINE([_HAVE_GMSH_], [1], [with Gmsh in ISSM src])
     2322
     2323                AC_MSG_CHECKING(for Gmsh version)
     2324                GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f1`
     2325                AC_MSG_RESULT([${GMSH_VERSION_MAJOR}])
     2326                AC_DEFINE_UNQUOTED(_GMSH_VERSION_MAJOR_, $GMSH_VERSION_MAJOR, [Gmsh major version])
     2327        fi     
     2328        dnl }}}
    23012329        dnl Capabilities
    23022330        dnl with-bamg{{{
  • issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-solid_earth.sh

    r24919 r24942  
    3535else
    3636        echo "MPICH not found"
     37        exit 1
     38fi
     39
     40echo "Moving Gmsh binaries to bin/"
     41if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
     42        cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
     43else
     44        echo "Gmsh not found"
    3745        exit 1
    3846fi
  • issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m

    r24919 r24942  
    1616
    1717        % Get Gmsh version
    18         %
    19         % NOTE:
    20         % - The output of `gmsh -version` does not follow a consistent format
    21         %       across major versions.
    22         % - Under Gmsh 3.*, output of `gmsh -info` needs to be explicitly
    23         %       redirected to console in order to be grep'ped.
    24         % - May need to modify the regex supplied to `sed` for future Gmsh versions.
    25         %
    26         % TODO:
    27         % - Move this so we can retrieve like we do with
    28         %       `IssmConfig(_DAKOTA_VERSION_)`.
    29         %
    30         [status,gmshmajorversion]=system('gmsh -info 2>&1 | grep "Version" | sed -e "s/Version[[:blank:]]*:[[:blank:]]//" | cut -d "." -f1');
    31 
    32         gmshmajorversion=str2int(gmshmajorversion);
     18    gmshmajorversion = IssmConfig('_GMSH_VERSION_MAJOR_');
    3319
    3420        if ~ismember([3,4],gmshmajorversion),
  • issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py

    r24919 r24942  
    1 import commands
     1import os
    22import subprocess
    33
    44import numpy as np
    55
     6from IssmConfig import IssmConfig
    67from MatlabFuncs import *
    78from mesh3dsurface import *
     
    2728
    2829    # Get Gmsh version
    29     #
    30     # NOTE:
    31     # - The output of `gmsh -version` does not follow a consistent format
    32     #   across major versions.
    33     # - Under Gmsh 3.*, output of `gmsh -info` needs to be explicitly
    34     #   redirected to console in order to be grep'ped.
    35     # - May need to modify the regex supplied to `sed` for future Gmsh versions.
    36     #
    37     # TODO:
    38     # - Move this so we can retrieve like we do with
    39     #   `IssmConfig(_DAKOTA_VERSION_)`.
    40     #
    41     gmshmajorversion = commands.getoutput('gmsh -info 2>&1 | grep "Version" | sed -e "s/Version[[:blank:]]*:[[:blank:]]//" | cut -d "." -f1')
    42 
    43     gmshmajorversion = int(gmshmajorversion)
     30    gmshmajorversion = IssmConfig('_GMSH_VERSION_MAJOR_')[0] # Stored as IssmDouble, which gets instantiated as a tuple in Python
    4431
    4532    if gmshmajorversion not in [3, 4]:
     
    5643    #initialize mesh:
    5744    mesh = mesh3dsurface()
    58 
    5945    #create .geo file:  {{{
    6046    fid = open('sphere.geo', 'w')
  • issm/trunk-jpl/src/wrappers/IssmConfig/IssmConfig.cpp

    r23287 r24942  
    107107                #endif
    108108        }
     109        else if(strcmp(name,"_GMSH_VERSION_MAJOR_")==0){
     110                #ifdef _GMSH_VERSION_MAJOR_
     111                value = IssmDouble(_GMSH_VERSION_MAJOR_);
     112                #else
     113                _error_("_GMSH_VERSION_MAJOR_ not found in config.h");
     114                #endif
     115        }
    109116        else if(strcmp(name,"ISSM_PREFIX")==0){
    110117                isstring = true;
Note: See TracChangeset for help on using the changeset viewer.