Changeset 25716


Ignore:
Timestamp:
10/29/20 08:38:15 (4 years ago)
Author:
Mathieu Morlighem
Message:

BUG: grep is not always in /usr/bin!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/m4/issm_options.m4

    r25710 r25716  
    210210        SYSTEM_FMEMOPEN=1
    211211        if test "${IS_MAC}" == "yes"; then
    212                 if [[ $(system_profiler SPSoftwareDataType | /usr/bin/grep "System Version:" | sed -e "s/[[:space:]]*System Version: macOS //" | cut -d "." -f 2) -lt 13 ]]; then
     212                if [[ $(system_profiler SPSoftwareDataType | grep "System Version:" | sed -e "s/[[:space:]]*System Version: macOS //" | cut -d "." -f 2) -lt 13 ]]; then
    213213                        SYSTEM_FMEMOPEN=0
    214214                fi
     
    378378                        *)
    379379                                MATLABINCL="-I${MATLAB_ROOT}/extern/include"
    380                                 MEXLINK=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | /usr/bin/grep LDFLAGS | sed -e "s/         LDFLAGS            = //g")
    381                                 MEXLIB=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | /usr/bin/grep CXXLIBS | sed -e "s/         CXXLIBS            = //g")
    382                                 MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | /usr/bin/grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
     380                                MEXLINK=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDFLAGS | sed -e "s/         LDFLAGS            = //g")
     381                                MEXLIB=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep CXXLIBS | sed -e "s/         CXXLIBS            = //g")
     382                                MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
    383383                                dnl version 2014 and up
    384384                                if test -z "${MEXEXT}"; then
     
    387387                                        ${MATLAB_ROOT}/bin/mex -v -lmex conftest.cpp > conftest.tmp 2>&1
    388388                                        rm -f conftest.cpp
    389                                         MEXLINK=$(cat conftest.tmp | /usr/bin/grep LDFLAGS | sed -e "s/LDFLAGS ://g")
    390                                         MEXLIB=$(cat conftest.tmp | /usr/bin/grep LINKLIBS | sed -e "s/LINKLIBS ://g")
    391                                         MEXEXT=$(cat conftest.tmp | /usr/bin/grep LDEXT | sed -e "s/LDEXT ://g" | awk '{print $[1]}')
     389                                        MEXLINK=$(cat conftest.tmp | grep LDFLAGS | sed -e "s/LDFLAGS ://g")
     390                                        MEXLIB=$(cat conftest.tmp | grep LINKLIBS | sed -e "s/LINKLIBS ://g")
     391                                        MEXEXT=$(cat conftest.tmp | grep LDEXT | sed -e "s/LDEXT ://g" | awk '{print $[1]}')
    392392                                        if test -z "${MEXEXT}"; then
    393393                                         cat conftest.tmp
     
    508508                #BOOSTLIB="-L$BOOST_ROOT/lib -lboost_python"
    509509                AC_MSG_CHECKING(for Boost version)
    510                 BOOST_VERSION=`cat ${BOOST_ROOT}/include/boost/version.hpp | /usr/bin/grep "#define BOOST_VERSION " | sed 's/.*BOOST_VERSION //'`
     510                BOOST_VERSION=`cat ${BOOST_ROOT}/include/boost/version.hpp | grep "#define BOOST_VERSION " | sed 's/.*BOOST_VERSION //'`
    511511                BOOST_VERSION_MAJOR=`expr ${BOOST_VERSION} / 100000`
    512512                BOOST_VERSION_MINOR=`expr ${BOOST_VERSION} / 100 % 1000`
     
    548548                DAKOTA_VERSION_OUTPUT=`${DAKOTA_ROOT}/bin/dakota -v`
    549549                if test -n "${DAKOTA_VERSION_OUTPUT}"; then
    550                         DAKOTA_VERSION=`echo ${DAKOTA_VERSION_OUTPUT} /usr/bin/grep "Dakota version" | sed 's/Dakota version //' | sed 's/ .*//'`
     550                        DAKOTA_VERSION=`echo ${DAKOTA_VERSION_OUTPUT} grep "Dakota version" | sed 's/Dakota version //' | sed 's/ .*//'`
    551551                elif test -f "${DAKOTA_ROOT}/VERSION"; then
    552                         DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/VERSION | /usr/bin/grep 'DAKOTA Version' | sed 's/.*DAKOTA Version //' | sed 's/ .*//'`
     552                        DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/VERSION | grep 'DAKOTA Version' | sed 's/.*DAKOTA Version //' | sed 's/ .*//'`
    553553                elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.C"; then
    554                         DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.C | /usr/bin/grep 'DAKOTA version' | /usr/bin/grep 'release' | /usr/bin/grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
     554                        DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.C | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
    555555                elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp"; then
    556                         DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp | /usr/bin/grep 'DAKOTA version' | /usr/bin/grep 'release' | /usr/bin/grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
     556                        DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
    557557                else
    558558                        AC_MSG_ERROR([Dakota CommandLineHandler.C or CommandLineHandler.cpp file not found to determine DAKOTA_VERSION!]);
     
    12131213
    12141214                AC_MSG_CHECKING(for PETSc version)
    1215                 PETSC_MAJOR=`cat ${PETSC_ROOT}/include/petscversion.h | /usr/bin/grep "#define PETSC_VERSION_MAJOR" | sed 's/#define PETSC_VERSION_MAJOR//' | sed 's/ //g'`
    1216                 PETSC_MINOR=`cat ${PETSC_ROOT}/include/petscversion.h | /usr/bin/grep "#define PETSC_VERSION_MINOR" | sed 's/#define PETSC_VERSION_MINOR//' | sed 's/ //g'`
     1215                PETSC_MAJOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MAJOR" | sed 's/#define PETSC_VERSION_MAJOR//' | sed 's/ //g'`
     1216                PETSC_MINOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MINOR" | sed 's/#define PETSC_VERSION_MINOR//' | sed 's/ //g'`
    12171217                AC_DEFINE_UNQUOTED([_PETSC_MAJOR_], [$PETSC_MAJOR], [PETSc version major])
    12181218                AC_DEFINE_UNQUOTED([_PETSC_MINOR_], [$PETSC_MINOR], [PETSc version minor])
     
    12201220
    12211221                AC_MSG_CHECKING(whether PETSc is the development version)
    1222                 PETSC_RELEASE=`cat ${PETSC_ROOT}/include/petscversion.h | /usr/bin/grep "#define PETSC_VERSION_RELEASE" | sed 's/#define PETSC_VERSION_RELEASE//' | sed 's/ //g'`
     1222                PETSC_RELEASE=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_RELEASE" | sed 's/#define PETSC_VERSION_RELEASE//' | sed 's/ //g'`
    12231223                if test "${PETSC_RELEASE}" == "0"; then
    12241224                        AC_DEFINE([_HAVE_PETSCDEV_], [1], [with PETSc-dev])
     
    22102210                else
    22112211                        if test -f "${PETSC_ROOT}/conf/petscvariables"; then
    2212                                 PETSC_REC_GRAPHICS_LIB=$(cat ${PETSC_ROOT}/conf/petscvariables | /usr/bin/grep X_LIB)
     2212                                PETSC_REC_GRAPHICS_LIB=$(cat ${PETSC_ROOT}/conf/petscvariables | grep X_LIB)
    22132213                                AC_MSG_ERROR([Xlib (graphics library) provided (${GRAPHICS_LIB}) does not exist! PETSc suggests the following library: ${PETSC_REC_GRAPHICS_LIB}]);
    22142214                        fi
     
    23492349
    23502350                AC_MSG_CHECKING(for Gmsh version)
    2351                 GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | /usr/bin/grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f 1`
     2351                GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f 1`
    23522352                AC_MSG_RESULT([${GMSH_VERSION_MAJOR}])
    23532353                AC_DEFINE_UNQUOTED(_GMSH_VERSION_MAJOR_, $GMSH_VERSION_MAJOR, [Gmsh major version])
Note: See TracChangeset for help on using the changeset viewer.