Changeset 2391


Ignore:
Timestamp:
Oct 12, 2018 10:49:50 PM (9 months ago)
Author:
lou
Message:

Fix up handling of nauty now that COIN_CHK_LIB has a functioning link check.

Location:
branches/autotools-update/Cbc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/autotools-update/Cbc/configure

    r2390 r2391  
    717717CBCLIB_CFLAGS_NOPC
    718718CBCLIB_LFLAGS_NOPC
     719COIN_HAS_NAUTY_FALSE
     720COIN_HAS_NAUTY_TRUE
    719721COIN_HAS_ASL_FALSE
    720722COIN_HAS_ASL_TRUE
     
    917919with_asl_lflags
    918920with_asl_cflags
     921with_nauty
     922with_nauty_lflags
     923with_nauty_cflags
    919924with_ositests
    920925with_ositests_lflags
     
    16761681                          environment. (Most often, -l specs for libraries.)
    16771682  --with-asl-cflags       Compiler flags for ASL appropriate for your
     1683                          environment. (Most often, -I specs for header file
     1684                          directories.)
     1685  --with-nauty            Use Nauty. If an argument is given, 'yes' is
     1686                          equivalent to --with-nauty, 'no' is
     1687                          equivalent to --without-nauty. Any other argument is
     1688                          applied as for --with-nauty-lflags
     1689  --with-nauty-lflags     Linker flags for Nauty appropriate for your
     1690                          environment. (Most often, -l specs for libraries.)
     1691  --with-nauty-cflags     Compiler flags for Nauty appropriate for your
    16781692                          environment. (Most often, -I specs for header file
    16791693                          directories.)
     
    1837918393
    1838018394
    18381 # Nauty library (for symmetry detection)
    18382 
    18383 # AC_COIN_CHK_LIB([Nauty],[CbcLib CbcGeneric],[-lnauty])
    18384 
    18385 # AC_LANG_PUSH(C)
    18386 # AC_COIN_CHECK_USER_LIBRARY([Nauty],[NTY],[nauty.h],[nauty],,
    18387 #                            [CbcLib CbcGeneric])
    18388 # AC_LANG_POP(C)
     18395# Nauty library (for symmetry detection). This doesn't seem to work any more;
     18396# compilation fails looking for zapSymmetry, which doesn't exist.
     18397# nauty.h
     18398
     18399
     18400  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for package Nauty" >&5
     18401$as_echo_n "checking for package Nauty... " >&6; }
     18402
     18403# Make sure the necessary variables exist for each client package.
     18404
     18405
     18406
     18407
     18408
     18409
     18410
     18411# Check to see if the user has overridden configure parameters from the
     18412# environment.
     18413
     18414  coin_has_nauty=noInfo
     18415  if test x"$COIN_SKIP_PROJECTS" != x ; then
     18416    for pkg in $COIN_SKIP_PROJECTS ; do
     18417      if test "$pkg" = "$nauty" ; then
     18418        coin_has_nauty=skipping
     18419      fi
     18420    done
     18421  fi
     18422
     18423# If we're not skipping this project, define and process the command line
     18424# options according to the cmdopts parameter. Then invoke FIND_PRIM_PKG to do
     18425# the heavy lifting.
     18426
     18427  if test "$coin_has_nauty" != skipping ; then
     18428
     18429
     18430
     18431
     18432# Check whether --with-nauty was given.
     18433if test "${with_nauty+set}" = set; then :
     18434  withval=$with_nauty;
     18435fi
     18436
     18437
     18438
     18439# Check whether --with-nauty-lflags was given.
     18440if test "${with_nauty_lflags+set}" = set; then :
     18441  withval=$with_nauty_lflags;
     18442fi
     18443
     18444
     18445
     18446# Check whether --with-nauty-cflags was given.
     18447if test "${with_nauty_cflags+set}" = set; then :
     18448  withval=$with_nauty_cflags;
     18449fi
     18450
     18451
     18452
     18453
     18454
     18455  dflt_action=yes
     18456
     18457# Initialize variables for the primary library.
     18458
     18459  coin_has_nauty=noInfo
     18460  nauty_lflags=
     18461  nauty_cflags=
     18462  nauty_data=
     18463
     18464# --with-prim is always present. If the client specified dataonly, its value
     18465# is assigned to prim_data.
     18466
     18467  withval=$with_nauty
     18468  if test -n "$withval" ; then
     18469    case "$withval" in
     18470      no )
     18471        coin_has_nauty=skipping
     18472        ;;
     18473      yes )
     18474        coin_has_nauty=requested
     18475        ;;
     18476      build )
     18477        coin_has_nauty=build
     18478        ;;
     18479      * )
     18480        coin_has_nauty=yes
     18481        nauty_lflags=$withval
     18482        ;;
     18483    esac
     18484  fi
     18485
     18486# --with-prim-lflags and --with-prim-cflags are present unless the client
     18487# specified dataonly. Specifying --with-prim=no overrides the individual
     18488# options for lflags and cflags.
     18489
     18490  if test "$coin_has_nauty" != skipping ; then
     18491       withval=$with_nauty_lflags
     18492       if test -n "$withval" ; then
     18493         case "$withval" in
     18494           build | no | yes )
     18495             as_fn_error $? "\"$withval\" is not valid here; please specify linker flags appropriate for your environment." "$LINENO" 5
     18496             ;;
     18497           * )
     18498             coin_has_nauty=yes
     18499             nauty_lflags=$withval
     18500             ;;
     18501         esac
     18502       fi
     18503
     18504       withval=$with_nauty_cflags
     18505       if test -n "$withval" ; then
     18506         case "$withval" in
     18507           build | no | yes )
     18508             as_fn_error $? "\"$withval\" is not valid here; please specify compiler flags appropriate for your environment." "$LINENO" 5
     18509             ;;
     18510           * )
     18511             coin_has_nauty=yes
     18512             nauty_cflags="$withval"
     18513             ;;
     18514         esac
     18515       fi
     18516     fi
     18517
     18518# --with-prim-data will be present unless the client specified nodata.
     18519# Specifying --with-prim=no overrides the individual option for data.
     18520
     18521
     18522
     18523# At this point, coin_has_prim can be one of noInfo (no user options
     18524# specified), skipping (user said no), requested or build (user said yes
     18525# or build and gave no further guidance), or yes (user specified one or
     18526# more --with-prim options). If we're already at yes or skipping, we're
     18527# done looking.
     18528
     18529# If there are no user options (noInfo) and the default is no, we're skipping.
     18530# Otherwise, the default must be yes or build; consider the package requested.
     18531# A default action we don't recognise defaults to yes.
     18532
     18533  if test "$coin_has_nauty" = noInfo ; then
     18534    case $dflt_action in
     18535      no )
     18536        coin_has_nauty=skipping
     18537        ;;
     18538      build )
     18539        coin_has_nauty=build
     18540        ;;
     18541      * )
     18542        coin_has_nauty=requested
     18543        ;;
     18544    esac
     18545  fi
     18546
     18547# Now coin_has_prim can be one of skipping, yes, build, or requested. For
     18548# build or requested, use the parameter values or invent some.
     18549
     18550  case $coin_has_nauty in
     18551    build | requested)
     18552      nauty_lflags=-lnauty
     18553         if test "$coin_has_nauty" = build ; then
     18554              nauty_cflags="-I\$(pkgincludedir)/ThirdParty"
     18555            fi
     18556
     18557      coin_has_nauty=yes
     18558      ;;
     18559    skipping | yes )
     18560      ;;
     18561    * )
     18562      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unexpected status \"$coin_has_nauty\" in COIN_FIND_PRIM_LIB" >&5
     18563$as_echo "$as_me: WARNING: Unexpected status \"$coin_has_nauty\" in COIN_FIND_PRIM_LIB" >&2;}
     18564      ;;
     18565  esac
     18566
     18567# At this point, coin_has_prim is yes or skipping.  Time to run a link check,
     18568# if we have a function (nauty). Use whatever we've collected for lflags, plus
     18569# other libraries () as the other libraries parameter to AC_SEARCH_LIBS,
     18570# leaving the library parameter blank.
     18571
     18572  if test $coin_has_nauty != skipping ; then
     18573    ac_save_LIBS=$LIBS
     18574       LIBS="$nauty_lflags "
     18575       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     18576/* end confdefs.h.  */
     18577#ifdef __cplusplus
     18578             extern "C"
     18579           #endif
     18580           void nauty();
     18581int
     18582main ()
     18583{
     18584nauty()
     18585  ;
     18586  return 0;
     18587}
     18588_ACEOF
     18589if ac_fn_c_try_link "$LINENO"; then :
     18590
     18591else
     18592  coin_has_nauty=no
     18593fi
     18594rm -f core conftest.err conftest.$ac_objext \
     18595    conftest$ac_exeext conftest.$ac_ext
     18596       LIBS=$ac_save_LIBS
     18597  fi
     18598
     18599# The final value of coin_has_prim will be yes, no, or skipping. No means that
     18600# the link check failed. Yes means that we passed the link check, or no link
     18601# check was performed. Skipping means the user said `don't use.'
     18602
     18603# Change the test to enable / disable debugging output
     18604
     18605    if test 1 = 1 ; then
     18606      { $as_echo "$as_me:${as_lineno-$LINENO}: FIND_PRIM_LIB result for nauty: \"$coin_has_nauty\"" >&5
     18607$as_echo "$as_me: FIND_PRIM_LIB result for nauty: \"$coin_has_nauty\"" >&6;}
     18608      { $as_echo "$as_me:${as_lineno-$LINENO}: Collected values for package 'nauty'" >&5
     18609$as_echo "$as_me: Collected values for package 'nauty'" >&6;}
     18610      { $as_echo "$as_me:${as_lineno-$LINENO}: nauty_lflags is \"$nauty_lflags\"" >&5
     18611$as_echo "$as_me: nauty_lflags is \"$nauty_lflags\"" >&6;}
     18612      { $as_echo "$as_me:${as_lineno-$LINENO}: nauty_cflags is \"$nauty_cflags\"" >&5
     18613$as_echo "$as_me: nauty_cflags is \"$nauty_cflags\"" >&6;}
     18614      { $as_echo "$as_me:${as_lineno-$LINENO}: nauty_data is \"$nauty_data\"" >&5
     18615$as_echo "$as_me: nauty_data is \"$nauty_data\"" >&6;}
     18616      { $as_echo "$as_me:${as_lineno-$LINENO}: nauty_pcfiles is \"$nauty_pcfiles\"" >&5
     18617$as_echo "$as_me: nauty_pcfiles is \"$nauty_pcfiles\"" >&6;}
     18618    fi
     18619
     18620
     18621    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $coin_has_nauty" >&5
     18622$as_echo "$coin_has_nauty" >&6; }
     18623  else
     18624    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $coin_has_nauty due to COIN_SKIP_PROJECTS" >&5
     18625$as_echo "$coin_has_nauty due to COIN_SKIP_PROJECTS" >&6; }
     18626  fi
     18627
     18628# Possibilities are `yes', `no', or `skipping'. Normalise to `yes' or `no'.
     18629
     18630  if test "$coin_has_nauty" != yes ; then
     18631    coin_has_nauty=no
     18632  fi
     18633
     18634# Create an automake conditional COIN_HAS_PRIM.
     18635
     18636   if test $coin_has_nauty = yes; then
     18637  COIN_HAS_NAUTY_TRUE=
     18638  COIN_HAS_NAUTY_FALSE='#'
     18639else
     18640  COIN_HAS_NAUTY_TRUE='#'
     18641  COIN_HAS_NAUTY_FALSE=
     18642fi
     18643
     18644
     18645# If we've located the package, define preprocessor symbol COIN_HAS_PRIM
     18646# and augment the necessary variables for the client packages.
     18647
     18648  if test $coin_has_nauty = yes ; then
     18649
     18650$as_echo "#define COIN_HAS_NAUTY 1" >>confdefs.h
     18651
     18652    CBCLIB_LFLAGS="$nauty_lflags $CBCLIB_LFLAGS"
     18653       CBCLIB_CFLAGS="$nauty_cflags $CBCLIB_CFLAGS"
     18654      CBCGENERIC_LFLAGS="$nauty_lflags $CBCGENERIC_LFLAGS"
     18655       CBCGENERIC_CFLAGS="$nauty_cflags $CBCGENERIC_CFLAGS"
     18656
     18657
     18658# Finally, set up PRIM_DATA, unless the user specified nodata.
     18659
     18660
     18661  fi
     18662
    1838918663
    1839018664#############################################################################
     
    2234922623if test -z "${COIN_HAS_ASL_TRUE}" && test -z "${COIN_HAS_ASL_FALSE}"; then
    2235022624  as_fn_error $? "conditional \"COIN_HAS_ASL\" was never defined.
     22625Usually this means the macro was only invoked conditionally." "$LINENO" 5
     22626fi
     22627if test -z "${COIN_HAS_NAUTY_TRUE}" && test -z "${COIN_HAS_NAUTY_FALSE}"; then
     22628  as_fn_error $? "conditional \"COIN_HAS_NAUTY\" was never defined.
    2235122629Usually this means the macro was only invoked conditionally." "$LINENO" 5
    2235222630fi
  • branches/autotools-update/Cbc/configure.ac

    r2390 r2391  
    8787AC_COIN_CHK_PKG(ASL,[CbcLib CbcGeneric],[coinasl])
    8888
    89 # Nauty library (for symmetry detection)
    90 
    91 # AC_COIN_CHK_LIB([Nauty],[CbcLib CbcGeneric],[-lnauty])
    92 
    93 # AC_LANG_PUSH(C)
    94 # AC_COIN_CHECK_USER_LIBRARY([Nauty],[NTY],[nauty.h],[nauty],,
    95 #                            [CbcLib CbcGeneric])
    96 # AC_LANG_POP(C)
     89# Nauty library (for symmetry detection). This doesn't seem to work any more;
     90# compilation fails looking for zapSymmetry, which doesn't exist.
     91# nauty.h
     92
     93AC_COIN_CHK_LIB([Nauty],[CbcLib CbcGeneric],[-lnauty],[],[],[nauty])
    9794
    9895#############################################################################
  • branches/autotools-update/Cbc/src/Makefile.am

    r2390 r2391  
    123123AM_CPPFLAGS = -DCBC_BUILD $(CBCLIB_CFLAGS)
    124124
    125 # if COIN_HAS_NAUTY
    126 # AM_CPPFLAGS += $(NAUTY_CFLAGS)
    127 # endif
     125if COIN_HAS_NAUTY
     126  AM_CPPFLAGS += -DCOIN_HAS_NTY $(NAUTY_CFLAGS)
     127endif
    128128
    129129########################################################################
  • branches/autotools-update/Cbc/src/Makefile.in

    r2390 r2391  
    111111host_triplet = @host@
    112112bin_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2)
    113 
    114 # if COIN_HAS_NAUTY
    115 # AM_CPPFLAGS += $(NAUTY_CFLAGS)
    116 # endif
     113@COIN_HAS_NAUTY_TRUE@am__append_1 = -DCOIN_HAS_NTY $(NAUTY_CFLAGS)
    117114
    118115########################################################################
     
    122119# Name of the executable compiled in this directory.  We want it to be
    123120# installed in the 'bin' directory
    124 @COIN_HAS_CLP_TRUE@am__append_1 = cbc
     121@COIN_HAS_CLP_TRUE@am__append_2 = cbc
    125122#cbc_DEPENDENCIES = libCbcSolver.la libCbc.la $(CBCLIB_DEPENDENCIES) $(ASL_DEPENDENCIES)
    126123
     
    131128# Name of the executable compiled in this directory.  We want it to be
    132129# installed in the 'bin' directory
    133 @CBC_BUILD_CBC_GENERIC_TRUE@am__append_2 = cbc-generic
     130@CBC_BUILD_CBC_GENERIC_TRUE@am__append_3 = cbc-generic
    134131# cbc_generic_DEPENDENCIES = libCbcSolver.la libCbc.la $(CBCGENERIC_DEPENDENCIES)
    135132
     
    137134# the linker flags for all available LP solvers should already be included in $CBCGENERIC_LIBS,
    138135# so just add compiler flags here (all we can think of)
    139 @CBC_BUILD_CBC_GENERIC_TRUE@am__append_3 = $(CBCGENERIC_CFLAGS)
     136@CBC_BUILD_CBC_GENERIC_TRUE@am__append_4 = $(CBCGENERIC_CFLAGS)
    140137subdir = src
    141138ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     
    625622
    626623# List additional defines
    627 AM_CPPFLAGS = -DCBC_BUILD $(CBCLIB_CFLAGS) $(am__append_3) \
    628         -DCOIN_NO_CLP_MESSAGE -DUSE_CBCCONFIG
     624AM_CPPFLAGS = -DCBC_BUILD $(CBCLIB_CFLAGS) $(am__append_1) \
     625        $(am__append_4) -DCOIN_NO_CLP_MESSAGE -DUSE_CBCCONFIG
    629626
    630627# List all source files for this executable, including headers
  • branches/autotools-update/Cbc/src/config.h.in

    r2390 r2391  
    5252/* Define to 1 if Msk is available. */
    5353#undef COIN_HAS_MSK
     54
     55/* Define to 1 if the Nauty package is available */
     56#undef COIN_HAS_NAUTY
    5457
    5558/* Define to 1 if Netlib is available. */
Note: See TracChangeset for help on using the changeset viewer.