Changeset 11862
- Timestamp:
- 04/02/12 16:42:58 (13 years ago)
- Location:
- issm/trunk-jpl/m4
- Files:
-
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/m4/issm_options.m4
r11849 r11862 88 88 AC_MSG_RESULT(done) 89 89 dnl }}} 90 dnl Matlab {{{1 90 dnl Matlab{{{ 91 92 dnl 1. See if matlab has been provided 91 93 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]) 96 99 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 101 171 AC_MSG_CHECKING(for Matlab headers and libraries in $MATLAB_ROOT) 102 103 dnl defaults104 HAVE_MATLAB=yes105 172 MATLABINCL=-I"$MATLAB_ROOT/extern/include"; 106 173 … … 120 187 ;; 121 188 *darwin*) 122 123 189 dnl mex -v gives all the flags for compilation of mex files 124 190 dnl if matlab version is 7.10 or more, we must use mexmaci64 (64 bits) … … 131 197 fi 132 198 fi 133 134 199 MEXEXT=`$MATLAB_ROOT/bin/mexext` 135 200 MEXEXT=".$MEXEXT" 136 137 dnl Old MEXLINK138 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"139 201 ;; 140 202 *cygwin*) … … 148 210 ;; 149 211 esac 150 151 AC_DEFINE([_HAVE_MATLAB_],[1],[with Matlab in ISSM src]) 212 AC_MSG_RESULT(done) 213 152 214 AC_SUBST([MATLABINCL]) 153 215 AC_SUBST([MEX]) … … 156 218 AC_SUBST([MEXLIB]) 157 219 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 197 222 dnl }}} 198 223 dnl triangle {{{1 … … 572 597 MPIINCL=-I"$MPI_INCLUDE/" 573 598 AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src]) 574 AC_DEFINE([HAVE_MPI],[1],[with Mpi in ISSM src])575 599 AC_SUBST([MPIINCL]) 576 600 AC_SUBST([MPILIB]) … … 704 728 705 729 AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src]) 706 AC_DEFINE([HAVE_MPI],[1],[with Mpi in ISSM src])707 730 AC_SUBST([MPIINCL]) 708 731 AC_SUBST([MPILIB])
Note:
See TracChangeset
for help on using the changeset viewer.