Changeset 161 for trunk/configure.ac


Ignore:
Timestamp:
Sep 23, 2010 12:14:35 PM (9 years ago)
Author:
kulshres
Message:

Squashed merge of branch 'master' of 'gitclone' into svn

  • 'master' of 'gitclone': (8 commits) Add missing files to dist Add a rpm spec file add some comments and add else cases to ifs typo fix more improvements in ColPack? checking adjust Makefile.am overall to not explicitly need COLPACK_LIBS refactor colpack searching fix in-tree Colpack location for seperated build

Details of the commits:
ommit f925eb1d39f53bf893280f872407e45b16901cd1
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Sep 23 17:58:41 2010 +0200

Add missing files to dist

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

commit 37d5799660bbb042f02518f22c4034a3541b5b26
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Sep 23 17:57:51 2010 +0200

Add a rpm spec file

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

commit 25a41aac1c58214d3d35b4321d90a5fbfb1d2a5d
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Sep 16 15:09:04 2010 +0200

add some comments and add else cases to ifs

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

commit 1fc5a86ce4340692d0e486b6df2a41af5d138e2b
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Sep 16 14:52:20 2010 +0200

typo fix

it's COLPACK_LIBDIR not COLPACK_DIR

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

commit f8eb90f4962914ccf665617e1a1a7f8d07c066d4
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Sep 16 14:42:15 2010 +0200

more improvements in ColPack? checking

check for the header file too and then test link a C++ program
use readlink to find the real paths for the includedir and libdir
remove the old .tmp from libdir, it may contain junk.
use $AR instead of ar, we may be cross compiling.

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

commit 4db5d1eeb1925f996f244184683c6c649b1262fe
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Sep 15 18:53:00 2010 +0200

adjust Makefile.am overall to not explicitly need COLPACK_LIBS

in case it is dynamically linked to libadolc.so this information
will be forwarded to the executable automatically too. in the
static linking case libadolc.{so,a} already contain everything

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

commit 2c2a4a433c6716db317b1883e9bd568a267cd7e4
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Sep 15 16:38:16 2010 +0200

refactor colpack searching

link with ColPack? statically if ColPack? resides inside
the source tree.

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

commit b950c231857d9fcfcd3f70e1253cc11b9e2d6f5c
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Sep 15 16:02:29 2010 +0200

