Changeset 46


Ignore:
Timestamp:
Jun 13, 2006 9:19:08 PM (14 years ago)
Author:
andreasw
Message:

Enabled Ampl executable for Cbc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coin.m4

    r44 r46  
    2323
    2424AC_DEFUN([AC_COIN_MAIN_SUBDIRS],
    25 [coin_subdirs=
    26 m4_ifvaln([$1],[AC_MSG_CHECKING(whether directory $1 is available)
     25[m4_ifvaln([$1],[AC_MSG_CHECKING(whether directory $1 is available)
    2726                if test -r $srcdir/$1/configure; then
    2827                  coin_subdirs="$coin_subdirs $1"
     
    107106
    108107###########################################################################
     108#                        COIN_THIRDPARTY_SUBDIRS                          #
     109###########################################################################
     110
     111# This macro sets up the recursion into the configure script in a
     112# subdirectory for compilation of third party code.  The first
     113# argument is just the string that appears in the configure output.
     114# The second argument is the directory with the configure script, and
     115# the third one is a file that should exists in that directory.  If
     116# this file does not exist, we assume that the user has not downloaded
     117# the code, and we are not going to compile it
     118
     119AC_DEFUN([AC_COIN_THIRDPARTY_SUBDIRS],
     120[AC_MSG_CHECKING(whether code for third party package $1 is available)
     121if test -r $srcdir/$2/$3; then
     122  coin_subdirs="$coin_subdirs $2"
     123  AC_MSG_RESULT(yes)
     124  AC_CONFIG_SUBDIRS($2)
     125else
     126  AC_MSG_RESULT(no)
     127fi
     128]) # AC_COIN_THIRDPARTY_SUBDIRS
     129
     130###########################################################################
    109131#                           COIN_CHECK_VPATH                              #
    110132###########################################################################
     
    969991      have_svn=no
    970992    fi
     993    rm -f confauto.out
    971994  fi
    972995
     
    15661589               test $m4_tolower(coin_has_$2) = true)
    15671590]) #AC_COIN_HAS_SOLVER
     1591
     1592###########################################################################
     1593#                               COIN_HAS_ASL                              #
     1594###########################################################################
     1595
     1596# This macro checks if the user has provide arguments that say where
     1597# the precompiled ASL files should be found (with the --with-asldir
     1598# flag).  If this is not the case, we check if the ThirdParty/ASL
     1599# directory has been configured, which indicates that the files will
     1600# be in that directory and can be used.
     1601
     1602AC_DEFUN([AC_COIN_HAS_ASL],
     1603[coin_aslobjdir=../ThirdParty/ASL
     1604coin_aslsrcdir=$srcdir/$coin_aslobjdir
     1605
     1606# Determine the name of the ASL library
     1607case "$CXX" in
     1608  cl* | */cl*)
     1609    ampllib=amplsolv.lib ;;
     1610  *)
     1611    ampllib=amplsolver.a ;;
     1612esac
     1613
     1614AC_ARG_WITH([asldir],
     1615            AC_HELP_STRING([--with-asldir],
     1616                           [specify path to AMPL solver directory (or BUILD for compilation, or "no" for disabling AMPL)]),
     1617            [use_asldir=$withval], [use_asldir=])
     1618
     1619if test "$use_asldir" = BUILD; then
     1620  AC_CHECK_FILE([$coin_aslobjdir/Makefile],[],
     1621                [AC_MSG_ERROR([option \"BUILD\" specified for asldir, but directory is not configure (sources missing?)])])
     1622elif test -z "$use_asldir"; then
     1623 # try to find sources - if not given don't compile
     1624  AC_CHECK_FILE([$coin_aslobjdir/Makefile],[use_asldir=BUILD],[use_asldir=no])
     1625elif test "$use_asldir" != "no"; then
     1626  AC_CHECK_FILE([$use_asldir/$ampllib],[],
     1627                [AC_MSG_ERROR([ASL directory \"$use_asldir\" specified, but library missing])])
     1628  AC_CHECK_FILE([$use_asldir/asl.h],[],
     1629                [AC_MSG_ERROR([ASL directory \"$use_asldir\" specified, but header files are missing])])
     1630  use_asldir=`cd $use_asldir; pwd`
     1631  case $build in
     1632    *-cygwin*) use_asldir=`cygpath -w $use_asldir | sed -e sX\\\\\\\\X/Xg` ;;
     1633  esac
     1634fi
     1635
     1636# Variable containing ASL library (including full path)
     1637AC_SUBST(ASLLIB)
     1638# Variable containing flags for including ASL header files
     1639AC_SUBST(ASL_CPPFLAGS)
     1640
     1641if test "$use_asldir" = BUILD; then
     1642  coin_aslobjdir=`cd $coin_aslobjdir; pwd`
     1643  ASLLIB="$coin_aslobjdir/$ampllib"
     1644  coin_aslsrcdir=`cd $coin_aslsrcdir; pwd`
     1645  ASL_CPPFLAGS="-I"`$CYGPATH_W $coin_aslobjdir`" -I"`$CYGPATH_W $coin_aslsrcdir/solvers`
     1646elif test "$use_asldir" != no; then
     1647  ASLLIB="$use_asldir/$ampllib"
     1648  ASL_CPPFLAGS="-I"`$CYGPATH_W $use_asldir`
     1649fi
     1650
     1651if test "$use_asldir" != no; then
     1652  AC_CHECK_LIB(dl,[dlopen],[ASLLIB="$ASLLIB -ldl"],[])
     1653  coin_has_asl=yes
     1654  AC_DEFINE([COIN_HAS_ASL],[1],
     1655            [If defined, the Ampl Solver Library is available.])
     1656else
     1657  coin_has_asl=no
     1658fi
     1659AM_CONDITIONAL(COIN_HAS_ASL, test $coin_has_asl = yes)
     1660]) # AC_COIN_HAS_ASL
Note: See TracChangeset for help on using the changeset viewer.