Changeset 1801 for trunk/Cbc


Ignore:
Timestamp:
Nov 20, 2012 11:36:49 AM (7 years ago)
Author:
stefan
Message:

add --with-pthreadsw32-lib/incdir options to make it easier to build against the windows port of pthread with cl/icl

Location:
trunk/Cbc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/configure

    r1800 r1801  
    11721172                          specify default solver for cbc-generic in lower case
    11731173                          letters (if not given, clp is assumed)
     1174  --with-pthreadsw32-lib  specify the name of the pthreads win32 library (for
     1175                          cl/icl builds only)
     1176  --with-pthreadsw32-incdir
     1177                          specify the path of the pthreads win32 header file
     1178                          (for cl/icl builds only)
    11741179  --with-osicbc-default-solver
    11751180                          specify underlying solver for OsiCbc (default clp)
     
    59925997*-*-irix6*)
    59935998  # Find out which ABI we are using.
    5994   echo '#line 5994 "configure"' > conftest.$ac_ext
     5999  echo '#line 5999 "configure"' > conftest.$ac_ext
    59956000  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    59966001  (eval $ac_compile) 2>&5
     
    71267131
    71277132# Provide some information about the compiler.
    7128 echo "$as_me:7128:" \
     7133echo "$as_me:7133:" \
    71297134     "checking for Fortran 77 compiler version" >&5
    71307135ac_compiler=`set X $ac_compile; echo $2`
     
    81938198   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    81948199   -e 's:$: $lt_compiler_flag:'`
    8195    (eval echo "\"\$as_me:8195: $lt_compile\"" >&5)
     8200   (eval echo "\"\$as_me:8200: $lt_compile\"" >&5)
    81968201   (eval "$lt_compile" 2>conftest.err)
    81978202   ac_status=$?
    81988203   cat conftest.err >&5
    8199    echo "$as_me:8199: \$? = $ac_status" >&5
     8204   echo "$as_me:8204: \$? = $ac_status" >&5
    82008205   if (exit $ac_status) && test -s "$ac_outfile"; then
    82018206     # The compiler can only warn and ignore the option if not recognized
     
    84618466   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    84628467   -e 's:$: $lt_compiler_flag:'`
    8463    (eval echo "\"\$as_me:8463: $lt_compile\"" >&5)
     8468   (eval echo "\"\$as_me:8468: $lt_compile\"" >&5)
    84648469   (eval "$lt_compile" 2>conftest.err)
    84658470   ac_status=$?
    84668471   cat conftest.err >&5
    8467    echo "$as_me:8467: \$? = $ac_status" >&5
     8472   echo "$as_me:8472: \$? = $ac_status" >&5
    84688473   if (exit $ac_status) && test -s "$ac_outfile"; then
    84698474     # The compiler can only warn and ignore the option if not recognized
     
    85658570   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    85668571   -e 's:$: $lt_compiler_flag:'`
    8567    (eval echo "\"\$as_me:8567: $lt_compile\"" >&5)
     8572   (eval echo "\"\$as_me:8572: $lt_compile\"" >&5)
    85688573   (eval "$lt_compile" 2>out/conftest.err)
    85698574   ac_status=$?
    85708575   cat out/conftest.err >&5
    8571    echo "$as_me:8571: \$? = $ac_status" >&5
     8576   echo "$as_me:8576: \$? = $ac_status" >&5
    85728577   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    85738578   then
     
    1091010915  lt_status=$lt_dlunknown
    1091110916  cat > conftest.$ac_ext <<EOF
    10912 #line 10912 "configure"
     10917#line 10917 "configure"
    1091310918#include "confdefs.h"
    1091410919
     
    1101011015  lt_status=$lt_dlunknown
    1101111016  cat > conftest.$ac_ext <<EOF
    11012 #line 11012 "configure"
     11017#line 11017 "configure"
    1101311018#include "confdefs.h"
    1101411019
     
    1335413359   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1335513360   -e 's:$: $lt_compiler_flag:'`
    13356    (eval echo "\"\$as_me:13356: $lt_compile\"" >&5)
     13361   (eval echo "\"\$as_me:13361: $lt_compile\"" >&5)
    1335713362   (eval "$lt_compile" 2>conftest.err)
    1335813363   ac_status=$?
    1335913364   cat conftest.err >&5
    13360    echo "$as_me:13360: \$? = $ac_status" >&5
     13365   echo "$as_me:13365: \$? = $ac_status" >&5
    1336113366   if (exit $ac_status) && test -s "$ac_outfile"; then
    1336213367     # The compiler can only warn and ignore the option if not recognized
     
    1345813463   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1345913464   -e 's:$: $lt_compiler_flag:'`
    13460    (eval echo "\"\$as_me:13460: $lt_compile\"" >&5)
     13465   (eval echo "\"\$as_me:13465: $lt_compile\"" >&5)
    1346113466   (eval "$lt_compile" 2>out/conftest.err)
    1346213467   ac_status=$?
    1346313468   cat out/conftest.err >&5
    13464    echo "$as_me:13464: \$? = $ac_status" >&5
     13469   echo "$as_me:13469: \$? = $ac_status" >&5
    1346513470   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    1346613471   then
     
    1502815033   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1502915034   -e 's:$: $lt_compiler_flag:'`
    15030    (eval echo "\"\$as_me:15030: $lt_compile\"" >&5)
     15035   (eval echo "\"\$as_me:15035: $lt_compile\"" >&5)
    1503115036   (eval "$lt_compile" 2>conftest.err)
    1503215037   ac_status=$?
    1503315038   cat conftest.err >&5
    15034    echo "$as_me:15034: \$? = $ac_status" >&5
     15039   echo "$as_me:15039: \$? = $ac_status" >&5
    1503515040   if (exit $ac_status) && test -s "$ac_outfile"; then
    1503615041     # The compiler can only warn and ignore the option if not recognized
     
    1513215137   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1513315138   -e 's:$: $lt_compiler_flag:'`
    15134    (eval echo "\"\$as_me:15134: $lt_compile\"" >&5)
     15139   (eval echo "\"\$as_me:15139: $lt_compile\"" >&5)
    1513515140   (eval "$lt_compile" 2>out/conftest.err)
    1513615141   ac_status=$?
    1513715142   cat out/conftest.err >&5
    15138    echo "$as_me:15138: \$? = $ac_status" >&5
     15143   echo "$as_me:15143: \$? = $ac_status" >&5
    1513915144   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    1514015145   then
     
    1733917344   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1734017345   -e 's:$: $lt_compiler_flag:'`
    17341    (eval echo "\"\$as_me:17341: $lt_compile\"" >&5)
     17346   (eval echo "\"\$as_me:17346: $lt_compile\"" >&5)
    1734217347   (eval "$lt_compile" 2>conftest.err)
    1734317348   ac_status=$?
    1734417349   cat conftest.err >&5
    17345    echo "$as_me:17345: \$? = $ac_status" >&5
     17350   echo "$as_me:17350: \$? = $ac_status" >&5
    1734617351   if (exit $ac_status) && test -s "$ac_outfile"; then
    1734717352     # The compiler can only warn and ignore the option if not recognized
     
    1760717612   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1760817613   -e 's:$: $lt_compiler_flag:'`
    17609    (eval echo "\"\$as_me:17609: $lt_compile\"" >&5)
     17614   (eval echo "\"\$as_me:17614: $lt_compile\"" >&5)
    1761017615   (eval "$lt_compile" 2>conftest.err)
    1761117616   ac_status=$?
    1761217617   cat conftest.err >&5
    17613    echo "$as_me:17613: \$? = $ac_status" >&5
     17618   echo "$as_me:17618: \$? = $ac_status" >&5
    1761417619   if (exit $ac_status) && test -s "$ac_outfile"; then
    1761517620     # The compiler can only warn and ignore the option if not recognized
     
    1771117716   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1771217717   -e 's:$: $lt_compiler_flag:'`
    17713    (eval echo "\"\$as_me:17713: $lt_compile\"" >&5)
     17718   (eval echo "\"\$as_me:17718: $lt_compile\"" >&5)
    1771417719   (eval "$lt_compile" 2>out/conftest.err)
    1771517720   ac_status=$?
    1771617721   cat out/conftest.err >&5
    17717    echo "$as_me:17717: \$? = $ac_status" >&5
     17722   echo "$as_me:17722: \$? = $ac_status" >&5
    1771817723   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    1771917724   then
     
    2982229827_ACEOF
    2982329828
    29824   echo "$as_me:$LINENO: checking for clock_gettime in -lrt" >&5
     29829  if test $coin_cxx_is_cl = true ;
     29830  then
     29831    # TODO we should check whether the library works and pthread.h is indeed there
     29832
     29833# Check whether --with-pthreadsw32-lib or --without-pthreadsw32-lib was given.
     29834if test "${with_pthreadsw32_lib+set}" = set; then
     29835  withval="$with_pthreadsw32_lib"
     29836  CBCLIB_LIBS="$withval $CBCLIB_LIBS"
     29837                 CBCLIB_PCLIBS="$withval $CBCLIB_PCLIBS"
     29838else
     29839  { echo "$as_me:$LINENO: WARNING: --enable-cbc-parallel selected, but --with-pthreadsw32-lib not given" >&5
     29840echo "$as_me: WARNING: --enable-cbc-parallel selected, but --with-pthreadsw32-lib not given" >&2;}
     29841                 CBCLIB_LIBS="pthreadVCE2.lib $CBCLIB_LIBS"
     29842fi;
     29843
     29844
     29845# Check whether --with-pthreadsw32-incdir or --without-pthreadsw32-incdir was given.
     29846if test "${with_pthreadsw32_incdir+set}" = set; then
     29847  withval="$with_pthreadsw32_incdir"
     29848  CXXFLAGS="$CXXFLAGS -I$withval"
     29849else
     29850  { echo "$as_me:$LINENO: WARNING: --enable-cbc-parallel selected, but --with-pthreadsw32-incdir not given" >&5
     29851echo "$as_me: WARNING: --enable-cbc-parallel selected, but --with-pthreadsw32-incdir not given" >&2;}
     29852fi;
     29853  else
     29854    echo "$as_me:$LINENO: checking for clock_gettime in -lrt" >&5
    2982529855echo $ECHO_N "checking for clock_gettime in -lrt... $ECHO_C" >&6
    2982629856if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then
     
    2988829918if test $ac_cv_lib_rt_clock_gettime = yes; then
    2988929919  CBCLIB_LIBS="-lrt $CBCLIB_LIBS"
    29890                 CBCLIB_PCLIBS="-lrt $CBCLIB_PCLIBS"
     29920                  CBCLIB_PCLIBS="-lrt $CBCLIB_PCLIBS"
    2989129921
    2989229922cat >>confdefs.h <<\_ACEOF
     
    2990029930fi
    2990129931
    29902   echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
     29932    echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
    2990329933echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6
    2990429934if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
     
    2996629996if test $ac_cv_lib_pthread_pthread_create = yes; then
    2996729997  CBCLIB_LIBS="-lpthread $CBCLIB_LIBS"
    29968                 CBCLIB_PCLIBS="-lpthread $CBCLIB_PCLIBS"
     29998                  CBCLIB_PCLIBS="-lpthread $CBCLIB_PCLIBS"
    2996929999
    2997030000else
     
    2997430004fi
    2997530005
     30006  fi
     30007  { echo "$as_me:$LINENO: Cbc multithreading enabled" >&5
     30008echo "$as_me: Cbc multithreading enabled" >&6;};
    2997630009fi
    2997730010
  • trunk/Cbc/configure.ac

    r1751 r1801  
    169169  # Define the preprocessor macro
    170170  AC_DEFINE([CBC_THREAD],[1],[Define to 1 if the SMP version of Cbc should be compiled])
    171   AC_CHECK_LIB([rt],[clock_gettime],
    172                [CBCLIB_LIBS="-lrt $CBCLIB_LIBS"
    173                 CBCLIB_PCLIBS="-lrt $CBCLIB_PCLIBS"
    174                 AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define if clock_gettime and rt library is available])
    175                ],
    176                [AC_MSG_WARN([--enable-cbc-parallel selected, but -lrt unavailable; using gettimeofday instead of clock_gettime])])
    177   AC_CHECK_LIB([pthread],[pthread_create],
    178                [CBCLIB_LIBS="-lpthread $CBCLIB_LIBS"
    179                 CBCLIB_PCLIBS="-lpthread $CBCLIB_PCLIBS"
    180                ],
    181                [AC_MSG_ERROR([--enable-cbc-parallel selected, but -lpthreads unavailable])])
     171  if test $coin_cxx_is_cl = true ;
     172  then
     173    # TODO we should check whether the library works and pthread.h is indeed there
     174    AC_ARG_WITH(pthreadsw32-lib,
     175                AC_HELP_STRING([--with-pthreadsw32-lib],
     176                               [specify the name of the pthreads win32 library (for cl/icl builds only)]),
     177                [CBCLIB_LIBS="$withval $CBCLIB_LIBS"
     178                 CBCLIB_PCLIBS="$withval $CBCLIB_PCLIBS"],
     179                [AC_MSG_WARN([--enable-cbc-parallel selected, but --with-pthreadsw32-lib not given])
     180                 CBCLIB_LIBS="pthreadVCE2.lib $CBCLIB_LIBS"])
     181   
     182    AC_ARG_WITH(pthreadsw32-incdir,
     183                AC_HELP_STRING([--with-pthreadsw32-incdir],
     184                               [specify the path of the pthreads win32 header file (for cl/icl builds only)]),
     185                [CXXFLAGS="$CXXFLAGS -I$withval"],
     186                [AC_MSG_WARN([--enable-cbc-parallel selected, but --with-pthreadsw32-incdir not given])])
     187  else
     188    AC_CHECK_LIB([rt],[clock_gettime],
     189                 [CBCLIB_LIBS="-lrt $CBCLIB_LIBS"
     190                  CBCLIB_PCLIBS="-lrt $CBCLIB_PCLIBS"
     191                  AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define if clock_gettime and rt library is available])
     192                 ],
     193                 [AC_MSG_WARN([--enable-cbc-parallel selected, but -lrt unavailable; using gettimeofday instead of clock_gettime])])
     194    AC_CHECK_LIB([pthread],[pthread_create],
     195                 [CBCLIB_LIBS="-lpthread $CBCLIB_LIBS"
     196                  CBCLIB_PCLIBS="-lpthread $CBCLIB_PCLIBS"
     197                 ],
     198                 [AC_MSG_ERROR([--enable-cbc-parallel selected, but -lpthreads unavailable])])
     199  fi
     200  AC_MSG_NOTICE([Cbc multithreading enabled]);
    182201fi
    183202
Note: See TracChangeset for help on using the changeset viewer.