Changeset 15672


Ignore:
Timestamp:
08/01/13 13:40:16 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: added error message if matlab boost or dakota probided does not exist

File:
1 edited

Legend:

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

    r15665 r15672  
    9999        AC_ARG_WITH([matlab-dir],
    100100                AS_HELP_STRING([--with-matlab-dir=DIR], [matlab root directory. necessary for serial build.]),
    101                 [MATLAB_ROOT=$withval],[MATLAB_ROOT=""])
     101                [MATLAB_ROOT=$withval],[MATLAB_ROOT="no"])
    102102
    103103        AC_MSG_CHECKING([whether matlab is enabled])
    104         if test -d "$MATLAB_ROOT"; then
     104        if test "x$MATLAB_ROOT" = "xno" ; then
     105                 HAVE_MATLAB=no
     106        else
    105107                HAVE_MATLAB=yes
    106         else
    107                 HAVE_MATLAB=no
    108         fi
    109         if test x$HAVE_MATLAB = xyes; then
    110                 AC_DEFINE([_HAVE_MATLAB_],[1],[with Matlab in ISSM src])
     108                if ! test -d "$MATLAB_ROOT"; then
     109                  AC_MSG_ERROR([matlab directory provided ($MATLAB_ROOT) does not exist]);
     110                fi
     111                AC_DEFINE([_HAVE_MATLAB_],[1],[with matlab in ISSM src])
    111112        fi
    112113        AC_MSG_RESULT($HAVE_MATLAB)
     
    114115
    115116        dnl 2. Get Matlab libraries
    116         if test x$HAVE_MATLAB = xyes; then
     117        if test "x$HAVE_MATLAB" = "xyes"; then
    117118
    118119                AC_MSG_CHECKING(for matlab headers and libraries in $MATLAB_ROOT)
    119120                MATLABINCL="-I$MATLAB_ROOT/extern/include/"
    120121               
    121                 dnl 4. get MEXLIB MEXLINK and MEXEXT (experimental)
    122       dnl OS-dependent variables and checks
     122                dnl 4. get MEXLIB MEXLINK and MEXEXT (experimental) except for windows
    123123                case "${host_os}" in
    124124                        *cygwin*)
     
    140140      esac
    141141           AC_MSG_RESULT(done)
    142 
    143142                AC_SUBST([MATLABINCL])
    144143                AC_SUBST([MEX])
     
    152151        AC_ARG_WITH([triangle-dir],
    153152                          AS_HELP_STRING([--with-triangle-dir=DIR], [triangle root directory. necessary for serial build]),
    154                          [TRIANGLE_ROOT=$withval],[TRIANGLE_ROOT=""])
    155         AC_MSG_CHECKING(for triangle headers and libraries)
    156 
    157         if test -d "$TRIANGLE_ROOT"; then
    158 
    159                 dnl defaults
     153                         [TRIANGLE_ROOT=$withval],[TRIANGLE_ROOT="no"])
     154
     155  dnl Check whether triangle is enabled
     156        AC_MSG_CHECKING([for triangle])
     157        if test "x$TRIANGLE_ROOT" = "xno" ; then
     158                HAVE_TRIANGLE=no
     159        else
    160160                HAVE_TRIANGLE=yes
     161                if ! test -d "$TRIANGLE_ROOT"; then
     162                        AC_MSG_ERROR([triangle directory provided ($TRIANGLE_ROOT) does not exist]);
     163                fi
     164                AC_DEFINE([_HAVE_TRIANGLE_],[1],[with triangle in ISSM src])
     165        fi
     166        AC_MSG_RESULT($HAVE_TRIANGLE)
     167        AM_CONDITIONAL([TRIANGLE],[test x$HAVE_TRIANGLE = xyes])
     168
     169        dnl library and header files
     170        if test "x$HAVE_TRIANGLE" = "xyes"; then
    161171                TRIANGLEINCL=-I$TRIANGLE_ROOT/
    162 
    163172                case "${host_os}" in
    164173                                *cygwin*)
     
    172181                                ;;
    173182                        esac
    174 
    175183                AC_DEFINE([_HAVE_TRIANGLE_],[1],[with Triangle in ISSM src])
    176184                AC_SUBST([TRIANGLEINCL])
    177185                AC_SUBST([TRIANGLELIB])
    178 
    179         else
    180                 HAVE_TRIANGLE=no
    181         fi
    182         AC_MSG_RESULT($HAVE_TRIANGLE)
     186        fi
    183187        dnl }}}
    184188        dnl boost{{{
    185189        AC_ARG_WITH([boost-dir],
    186190          AS_HELP_STRING([--with-boost-dir=DIR], [boost root directory.]),
    187           [BOOST_ROOT=$withval],[BOOST_ROOT=""])
    188         AC_MSG_CHECKING(for boost)
    189        
    190         if test -d "$BOOST_ROOT"; then
    191                 dnl defaults
     191          [BOOST_ROOT=$withval],[BOOST_ROOT="no"])
     192
     193        dnl Check whether boost is enabled
     194        AC_MSG_CHECKING([for boost])
     195        if test "x$BOOST_ROOT" = "xno" ; then
     196                HAVE_BOOST=no
     197        else
    192198                HAVE_BOOST=yes
     199                if ! test -d "$BOOST_ROOT"; then
     200                        AC_MSG_ERROR([boost directory provided ($BOOST_ROOT) does not exist]);
     201                fi
     202                AC_DEFINE([_HAVE_BOOST_],[1],[with boost in ISSM src])
     203        fi
     204        AC_MSG_RESULT($HAVE_BOOST)
     205        AM_CONDITIONAL([BOOST],[test x$HAVE_BOOST = xyes])
     206
     207        dnl library and header files
     208        if test "x$HAVE_BOOST" = "xyes"; then
    193209                BOOSTINCL=-I$BOOST_ROOT/include
    194210                BOOSTLIB="-L$BOOST_ROOT/lib -lboost_python"
    195 
    196211                AC_DEFINE([_HAVE_BOOST_],[1],[with Boost in ISSM src])
    197212                AC_SUBST([BOOSTINCL])
    198213                AC_SUBST([BOOSTLIB])
    199         else
    200                 HAVE_BOOST=no
    201         fi
    202         AM_CONDITIONAL([BOOST], [test x$HAVE_BOOST = xyes])
    203         AC_MSG_RESULT($HAVE_BOOST)
     214        fi
    204215        dnl }}}
    205216        dnl dakota{{{
     
    207218          AS_HELP_STRING([--with-dakota-dir=DIR], [dakota root directory. necessary for serial build]),
    208219          [DAKOTA_ROOT=$withval],[DAKOTA_ROOT=""])
    209         AC_MSG_CHECKING(for dakota)
    210220       
    211         if test -d "$DAKOTA_ROOT"; then
    212 
    213                 dnl defaults
     221        dnl Check whether dakota is enabled
     222        AC_MSG_CHECKING([for dakota])
     223        if test "x$DAKOTA_ROOT" = "xno" ; then
     224                HAVE_DAKOTA=no
     225        else
    214226                HAVE_DAKOTA=yes
    215                 AC_MSG_RESULT($HAVE_DAKOTA)
     227                if ! test -d "$DAKOTA_ROOT"; then
     228                        AC_MSG_ERROR([dakota directory provided ($DAKOTA_ROOT) does not exist]);
     229                fi
     230                AC_DEFINE([_HAVE_DAKOTA_],[1],[with dakota in ISSM src])
     231        fi
     232        AC_MSG_RESULT($HAVE_DAKOTA)
     233        AM_CONDITIONAL([DAKOTA],[test x$HAVE_DAKOTA = xyes])
     234
     235        dnl library and header files
     236        if test "x$HAVE_DAKOTA" = "xyes"; then
    216237                DAKOTAINCL=-I$DAKOTA_ROOT/include
     238
    217239                AC_MSG_CHECKING(for dakota version)
    218240                if test -f "$DAKOTA_ROOT/../src/src/CommandLineHandler.C"; then
     
    224246                fi
    225247                fi
    226 
    227248                AC_MSG_RESULT($DAKOTA_VERSION)
    228249                AC_DEFINE_UNQUOTED([_DAKOTA_VERSION_],"$DAKOTA_VERSION",[Dakota version number])
     250
    229251                DAKOTAFLAGS=""
    230252                case "${host_os}" in
     
    301323                AC_SUBST([DAKOTAFLAGS])
    302324                AC_SUBST([DAKOTALIB])
    303 
    304         else
    305                 HAVE_DAKOTA=no
    306                 AC_MSG_RESULT($HAVE_DAKOTA)
    307         fi
    308 
    309         AM_CONDITIONAL([DAKOTA], [test x$HAVE_DAKOTA = xyes])
     325        fi
    310326        dnl }}}
    311327        dnl python{{{
     
    535551                HAVE_GSL=no
    536552        else
    537                 if test -d "$GSL_ROOT"; then
    538 
    539                         dnl defaults
    540                         HAVE_GSL=yes
    541                         GSLINCL="-I$GSL_ROOT/include"
    542 
    543                         if test "x$HAVE_ATLAS" = "xyes" ; then
    544                                 GSLLIB="-dy -L$GSL_ROOT/lib -lgsl -L$ATLAS_ROOT/lib -lcblas -latlas -lm"
    545                         else
    546                                 GSLLIB="-dy -L$GSL_ROOT/lib -lgsl -lgslcblas -lm"
    547                         fi
    548 
    549                         AC_DEFINE([_HAVE_GSL_],[1],[with gsl in ISSM src])
    550                         AC_SUBST([GSLINCL])
    551                         AC_SUBST([GSLLIB])
    552 
     553                if ! test -d "$GSL_ROOT"; then
     554                        AC_MSG_ERROR([gsl directory provided ($GSL_ROOT) does not exist]);
     555                fi
     556
     557                HAVE_GSL=yes
     558                GSLINCL="-I$GSL_ROOT/include"
     559
     560                if test "x$HAVE_ATLAS" = "xyes" ; then
     561                        GSLLIB="-dy -L$GSL_ROOT/lib -lgsl -L$ATLAS_ROOT/lib -lcblas -latlas -lm"
    553562                else
    554                         AC_MSG_ERROR([gsl directory provided ($GSL_ROOT) does not exist]);
    555                 fi
     563                        GSLLIB="-dy -L$GSL_ROOT/lib -lgsl -lgslcblas -lm"
     564                fi
     565
     566                AC_DEFINE([_HAVE_GSL_],[1],[with gsl in ISSM src])
     567                AC_SUBST([GSLINCL])
     568                AC_SUBST([GSLLIB])
    556569        fi
    557570        AM_CONDITIONAL([GSL], [test x$HAVE_GSL = xyes])
     
    11951208        AC_MSG_RESULT(done)
    11961209        dnl }}}
     1210        dnl math77{{{
     1211                AC_ARG_WITH([math77-dir],
     1212                                        AS_HELP_STRING([--with-math77-dir=DIR], [math77 root directory.]),
     1213                                        [MATH77_ROOT=$withval],[MATH77_ROOT=""])
     1214                  AC_MSG_CHECKING(for math77)
     1215
     1216                  if test -d "$MATH77_ROOT"; then
     1217
     1218                        HAVE_MATH77=yes
     1219                          MATH77LIB="-L$MATH77_ROOT/ -lmath77"
     1220
     1221                          AC_DEFINE([_HAVE_MATH77_],[1],[with math77 in ISSM src])
     1222                          AC_SUBST([MATH77LIB])
     1223                  else
     1224                        HAVE_MATH77=no
     1225                          fi
     1226                          AC_MSG_RESULT($HAVE_MATH77)
     1227                          dnl }}}
    11971228        dnl fortran{{{
    11981229        AC_ARG_WITH([fortran],
     
    15131544        AC_MSG_RESULT($HAVE_RIFTS)
    15141545        dnl }}}
    1515         dnl math77{{{
    1516         AC_ARG_WITH([math77-dir],
    1517                 AS_HELP_STRING([--with-math77-dir=DIR], [math77 root directory.]),
    1518                 [MATH77_ROOT=$withval],[MATH77_ROOT=""])
    1519         AC_MSG_CHECKING(for math77)
    1520 
    1521         if test -d "$MATH77_ROOT"; then
    1522 
    1523           HAVE_MATH77=yes
    1524           MATH77LIB="-L$MATH77_ROOT/ -lmath77"
    1525 
    1526           AC_DEFINE([_HAVE_MATH77_],[1],[with math77 in ISSM src])
    1527           AC_SUBST([MATH77LIB])
    1528         else
    1529                 HAVE_MATH77=no
    1530         fi
    1531         AC_MSG_RESULT($HAVE_MATH77)
    1532         dnl }}}
    15331546        dnl with-gia{{{
    15341547        AC_ARG_WITH([gia],
     
    16351648        AM_CONDITIONAL([THREED], [test x$HAVE_3D = xyes])
    16361649        AC_MSG_RESULT($HAVE_3D)
    1637         dnl }}}
    1638         dnl checks{{{
    1639         AC_MSG_CHECKING(consistency between all libraries)
    1640        
    1641         dnl check that if petsc is requested , mpi should be specified
    1642         if test "$HAVE_PETSC" = "yes" ; then
    1643                 if test "$HAVE_MPI" = "NO";  then
    1644                         AC_MSG_ERROR([petsc requires mpi!]);
    1645                 fi
    1646         fi
    1647 
    1648         dnl check that we have either python or matlab support if we compile the modules
    1649         if test "$MODULES_VALUE" = "yes"  && test "$HAVE_MATLAB" = "no" && test "$HAVE_PYTHON" = "no"; then
    1650                 AC_MSG_ERROR([need at least python or matlab support to compile modules (or use --with-modules=no)]);
    1651         fi
    1652 
    1653         dnl check that if we have MPI, we have metis
    1654         if test "$HAVE_METIS" = "yes"  && test "$HAVE_MPI" = "no" ; then
    1655         AC_MSG_ERROR([need mpi if using the metis partitioner!]);
    1656         fi
    1657 
    1658         AC_MSG_RESULT(done)
    16591650        dnl }}}
    16601651
     
    17121703        AC_MSG_RESULT($USE_64BIT_INDICES)
    17131704        dnl }}}
     1705
     1706        dnl Checks
     1707        dnl checks{{{
     1708                AC_MSG_CHECKING(consistency between all libraries)
     1709
     1710                  dnl check that if petsc is requested , mpi should be specified
     1711                  if test "$HAVE_PETSC" = "yes" ; then
     1712                        if test "$HAVE_MPI" = "NO";  then
     1713                         AC_MSG_ERROR([petsc requires mpi!]);
     1714                fi
     1715                  fi
     1716
     1717                  dnl check that we have either python or matlab support if we compile the modules
     1718                  if test "$MODULES_VALUE" = "yes"  && test "$HAVE_MATLAB" = "no" && test "$HAVE_PYTHON" = "no"; then
     1719                        AC_MSG_ERROR([need at least python or matlab support to compile modules (or use --with-modules=no)]);
     1720                fi
     1721
     1722                  dnl check that if we have MPI, we have metis
     1723                  if test "$HAVE_METIS" = "yes"  && test "$HAVE_MPI" = "no" ; then
     1724                        AC_MSG_ERROR([need mpi if using the metis partitioner!]);
     1725                fi
     1726
     1727                  AC_MSG_RESULT(done)
     1728                  dnl }}}
    17141729])
Note: See TracChangeset for help on using the changeset viewer.