fix in-tree Colpack location for seperated build

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r160 r161  
    2121AC_CONFIG_HEADERS([ADOL-C/src/config.h])
    2222AC_PREFIX_DEFAULT(${HOME}/adolc_base)
    23 AM_INIT_AUTOMAKE
     23AM_INIT_AUTOMAKE([dist-bzip2])
    2424
    2525if test "x$CFLAGS" == x ; then
     
    151151            [sparse="no"
    152152             AC_MSG_RESULT(no)])
     153abs_srcdir=`readlink -e ${ac_pwd}/${srcdir}`
    153154AC_ARG_WITH(colpack,
    154155        [
    155 AS_HELP_STRING([--with-colpack],[path to the colpack library and headers [default=${PWD}/ThirdParty/ColPack]])],
     156AS_HELP_STRING([--with-colpack],[path to the colpack library and headers [default=${srcdir}/ThirdParty/ColPack]])],
    156157                [colpack=$withval],
    157                 [colpack=${PWD}/ThirdParty/ColPack])
    158 COLPACK_CFLAGS="-I$colpack/include"
    159 COLPACK_LIBS="-L$colpack/${_lib} -lColPack -Wl,-rpath,$colpack/${_lib}"
    160 save_CFLAGS="$CFLAGS"
    161 save_LDFLAGS="$LDFLAGS"
    162 CFLAGS="$CFLAGS $COLPACK_CFLAGS"
    163 LDFLAGS="$LDFLAGS $COLPACK_LIBS"
    164 echo "will test for linking with -lColPack from $colpack/${_lib}"
    165 AC_CHECK_LIB([ColPack], [_ZN7ColPack9GraphCore12GetInputFileEv], [have_colpack=yes], [have_colpack=no])
    166 CFLAGS="$save_CFLAGS"
    167 LDFLAGS="$save_LDFLAGS"
    168 if test x$have_colpack = xno -a "x${_lib}" != "xlib" ; then
    169    unset ac_cv_lib_ColPack__ZN7ColPack9GraphCore12GetInputFileEv
    170    COLPACK_CFLAGS="-I$colpack/include"
    171    COLPACK_LIBS="-L$colpack/lib -lColPack -Wl,-rpath,$colpack/build/lib"
    172    save_CFLAGS="$CFLAGS"
    173    save_LDFLAGS="$LDFLAGS"
    174    CFLAGS="$CFLAGS $COLPACK_CFLAGS"
    175    LDFLAGS="$LDFLAGS $COLPACK_LIBS"
    176    echo "will test for linking with -lColPack from $colpack/lib"
    177    AC_CHECK_LIB([ColPack], [_ZN7ColPack9GraphCore12GetInputFileEv], [have_colpack=yes], [have_colpack=no])
    178    CFLAGS="$save_CFLAGS"
    179    LDFLAGS="$save_LDFLAGS"
    180 fi
    181 if test x$have_colpack = xno ; then
    182    unset ac_cv_lib_ColPack__ZN7ColPack9GraphCore12GetInputFileEv
    183    COLPACK_CFLAGS="-I$colpack/build/include"
    184    COLPACK_LIBS="-L$colpack/build/${_lib} -lColPack -Wl,-rpath,$colpack/build/${_lib}"
    185    save_CFLAGS="$CFLAGS"
    186    save_LDFLAGS="$LDFLAGS"
    187    CFLAGS="$CFLAGS $COLPACK_CFLAGS"
    188    LDFLAGS="$LDFLAGS $COLPACK_LIBS"
    189    echo "will test for linking with -lColPack from $colpack/build/${_lib}"
    190    AC_CHECK_LIB([ColPack], [_ZN7ColPack9GraphCore12GetInputFileEv], [have_colpack=yes], [have_colpack=no])
    191    CFLAGS="$save_CFLAGS"
    192    LDFLAGS="$save_LDFLAGS"
    193 fi
    194 if test x$have_colpack = xno -a "x${_lib}" != "xlib" ; then
    195    unset ac_cv_lib_ColPack__ZN7ColPack9GraphCore12GetInputFileEv
    196    COLPACK_CFLAGS="-I$colpack/build/include"
    197    COLPACK_LIBS="-L$colpack/build/lib -lColPack -Wl,-rpath,$colpack/build/lib"
    198    save_CFLAGS="$CFLAGS"
    199    save_LDFLAGS="$LDFLAGS"
    200    CFLAGS="$CFLAGS $COLPACK_CFLAGS"
    201    LDFLAGS="$LDFLAGS $COLPACK_LIBS"
    202    echo "will test for linking with -lColPack from $colpack/build/lib"
    203    AC_CHECK_LIB([ColPack], [_ZN7ColPack9GraphCore12GetInputFileEv], [have_colpack=yes], [have_colpack=no])
    204    CFLAGS="$save_CFLAGS"
    205    LDFLAGS="$save_LDFLAGS"
    206 fi
     158                [colpack=${abs_srcdir}/ThirdParty/ColPack])
     159
     160if test "x${_lib}" != xlib ; then
     161   dirlist="${_lib} lib build/${_lib} build/lib"
     162else
     163   dirlist="${_lib} build/${_lib}"
     164fi
     165
     166AC_LANG_PUSH([C++])
     167for dir in $dirlist ; do
     168    unset ac_cv_header_ColPackHeaders_h
     169    COLPACK_CFLAGS="-I$colpack/$dir/../include"
     170    COLPACK_LIBDIR="$colpack/$dir"
     171    COLPACK_LIBS="-L$COLPACK_LIBDIR -lColPack -Wl,-rpath,$COLPACK_LIBDIR"
     172    save_CPPFLAGS="$CPPFLAGS"
     173    save_LDFLAGS="$LDFLAGS"
     174    CPPFLAGS="$CPPFLAGS $COLPACK_CFLAGS"
     175    LDFLAGS="$LDFLAGS $COLPACK_LIBS"
     176    AC_MSG_CHECKING(for ColPack in $COLPACK_LIBDIR)
     177    AC_CHECK_HEADER([ColPackHeaders.h],[have_colpackheaders=yes],[have_colpackheaders=no])
     178    if test x$have_colpackheaders = xyes ; then
     179        AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ColPackHeaders.h>],
     180                          [ColPack::GraphColoring g])],
     181                       [have_colpack=yes
     182                        AC_MSG_RESULT(linking with -lColPack succeeded)],
     183                       [have_colpack=no,
     184                        AC_MSG_RESULT(linking with -lColPack failed)])
     185    else
     186        have_colpack=no
     187    fi
     188    CPPFLAGS="$save_CPPFLAGS"
     189    LDFLAGS="$save_LDFLAGS"
     190    if test x$have_colpack = xyes ; then
     191        break
     192    fi
     193done
     194AC_LANG_POP([C++])
    207195AM_CONDITIONAL(HAVE_LIBCOLPACK,[test x$have_colpack = xyes])
    208196if test x$have_colpack = xyes; then
     197   # test if the directories exists and what is the real path
     198   # if not then we found ColPack in some standard location
     199   # and these variables are useless
     200   COLPACK_LIBDIR=`readlink -e $COLPACK_LIBDIR`
     201   if test -n $COLPACK_LIBDIR ; then
     202      colpack_incdir=`readlink -e $COLPACK_LIBDIR/../include`
     203      if test -n $colpack_incdir ; then
     204         COLPACK_CFLAGS="-I$colpack_incdir"
     205      else
     206         COLPACK_CFLAGS=""
     207      fi
     208      COLPACK_LIBS="-L$COLPACK_LIBDIR -lColPack -Wl,-rpath,$COLPACK_LIBDIR"
     209   else
     210      COLPACK_CFLAGS=""
     211      COLPACK_LIBS=""
     212   fi
     213   # if the real path to ColPack is inside the ${srcdir}
     214   # then we should statically link all ColPack objects inside libadolc
     215   # it is likely that the srcdir is not needed anymore after make install
     216   # and thus deleted thus no more ColPack to dynamically link to
     217   # an external ColPack path is less likely to be removed
     218   if echo $COLPACK_LIBDIR | grep -q ^${abs_srcdir} ; then
     219       echo will link ColPack static as it was found in the source directory
     220       test -d $COLPACK_LIBDIR/.tmp && rm -rf $COLPACK_LIBDIR/.tmp
     221       mkdir -p $COLPACK_LIBDIR/.tmp/
     222       mkdir -p $COLPACK_LIBDIR/.tmp/.libs
     223       ( cd $COLPACK_LIBDIR/.tmp/ ; $AR x ../libColPack.a ; cp *.o .libs/
     224         for i in *.o ; do j=`echo $i | sed 's/\.o/\.lo/' `
     225                 cat >$j <<EOF
     226# $j - a libtool object file
     227# Generated by doltcompile, not libtool
     228pic_object='.libs/$i'
     229non_pic_object='$i'
     230EOF
     231        done
     232        )
     233       COLPACK_LIBS=`find "$COLPACK_LIBDIR/.tmp" -name \*.lo -printf "%p "`
     234   fi
    209235   sparse=yes
    210    echo "will build sparse drivers as -lColPack found"
     236   echo "will build sparse drivers as linking with -lColPack succeeded"
    211237fi
    212238AM_CONDITIONAL(SPARSE,[test x${sparse} = xyes])
     
    399425                windows/x64/sparse/config.h
    400426                windows/x64/nosparse/config.h
     427                adolc.spec
    401428)
    402429
Note: See TracChangeset for help on using the changeset viewer.