Changeset 18119


Ignore:
Timestamp:
06/06/14 13:41:27 (11 years ago)
Author:
Mathieu Morlighem
Message:

NEW: added support for matlab 2014+ mex

File:
1 edited

Legend:

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

    r17895 r18119  
    168168               
    169169                dnl 4. get MEXLIB MEXLINK and MEXEXT (experimental) except for windows
     170                AC_MSG_CHECKING([matlab's mex compilation flags])
    170171                case "${host_os}" in
    171172                        *cygwin*)
     
    184185                 MEXLIB=$( $MATLAB_ROOT/bin/mex -v 2>&1 < /dev/null | grep CXXLIBS     | sed -e "s/         CXXLIBS            = //g")
    185186                      MEXEXT=$( $MATLAB_ROOT/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
     187
     188                                dnl version 2014 and up
     189                                if test "x$MEXEXT" = "x" ; then
     190                                         echo "#include <mex.h>" > conftest.cpp
     191                                         echo "void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){}" >> conftest.cpp
     192                                         $MATLAB_ROOT/bin/mex -v -lmex conftest.cpp > conftest.tmp 2>&1
     193                                         rm -f conftest.cpp
     194                                         MEXLINK=$(cat conftest.tmp | grep LDFLAGS  | sed -e "s/LDFLAGS ://g")
     195                                         MEXLIB=$( cat conftest.tmp | grep LINKLIBS | sed -e "s/LINKLIBS ://g")
     196                                         MEXEXT=$( cat conftest.tmp | grep LDEXT    | sed -e "s/LDEXT ://g" | awk '{print $[1]}')
     197                                         rm -f conftest.tmp
     198                                fi
     199
    186200                        ;;
    187201      esac
     202                AC_MSG_RESULT(done)
    188203           if test "x$MEXEXT" = "x" ; then
    189204                        AC_MSG_ERROR([Couldn't find mex... check your installation of matlab])
     
    191206
    192207                AC_SUBST([MATLABINCL])
    193                 AC_SUBST([MEX])
    194208                MATLABWRAPPEREXT=$MEXEXT
    195209                AC_SUBST([MATLABWRAPPEREXT])
Note: See TracChangeset for help on using the changeset viewer.