Changeset 296 for trunk/configure.ac


Ignore:
Timestamp:
Mar 21, 2012 11:16:59 AM (8 years ago)
Author:
kulshres
Message:

Follow the latest changes in ColPack? version 1.0.6

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r288 r296  
    99##############################################################################
    1010define([ADOLC_VER], [2])
    11 define([ADOLC_SUB], [2])
    12 define([ADOLC_LVL], [1])
    13 
    14 AC_PREREQ(2.57)
     11define([ADOLC_SUB], [3])
     12define([ADOLC_LVL], [0])
     13
     14AC_PREREQ(2.67)
    1515AC_INIT(adolc,
    1616        ADOLC_VER.ADOLC_SUB.ADOLC_LVL-trunk,
     
    2121AC_CONFIG_HEADERS([ADOL-C/src/config.h])
    2222AC_PREFIX_DEFAULT(${HOME}/adolc_base)
    23 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
     23AM_INIT_AUTOMAKE([1.11 dist-bzip2 foreign])
     24AM_SILENT_RULES([yes])
    2425
    2526if test "x$CFLAGS" == x ; then
     
    4344AC_LIBTOOL_WIN32_DLL
    4445AC_PROG_LIBTOOL
    45 DOLT
    4646
    4747AC_CHECK_SIZEOF([void *])
     
    169169        [
    170170AS_HELP_STRING([--with-colpack=DIR],[path to the colpack library and headers [default=${srcdir}/ThirdParty/ColPack]])],
    171                 [colpack=$withval],
    172                 [colpack=${abs_srcdir}/ThirdParty/ColPack])
    173 
    174 if test "x${_lib}" != xlib ; then
    175    dirlist="${_lib} lib build/${_lib} build/lib"
    176 else
    177    dirlist="${_lib} build/${_lib}"
    178 fi
     171                [
     172colpack=$withval
     173COLPACK_CFLAGS="$ac_adolc_openmpflag -I$colpack/include"
     174COLPACK_LIBDIR="$colpack/${_lib}"
     175COLPACK_LIBS="$ac_adolc_openmpflag -L$COLPACK_LIBDIR -lColPack"
     176],
     177[
     178COLPACK_CFLAGS="$ac_adolc_openmpflag"
     179COLPACK_LIBDIR=""
     180COLPACK_LIBS="-lColPack"
     181])
    179182
    180183AC_LANG_PUSH([C++])
    181 for dir in $dirlist ; do
    182     unset ac_cv_header_ColPackHeaders_h
    183     COLPACK_CFLAGS="$ac_adolc_openmpflag -I$colpack/$dir/../include"
    184     COLPACK_LIBDIR="$colpack/$dir"
    185     COLPACK_LIBS="$ac_adolc_openmpflag -L$COLPACK_LIBDIR -lColPack -Wl,-rpath,$COLPACK_LIBDIR"
    186     save_CPPFLAGS="$CPPFLAGS"
    187     save_LIBS="$LIBS"
    188     CPPFLAGS="$CPPFLAGS $COLPACK_CFLAGS"
    189     LIBS="$COLPACK_LIBS $LIBS"
    190     AC_MSG_CHECKING(for ColPack in $COLPACK_LIBDIR)
    191     AC_CHECK_HEADER([ColPackHeaders.h],[have_colpackheaders=yes],[have_colpackheaders=no])
    192     if test x$have_colpackheaders = xyes ; then
    193         AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ColPackHeaders.h>],
    194                           [ColPack::GraphColoring g])],
     184save_CPPFLAGS="$CPPFLAGS"
     185save_LIBS="$LIBS"
     186CPPFLAGS="$CPPFLAGS $COLPACK_CFLAGS"
     187LIBS="$COLPACK_LIBS $LIBS"
     188AC_MSG_CHECKING(for ColPack in $COLPACK_LIBDIR)
     189AC_CHECK_HEADER([ColPack/ColPackHeaders.h],[have_colpackheaders=yes],[have_colpackheaders=no])
     190if test x$have_colpackheaders = xyes ; then
     191   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ColPack/ColPackHeaders.h>],
     192                        [ColPack::GraphColoring g])],
    195193                       [have_colpack=yes
    196194                        AC_MSG_RESULT(linking with -lColPack succeeded)],
    197195                       [have_colpack=no,
    198196                        AC_MSG_RESULT(linking with -lColPack failed)])
    199     else
    200         have_colpack=no
    201     fi
    202     CPPFLAGS="$save_CPPFLAGS"
    203     LIBS="$save_LIBS"
    204     if test x$have_colpack = xyes ; then
    205         break
    206     fi
    207 done
     197else
     198    have_colpack=no
     199fi
     200CPPFLAGS="$save_CPPFLAGS"
     201LIBS="$save_LIBS"
    208202AC_LANG_POP([C++])
     203
    209204AM_CONDITIONAL(HAVE_LIBCOLPACK,[test x$have_colpack = xyes])
    210205if test x$have_colpack = xyes; then
    211    # test if the directories exists and what is the real path
    212    # if not then we found ColPack in some standard location
    213    # and these variables are useless
    214    COLPACK_LIBDIR=`readlink -f $COLPACK_LIBDIR`
    215    if test -n $COLPACK_LIBDIR ; then
    216       colpack_incdir=`readlink -f $COLPACK_LIBDIR/../include`
    217       if test -n $colpack_incdir ; then
    218          COLPACK_CFLAGS="$ac_adolc_openmpflag -I$colpack_incdir"
    219       else
    220          COLPACK_CFLAGS=""
    221       fi
    222       COLPACK_LIBS="$ac_adolc_openmpflag -L$COLPACK_LIBDIR -lColPack -Wl,-rpath,$COLPACK_LIBDIR"
    223    else
    224       COLPACK_CFLAGS=""
    225       COLPACK_LIBS=""
    226    fi
    227    # if the real path to ColPack is inside the ${srcdir}
    228    # then we should statically link all ColPack objects inside libadolc
    229    # it is likely that the srcdir is not needed anymore after make install
    230    # and thus deleted thus no more ColPack to dynamically link to
    231    # an external ColPack path is less likely to be removed
    232    if echo $COLPACK_LIBDIR | grep -q ^${abs_srcdir} ; then
    233        echo will link ColPack static as it was found in the source directory
    234        test -d $COLPACK_LIBDIR/.tmp && rm -rf $COLPACK_LIBDIR/.tmp
    235        mkdir -p $COLPACK_LIBDIR/.tmp/
    236        mkdir -p $COLPACK_LIBDIR/.tmp/.libs
    237        ( cd $COLPACK_LIBDIR/.tmp/ ; $AR x ../libColPack.a ; cp *.o .libs/
    238          for i in *.o ; do j=`echo $i | sed 's/\.o/\.lo/' `
    239                  cat >$j <<EOF
    240 # $j - a libtool object file
    241 # Generated by doltcompile, not libtool
    242 pic_object='.libs/$i'
    243 non_pic_object='$i'
    244 EOF
    245         done
    246         )
    247        COLPACK_LIBS="$ac_adolc_openmpflag `find "$COLPACK_LIBDIR/.tmp" -name \*.lo -printf "%p "` "
    248    fi
    249206   sparse=yes
    250207   echo "will build sparse drivers as linking with -lColPack succeeded"
     
    391348 
    392349
    393 SHAVE_INIT([autoconf],[enable])
    394 
    395350# output
    396351AC_CONFIG_FILES(Makefile
    397                 autoconf/shave-libtool
    398                 autoconf/shave
    399352                ADOL-C/Makefile
    400353                ADOL-C/src/Makefile
Note: See TracChangeset for help on using the changeset viewer.