Changeset 11862


Ignore:
Timestamp:
04/02/12 16:42:58 (13 years ago)
Author:
Mathieu Morlighem
Message:

Getting rid of matlab.m4 and simplified m4

Location:
issm/trunk-jpl/m4
Files:
1 deleted
1 edited

Legend:

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

    r11849 r11862  
    8888        AC_MSG_RESULT(done)
    8989        dnl }}}
    90         dnl Matlab {{{1
     90        dnl Matlab{{{
     91
     92        dnl 1. See if matlab has been provided
    9193        AC_ARG_WITH([matlab-dir],
    92                           AS_HELP_STRING([--with-matlab-dir = DIR],
    93                                                          [matlab root directory. necessary for serial build.]),
    94                          [MATLAB_ROOT=$withval],[MATLAB_ROOT=""])
    95 
     94                                AS_HELP_STRING([--with-matlab-dir = DIR],
     95                                        [matlab root directory. necessary for serial build.]),
     96                                [MATLAB_ROOT=$withval],[MATLAB_ROOT=""])
     97
     98        AC_MSG_CHECKING([wether Matlab is enabled])
    9699        if test -d "$MATLAB_ROOT"; then
    97 
    98                 dnl matlab version (matlab.m4)
    99                 AX_MATLAB_VERSION
    100 
     100                HAVE_MATLAB=yes
     101        else
     102                HAVE_MATLAB=no
     103        fi
     104        if test x$HAVE_MATLAB = xyes; then
     105                AC_DEFINE([_HAVE_MATLAB_],[1],[with Matlab in ISSM src])
     106        fi
     107        AC_MSG_RESULT($HAVE_MATLAB)
     108        AM_CONDITIONAL([MATLAB], [test x$HAVE_MATLAB = xyes])
     109
     110        dnl 2. if matlab is provided, get version number
     111        if test x$HAVE_MATLAB = xyes; then
     112                AC_MSG_CHECKING([for Matlab version])
     113                MATLAB_VERSION=""
     114
     115                dnl For Matlab R2008a and more, the version number is stored in .VERSION
     116                if test -f "$MATLAB_ROOT/.VERSION" ; then
     117                        MATLAB_VERSION=$(cat $MATLAB_ROOT/.VERSION)
     118                fi
     119                dnl Otherwise find version in file stored in bin/util/mex/version.txt
     120                if test -f "$MATLAB_ROOT/bin/util/mex/version.txt" ; then
     121                        MATLAB_VERSION=$(cat $MATLAB_ROOT/bin/util/mex/version.txt)
     122                fi
     123
     124                dnl check that we found the version
     125                if test -z "$MATLAB_VERSION" ; then
     126                        AC_MSG_ERROR([Matlab version not found])
     127                fi
     128
     129                case $MATLAB_VERSION in
     130                        @<:@1-9@:>@.@<:@0-9@:>@ | @<:@1-9@:>@@<:@0-9@:>@.@<:@0-9@:>@ | @<:@1-9@:>@.@<:@1-9@:>@@<:@0-9@:>@)
     131                                MATLAB_MAJOR=$(echo $MATLAB_VERSION | sed -e "s/^\(@<:@0-9@:>@*\)\.@<:@0-9@:>@*.*/\1/")
     132                                MATLAB_MINOR=$(echo $MATLAB_VERSION | sed -e "s/^@<:@0-9@:>@*\.\(@<:@0-9@:>@*\).*/\1/")
     133                                ;;
     134                        R2007a)
     135                          MATLAB_MAJOR=7
     136                          MATLAB_MINOR=4
     137                          ;;
     138                        R2008a)
     139                          MATLAB_MAJOR=7
     140                          MATLAB_MINOR=6
     141                          ;;
     142                        R2009a)
     143                          MATLAB_MAJOR=7
     144                          MATLAB_MINOR=8
     145                          ;;
     146                        R2010a)
     147                          MATLAB_MAJOR=7
     148                          MATLAB_MINOR=10
     149                          ;;
     150                        R2010b)
     151                          MATLAB_MAJOR=7
     152                          MATLAB_MINOR=11
     153                          ;;
     154                        R2011a)
     155                          MATLAB_MAJOR=7
     156                          MATLAB_MINOR=12
     157                          ;;
     158                        R2011b)
     159                          MATLAB_MAJOR=7
     160                          MATLAB_MINOR=13
     161                          ;;
     162                        *)
     163                          AC_MSG_ERROR([can not determine Matlab version number])
     164                        esac
     165                AC_SUBST([MATLAB_VERSION])
     166                AC_SUBST([MATLAB_MAJOR])
     167                AC_SUBST([MATLAB_MINOR])
     168                AC_MSG_RESULT($MATLAB_VERSION ($MATLAB_MAJOR.$MATLAB_MINOR))
     169
     170                dnl 3. Get Matlab libraries
    101171                AC_MSG_CHECKING(for Matlab headers and libraries in $MATLAB_ROOT)
    102 
    103                 dnl defaults
    104                 HAVE_MATLAB=yes
    105172                MATLABINCL=-I"$MATLAB_ROOT/extern/include";
    106173               
     
    120187                        ;;
    121188                        *darwin*)
    122 
    123189                                dnl mex -v gives all the flags for compilation of mex files
    124190                                dnl if matlab version is 7.10 or more, we must use mexmaci64 (64 bits)
     
    131197                                         fi
    132198                                fi
    133 
    134199                                MEXEXT=`$MATLAB_ROOT/bin/mexext`
    135200                                MEXEXT=".$MEXEXT"
    136 
    137                                 dnl Old MEXLINK
    138                                 dnl MEXLINK="-Wl,-twolevel_namespace -undefined error -arch i386 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -bundle -Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci/mexFunction.map"
    139201                        ;;
    140202                        *cygwin*)
     
    148210                        ;;
    149211                esac
    150 
    151                 AC_DEFINE([_HAVE_MATLAB_],[1],[with Matlab in ISSM src])
     212           AC_MSG_RESULT(done)
     213
    152214                AC_SUBST([MATLABINCL])
    153215                AC_SUBST([MEX])
     
    156218                AC_SUBST([MEXLIB])
    157219                AC_SUBST([MEXLINK])
    158        
    159                 AC_MSG_RESULT($HAVE_MATLAB)
    160         else
    161                 HAVE_MATLAB=no
    162         fi
    163 
    164        
    165         dnl should we use large arrays compilation (Matlab 7.5 and upper?)
    166         if test $HAVE_MATLAB = yes; then
    167                
    168                 dnl  if matlab version is 7.5 and more, and if platform is x86_64, then compile with largearray
    169                 dnl  default is no
    170                 largearrays=no
    171                 if test $MATLAB_MAJOR -ge 7; then
    172                         if test $MATLAB_MINOR -ge 5; then
    173                                 case "${host_os}" in
    174                                         *linux*)
    175                                                 if test "${host_cpu}" = "x86_64"; then
    176                                                         largearrays=yes
    177                                                 fi
    178                                         ;;
    179                                         *cygwin*)
    180                                                 largearrays=yes
    181                                         ;;
    182 
    183                                         *darwin*)
    184                                                 if test $MATLAB_MAJOR -ge 7; then
    185                                                         if test $MATLAB_MINOR -ge 10; then
    186                                                                 largearrays=yes
    187                                                         fi
    188                                                 fi
    189                                         ;;
    190                                 esac
    191                         fi
    192                 fi
    193         fi
    194         AM_CONDITIONAL(LARGEARRAYS, test x$largearrays = xyes)
    195         AM_CONDITIONAL([MATLAB], [test x$HAVE_MATLAB = xyes])
    196        
     220        fi
     221
    197222        dnl }}}
    198223        dnl triangle {{{1
     
    572597                        MPIINCL=-I"$MPI_INCLUDE/"
    573598                        AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
    574                         AC_DEFINE([HAVE_MPI],[1],[with Mpi in ISSM src])
    575599                        AC_SUBST([MPIINCL])
    576600                        AC_SUBST([MPILIB])
     
    704728                                                                 
    705729                AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
    706                 AC_DEFINE([HAVE_MPI],[1],[with Mpi in ISSM src])
    707730                AC_SUBST([MPIINCL])
    708731                AC_SUBST([MPILIB])
Note: See TracChangeset for help on using the changeset viewer.