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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.