Changeset 11848


Ignore:
Timestamp:
04/01/12 11:25:51 (13 years ago)
Author:
Eric.Larour
Message:

Added boost, python and python-numpy support

File:
1 edited

Legend:

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

    r11736 r11848  
    9393                                                         [matlab root directory. necessary for serial build.]),
    9494                         [MATLAB_ROOT=$withval],[MATLAB_ROOT=""])
    95        
     95
    9696        if test -d "$MATLAB_ROOT"; then
    9797
     
    152152                AC_SUBST([MATLABINCL])
    153153                AC_SUBST([MEX])
    154                 AC_SUBST([MEXEXT])
     154                WRAPPEREXT=$MEXEXT
     155                AC_SUBST([WRAPPEREXT])
    155156                AC_SUBST([MEXLIB])
    156157                AC_SUBST([MEXLINK])
     
    162163
    163164       
    164         if test $HAVE_MATLAB = no; then
    165                 if test "$SERIAL_VALUE" = "yes" ; then
    166                         AC_MSG_ERROR([--with-matlab-dir  missing. Matlab is needed to run ISSM serially!])
    167                 fi
    168         fi
    169 
    170165        dnl should we use large arrays compilation (Matlab 7.5 and upper?)
    171166        if test $HAVE_MATLAB = yes; then
     
    198193        fi
    199194        AM_CONDITIONAL(LARGEARRAYS, test x$largearrays = xyes)
     195        AM_CONDITIONAL([MATLAB], [test x$HAVE_MATLAB = xyes])
    200196       
    201197        dnl }}}
     
    273269        AM_CONDITIONAL([DAKOTA], [test x$HAVE_DAKOTA = xyes])
    274270        AC_MSG_RESULT($HAVE_DAKOTA)
     271        dnl }}}
     272        dnl boost{{{1
     273        AC_ARG_WITH([boost-dir],
     274                          AS_HELP_STRING([--with-boost-dir = DIR], [boost root directory.]),
     275                         [BOOST_ROOT=$withval],[BOOST_ROOT=""])
     276        AC_MSG_CHECKING(for Boost)
     277       
     278        if test -d "$BOOST_ROOT"; then
     279                dnl defaults
     280                HAVE_BOOST=yes
     281                BOOSTINCL=-I$BOOST_ROOT/include
     282                BOOSTLIB="-L$BOOST_ROOT/lib -lboost_python"
     283
     284                AC_DEFINE([_HAVE_BOOST_],[1],[with Boost in ISSM src])
     285                AC_SUBST([BOOSTINCL])
     286                AC_SUBST([BOOSTLIB])
     287        else
     288                HAVE_BOOST=no
     289        fi
     290        AM_CONDITIONAL([BOOST], [test x$HAVE_BOOST = xyes])
     291        AC_MSG_RESULT($HAVE_BOOST)
     292        dnl }}}
     293        dnl python{{{1
     294        AC_ARG_WITH([python-dir],
     295                          AS_HELP_STRING([--with-python-dir = DIR], [python root directory.]),
     296                         [PYTHON_ROOT=$withval],[PYTHON_ROOT=""])
     297        AC_MSG_CHECKING(for Python)
     298       
     299        if test -d "$PYTHON_ROOT"; then
     300                dnl defaults
     301                HAVE_PYTHON=yes
     302                PYTHONINCL=-I$PYTHON_ROOT/include
     303                PYTHONLIB="-L$PYTHON_ROOT/lib -lpython3.2"
     304                PYTHONEXT=.so
     305
     306                AC_DEFINE([_HAVE_PYTHON_],[1],[with Python in ISSM src])
     307                AC_SUBST([PYTHONINCL])
     308                AC_SUBST([PYTHONLIB])
     309                WRAPPEREXT=$PYTHONEXT
     310                AC_SUBST([WRAPPEREXT])
     311        else
     312                HAVE_PYTHON=no
     313        fi
     314        AM_CONDITIONAL([PYTHON], [test x$HAVE_PYTHON = xyes])
     315        AC_MSG_RESULT($HAVE_PYTHON)
     316        dnl }}}
     317        dnl python-numpy{{{1
     318        AC_ARG_WITH([python-numpy-dir],
     319                          AS_HELP_STRING([--with-python-numpy-dir = DIR], [python-numpy root directory.]),
     320                         [PYTHON_NUMPY_ROOT=$withval],[PYTHON_NUMPY_ROOT=""])
     321        AC_MSG_CHECKING(for Python-Numpy)
     322       
     323        if test -d "$PYTHON_NUMPY_ROOT"; then
     324                dnl defaults
     325                HAVE_PYTHON_NUMPY=yes
     326                PYTHON_NUMPYINCL=-I$PYTHON_NUMPY_ROOT
     327
     328                AC_DEFINE([_HAVE_PYTHON_NUMPY_],[1],[with Python-Numpy in ISSM src])
     329                AC_SUBST([PYTHON_NUMPYINCL])
     330        else
     331                HAVE_PYTHON_NUMPY=no
     332        fi
     333        AC_MSG_RESULT($HAVE_PYTHON_NUMPY)
    275334        dnl }}}
    276335        dnl chaco{{{1
     
    11681227                fi
    11691228        fi
     1229
     1230        dnl check that we have either python or matlab support if we only compile serially
     1231        if test "$PARALLEL_VALUE" = "no"  && test "$HAVE_MATLAB" = "no" && test "$HAVE_PYTHON" = "no"; then
     1232                AC_MSG_ERROR([need at least python or matlab support to compile only in serial mode!]);
     1233        fi
     1234
     1235        dnl check that we don't have with-matlab and with-python at the same time
     1236        if test "$HAVE_PYTHON" = "yes" ; then
     1237                if test "$HAVE_MATLAB" = "yes";  then
     1238                        AC_MSG_ERROR([cannot create matlab and python wrappers simultaneously! Please choose one or the other.]);
     1239                fi
     1240        fi
     1241
    11701242        AC_MSG_RESULT(done)
    11711243        dnl }}}
Note: See TracChangeset for help on using the changeset viewer.