Changeset 2641


Ignore:
Timestamp:
Nov 20, 2012 2:03:33 PM (7 years ago)
Author:
stefan
Message:

proper check for gmpxx

Location:
ThirdParty/SoPlex/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ThirdParty/SoPlex/trunk/config_soplex.h.in

    r2582 r2641  
    1515/* Define to 1 if you have the <dlfcn.h> header file. */
    1616#undef HAVE_DLFCN_H
    17 
    18 /* Define to 1 if you have the <gmpxx.h> header file. */
    19 #undef HAVE_GMPXX_H
    2017
    2118/* Define to 1 if you have the <gmp.h> header file. */
  • ThirdParty/SoPlex/trunk/configure

    r2628 r2641  
    2128221282  if test $coin_has_gmp = yes ; then
    2128321283
    21284                     SOPLEX_LIBS="-lgmp $SOPLEX_LIBS"
    21285                     SOPLEX_PCLIBS="-lgmp $SOPLEX_PCLIBS"
    21286                     SOPLEX_LIBS_INSTALLED="-lgmp $SOPLEX_LIBS_INSTALLED"
    21287 
    2128821284
    2128921285cat >>confdefs.h <<\_ACEOF
     
    2129521291
    2129621292if test $coin_has_gmp = yes; then
     21293  echo "$as_me:$LINENO: checking for GMP C++ extensions (gmpxx)" >&5
     21294echo $ECHO_N "checking for GMP C++ extensions (gmpxx)... $ECHO_C" >&6
    2129721295  ac_ext=cc
    2129821296ac_cpp='$CXXCPP $CPPFLAGS'
     
    2130121299ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
    2130221300
    21303   # TODO check for gmpxx library here somehow...
    21304 
    21305 #if test x"" = x; then
    21306 #  hdr="#include <gmpxx.h>"
    21307 #else
    21308 #  hdr=""
    21309 #fi
    21310 #AC_CHECK_HEADERS([gmpxx.h],[],[coin_has_gmp=no],[$hdr])
    21311 
    21312 for ac_header in gmpxx.h
    21313 do
    21314 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
    21315 if eval "test \"\${$as_ac_Header+set}\" = set"; then
    21316   echo "$as_me:$LINENO: checking for $ac_header" >&5
    21317 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
    21318 if eval "test \"\${$as_ac_Header+set}\" = set"; then
    21319   echo $ECHO_N "(cached) $ECHO_C" >&6
    21320 fi
    21321 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
    21322 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
    21323 else
    21324   # Is the header compilable?
    21325 echo "$as_me:$LINENO: checking $ac_header usability" >&5
    21326 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
    21327 cat >conftest.$ac_ext <<_ACEOF
     21301  SAVED_LDFLAGS="$LDFLAGS"
     21302  LDFLAGS="-lgmpxx -lgmp $LDFLAGS"
     21303  cat >conftest.$ac_ext <<_ACEOF
    2132821304/* confdefs.h.  */
    2132921305_ACEOF
     
    2133121307cat >>conftest.$ac_ext <<_ACEOF
    2133221308/* end confdefs.h.  */
    21333 $ac_includes_default
    21334 #include <$ac_header>
     21309#include <gmpxx.h>
     21310int
     21311main ()
     21312{
     21313mpq_class pq
     21314  ;
     21315  return 0;
     21316}
    2133521317_ACEOF
    21336 rm -f conftest.$ac_objext
    21337 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    21338   (eval $ac_compile) 2>conftest.er1
     21318rm -f conftest.$ac_objext conftest$ac_exeext
     21319if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     21320  (eval $ac_link) 2>conftest.er1
    2133921321  ac_status=$?
    2134021322  grep -v '^ *+' conftest.er1 >conftest.err
     
    2135021332  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    2135121333  (exit $ac_status); }; } &&
    21352          { ac_try='test -s conftest.$ac_objext'
     21334         { ac_try='test -s conftest$ac_exeext'
    2135321335  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    2135421336  (eval $ac_try) 2>&5
     
    2135621338  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    2135721339  (exit $ac_status); }; }; then
    21358   ac_header_compiler=yes
     21340  echo "$as_me:$LINENO: result: yes" >&5
     21341echo "${ECHO_T}yes" >&6
     21342     CXXFLAGS="$CXXFLAGS -DSOPLEX_WITH_GMP"
     21343     SOPLEX_LIBS="-lgmpxx -lgmp $SOPLEX_LIBS"
     21344     SOPLEX_PCLIBS="-lgmpxx -lgmp $SOPLEX_PCLIBS"
     21345     SOPLEX_LIBS_INSTALLED="-lgmpxx -lgmp $SOPLEX_LIBS_INSTALLED"
     21346
    2135921347else
    2136021348  echo "$as_me: failed program was:" >&5
    2136121349sed 's/^/| /' conftest.$ac_ext >&5
    2136221350
    21363 ac_header_compiler=no
    21364 fi
    21365 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    21366 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
    21367 echo "${ECHO_T}$ac_header_compiler" >&6
    21368 
    21369 # Is the header present?
    21370 echo "$as_me:$LINENO: checking $ac_header presence" >&5
    21371 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
    21372 cat >conftest.$ac_ext <<_ACEOF
    21373 /* confdefs.h.  */
    21374 _ACEOF
    21375 cat confdefs.h >>conftest.$ac_ext
    21376 cat >>conftest.$ac_ext <<_ACEOF
    21377 /* end confdefs.h.  */
    21378 #include <$ac_header>
    21379 _ACEOF
    21380 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
    21381   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
    21382   ac_status=$?
    21383   grep -v '^ *+' conftest.er1 >conftest.err
    21384   rm -f conftest.er1
    21385   cat conftest.err >&5
    21386   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    21387   (exit $ac_status); } >/dev/null; then
    21388   if test -s conftest.err; then
    21389     ac_cpp_err=$ac_cxx_preproc_warn_flag
    21390     ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
    21391   else
    21392     ac_cpp_err=
    21393   fi
    21394 else
    21395   ac_cpp_err=yes
    21396 fi
    21397 if test -z "$ac_cpp_err"; then
    21398   ac_header_preproc=yes
    21399 else
    21400   echo "$as_me: failed program was:" >&5
    21401 sed 's/^/| /' conftest.$ac_ext >&5
    21402 
    21403   ac_header_preproc=no
    21404 fi
    21405 rm -f conftest.err conftest.$ac_ext
    21406 echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
    21407 echo "${ECHO_T}$ac_header_preproc" >&6
    21408 
    21409 # So?  What about this header?
    21410 case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
    21411   yes:no: )
    21412     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
    21413 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    21414     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
    21415 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    21416     ac_header_preproc=yes
    21417     ;;
    21418   no:yes:* )
    21419     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
    21420 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    21421     { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
    21422 echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    21423     { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
    21424 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    21425     { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
    21426 echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    21427     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
    21428 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    21429     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
    21430 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    21431     (
    21432       cat <<\_ASBOX
    21433 ## --------------------------------------------------------------- ##
    21434 ## Report this to http://projects.coin-or.org/BuildTools/newticket ##
    21435 ## --------------------------------------------------------------- ##
    21436 _ASBOX
    21437     ) |
    21438       sed "s/^/$as_me: WARNING:     /" >&2
    21439     ;;
    21440 esac
    21441 echo "$as_me:$LINENO: checking for $ac_header" >&5
    21442 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
    21443 if eval "test \"\${$as_ac_Header+set}\" = set"; then
    21444   echo $ECHO_N "(cached) $ECHO_C" >&6
    21445 else
    21446   eval "$as_ac_Header=\$ac_header_preproc"
    21447 fi
    21448 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
    21449 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
    21450 
    21451 fi
    21452 if test `eval echo '${'$as_ac_Header'}'` = yes; then
    21453   cat >>confdefs.h <<_ACEOF
    21454 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
    21455 _ACEOF
    21456 
    21457 else
    21458   coin_has_gmp=no
    21459 fi
    21460 
    21461 done
    21462 
    21463 
     21351echo "$as_me:$LINENO: result: no" >&5
     21352echo "${ECHO_T}no" >&6
     21353     coin_has_gmp=no
     21354fi
     21355rm -f conftest.err conftest.$ac_objext \
     21356      conftest$ac_exeext conftest.$ac_ext
     21357  LDFLAGS="$SAVED_LDFLAGS"
    2146421358  ac_ext=c
    2146521359ac_cpp='$CPP $CPPFLAGS'
     
    2147021364fi
    2147121365
    21472 if test $coin_has_gmp = yes; then
    21473   CXXFLAGS="$CXXFLAGS -DWITH_GMP"
    21474 
    21475   SOPLEX_LIBS="-lgmpxx $SOPLEX_LIBS"
    21476   SOPLEX_PCLIBS="-lgmpxx $SOPLEX_PCLIBS"
    21477   SOPLEX_LIBS_INSTALLED="-lgmpxx $SOPLEX_LIBS_INSTALLED"
    21478 fi
     21366#if test $coin_has_gmp = yes; then
     21367#  CXXFLAGS="$CXXFLAGS -DSOPLEX_WITH_GMP"
     21368#
     21369#  SOPLEX_LIBS="-lgmpxx $SOPLEX_LIBS"
     21370#  SOPLEX_PCLIBS="-lgmpxx $SOPLEX_PCLIBS"
     21371#  SOPLEX_LIBS_INSTALLED="-lgmpxx $SOPLEX_LIBS_INSTALLED"
     21372#fi
    2147921373
    2148021374###########################################################################
  • ThirdParty/SoPlex/trunk/configure.ac

    r2582 r2641  
    6262fi
    6363
    64 AC_COIN_CHECK_GMP(SOPLEX)
     64AC_COIN_CHECK_GMP
    6565if test $coin_has_gmp = yes; then
     66  AC_MSG_CHECKING([for gmpxx])
    6667  AC_LANG_PUSH(C++)
    67   # TODO check for gmpxx library here somehow...
    68   AC_COIN_CHECK_HEADER([gmpxx.h],[],[coin_has_gmp=no])
     68  SAVED_LDFLAGS="$LDFLAGS"
     69  LDFLAGS="-lgmpxx -lgmp $LDFLAGS"
     70  AC_LINK_IFELSE(
     71    [AC_LANG_PROGRAM([#include <gmpxx.h>],[mpq_class pq])],
     72    [AC_MSG_RESULT(yes)
     73     CXXFLAGS="$CXXFLAGS -DSOPLEX_WITH_GMP"
     74     SOPLEX_LIBS="-lgmpxx -lgmp $SOPLEX_LIBS"
     75     SOPLEX_PCLIBS="-lgmpxx -lgmp $SOPLEX_PCLIBS"
     76     SOPLEX_LIBS_INSTALLED="-lgmpxx -lgmp $SOPLEX_LIBS_INSTALLED"
     77    ],
     78    [AC_MSG_RESULT(no)
     79     coin_has_gmp=no])
     80  LDFLAGS="$SAVED_LDFLAGS"
    6981  AC_LANG_POP(C++)
    70 fi
    71 
    72 if test $coin_has_gmp = yes; then
    73   CXXFLAGS="$CXXFLAGS -DWITH_GMP"
    74  
    75   SOPLEX_LIBS="-lgmpxx $SOPLEX_LIBS"
    76   SOPLEX_PCLIBS="-lgmpxx $SOPLEX_PCLIBS"
    77   SOPLEX_LIBS_INSTALLED="-lgmpxx $SOPLEX_LIBS_INSTALLED"
    7882fi
    7983
Note: See TracChangeset for help on using the changeset viewer.