COIN-OR::LEMON - Graph Library

Changeset 1380:cb2891afe526 in lemon-0.x for config


Ignore:
Timestamp:
04/22/05 18:20:12 (20 years ago)
Author:
Akos Ladanyi
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1833
Message:

added check for CLPEX

File:
1 edited

Legend:

Unmodified
Added
Removed
  • config/lp.m4

    r1373 r1380  
    7070  AM_CONDITIONAL([HAVE_GLPK], [test x"$lx_glpk_found" = x"yes"])
    7171])
     72
     73
     74AC_DEFUN([LX_CHECK_CPLEX],
     75[
     76  AC_ARG_WITH([cplex],
     77AS_HELP_STRING([--with-cplex@<:@=PREFIX@:>@], [search for CPLEX under PREFIX or under the default search paths if PREFIX is not given @<:@default@:>@])
     78AS_HELP_STRING([--without-cplex], [disable checking for CPLEX]),
     79              [], [with_cplex=yes])
     80
     81  AC_ARG_WITH([cplex-includedir],
     82AS_HELP_STRING([--with-cplex-includedir=DIR], [search for CPLEX headers in DIR]),
     83              [], [with_cplex_includedir=no])
     84
     85  AC_ARG_WITH([cplex-libdir],
     86AS_HELP_STRING([--with-cplex-libdir=DIR], [search for CPLEX libraries in DIR]),
     87              [], [with_cplex_libdir=no])
     88
     89  if test x"$with_cplex" != x"no"; then
     90    AC_MSG_CHECKING([for CPLEX])
     91
     92    if test x"$with_cplex_includedir" != x"no"; then
     93      CPLEX_CFLAGS="-I$with_cplex_includedir"
     94    elif test x"$with_cplex" != x"yes"; then
     95      CPLEX_CFLAGS="-I$with_cplex/include"
     96    fi
     97
     98    if test x"$with_cplex_libdir" != x"no"; then
     99      CPLEX_LDFLAGS="-L$with_cplex_libdir"
     100    elif test x"$with_cplex" != x"yes"; then
     101      CPLEX_LDFLAGS="-L$with_cplex/lib"
     102    fi
     103    CPLEX_LIBS="-lcplex -lm -lpthread"
     104
     105    lx_save_cxxflags="$CXXFLAGS";
     106    lx_save_ldflags="$LDFLAGS";
     107    lx_save_libs="$LIBS";
     108    CXXFLAGS="$CPLEX_CFLAGS"
     109    LDFLAGS="$CPLEX_LDFLAGS"
     110    LIBS="$CPLEX_LIBS"
     111
     112    lx_cplex_test_prog='
     113      extern "C" {
     114      #include <ilcplex/cplex.h>
     115      }
     116
     117      int main(int argc, char* argv[])
     118      {
     119        CPXENVptr env = NULL;
     120        return 0;
     121      }'
     122
     123    AC_LANG_PUSH(C++)
     124    AC_LINK_IFELSE([$lx_cplex_test_prog], [lx_cplex_found=yes], [lx_cplex_found=no])
     125    AC_LANG_POP(C++)
     126
     127    CXXFLAGS="$lx_save_cxxflags"
     128    LDFLAGS="$lx_save_ldflags"
     129    LIBS="$lx_save_libs"
     130
     131    if test x"$lx_cplex_found" = x"yes"; then
     132      AC_DEFINE([HAVE_CPLEX], [1], [Define to 1 if you have CPLEX.])
     133      AC_MSG_RESULT([yes])
     134    else
     135      AC_MSG_RESULT([no])
     136    fi
     137  fi
     138  CPLEX_LIBS="$CPLEX_LDFLAGS $CPLEX_LIBS"
     139  AC_SUBST(CPLEX_CFLAGS)
     140  AC_SUBST(CPLEX_LIBS)
     141  AM_CONDITIONAL([HAVE_CPLEX], [test x"$lx_cplex_found" = x"yes"])
     142])
Note: See TracChangeset for help on using the changeset viewer.