Changeset 1062


Ignore:
Timestamp:
Jul 28, 2008 5:30:12 AM (11 years ago)
Author:
stefan
Message:

get new COIN_HAS_MUMPS comitted (BuildTools? ticket 64)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/BSP/coin.m4

    r1024 r1062  
    30693069MAKEOKFILE=.MakeOk
    30703070
    3071 AC_ARG_WITH([mumps-dir],
    3072             AC_HELP_STRING([--with-mumps-dir],
    3073                            [specify directory where MUMPS is installed]),
    3074             [use_mumps="$withval"], [use_mumps=no])
    3075 
    3076 if test "$use_mumps" != "no"; then
    3077   if test -d $use_mumps; then :; else
    3078     AC_MSG_ERROR([User provided MUMPS directory $use_mumps does not exist.])
    3079   fi
    3080   mumps_dir=`cd $use_mumps; pwd`
    3081 
    3082   # library extension
    3083   AC_LANG_PUSH(C)
    3084   save_LIBS="$LIBS"
    3085   LIBS="$LIBS $FLIBS"
    3086   AC_CHECK_LIB([pthread],[pthread_create],[LIBS="-lpthread $save_LIBS"; ADDLIBS="-lpthread $ADDLIBS"],[LIBS="$save_LIBS"])
    3087   AC_LANG_POP(C)
    3088 
    3089   case "$CC" in
    3090     cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
    3091          libe=lib ;;
    3092       *) libe=a ;;
    3093   esac
    3094 
    3095   # Check if hearders are there
    3096   AC_COIN_CHECK_FILE([$mumps_dir/include/dmumps_c.h],
    3097                      [],
    3098                      [AC_MSG_ERROR([I cannot find headers for MUMPS])])
    3099   LIBS="$mumps_dir/lib/libdmumps.$libe $mumps_dir/lib/libpord.$libe $mumps_dir/libseq/libmpiseq.$libe $LIBS"
    3100   ADDLIBS="$mumps_dir/lib/libdmumps.$libe $mumps_dir/lib/libpord.$libe $mumps_dir/libseq/libmpiseq.$libe $ADDLIBS"
    3101   # Check if MUMPS actually works
    3102   AC_LANG_PUSH(C)
    3103   save_LIBS="$LIBS"
    3104   LIBS="$LIBS $FLIBS"
    3105   AC_TRY_LINK([void dmumps_c();],[dmumps_c()],[],
    3106               [AC_MSG_ERROR([User provided MUMPS library doesn't work])])
    3107   LIBS="$save_LIBS"
    3108   AC_LANG_POP(C)
    3109   coin_mumpssrcdir="$mumps_dir"
    3110 
    3111 else
     3071#check if user provides a MUMPS library (that works)
     3072AC_LANG_PUSH(C)
     3073AC_COIN_HAS_USER_LIBRARY(mumps, MUMPS, dmumps_c.h, dmumps_c)
     3074AC_LANG_POP(C)
     3075
     3076if test "$coin_has_mumps" = "true"; then  # user provided mumps library
     3077  use_mumps=yes
     3078  coin_has_mumps=yes
     3079
     3080  MUMPS_INCFLAGS="-I\`\$(CYGPATH_W) $MUMPSINCDIR\`"
     3081  ADDLIBS="$MUMPSLIB $ADDLIBS"
     3082
     3083else # no user provided library, so we try to build our own
    31123084  use_mumps=BUILD
    31133085
     
    31223094      AC_CHECK_LIB([pthread],[pthread_create],[LIBS="-lpthread $save_LIBS"; ADDLIBS="-lpthread $ADDLIBS"],[LIBS="save_LIBS"])
    31233095      AC_LANG_POP(C)
     3096 
     3097      MUMPS_INCFLAGS="-I\`\$(CYGPATH_W) $coin_mumpssrcdir/libseq\` -I\`\$(CYGPATH_W) $coin_mumpssrcdir/include\`"
    31243098    else
    31253099      use_mumps=
    31263100    fi
    31273101  fi
     3102
     3103  # if a user provided library is used, then COIN_HAS_USER_LIBRARY takes care of the COIN_HAS_MUMPS conditional and preprocessor symbol
     3104  AM_CONDITIONAL([COIN_HAS_MUMPS],[test x"$use_mumps" != x])
     3105  if test x"$use_mumps" != x; then
     3106    AC_DEFINE([COIN_HAS_MUMPS],[1],[If defined, the MUMPS Library is available.])
     3107    coin_has_mumps=yes
     3108  else
     3109    coin_has_mumps=no
     3110  fi
     3111  AC_MSG_CHECKING([whether MUMPS is available])
     3112  AC_MSG_RESULT([$coin_has_mumps])
    31283113fi
    31293114
    31303115if test x"$use_mumps" != x; then
    3131 
    3132   # and we need the Fortran runtime libraries if we want to link with C/C++
     3116  # we need the Fortran runtime libraries if we want to link with C/C++
    31333117  coin_need_flibs=yes
    31343118
    3135   MUMPS_INCFLAGS="-I\`\$(CYGPATH_W) $coin_mumpssrcdir/libseq\` -I\`\$(CYGPATH_W) $coin_mumpssrcdir/include\`"
    31363119  AC_SUBST(MUMPS_INCFLAGS)
    31373120fi
    31383121
    3139 AM_CONDITIONAL([COIN_HAS_MUMPS],[test x"$use_mumps" != x])
    31403122AM_CONDITIONAL([COIN_BUILD_MUMPS],[test "$use_mumps" = BUILD])
    31413123
    3142 AC_MSG_CHECKING([whether MUMPS is available])
    3143 
    3144 if test x"$use_mumps" = x || test "$use_mumps" = no; then
    3145   coin_has_mumps=no
    3146 else
    3147   coin_has_mumps=yes
    3148   AC_DEFINE([COIN_HAS_MUMPS],[1],
    3149             [If defined, the MUMPS Library is available.])
    3150 fi
    3151 AC_MSG_RESULT([$coin_has_mumps])
    31523124]) # AC_COIN_HAS_MUMPS
    31533125
Note: See TracChangeset for help on using the changeset viewer.