From e3087045254ef006cdbc0b4aa351556a04559d6e Mon Sep 17 00:00:00 2001 From: Jerry James Date: Thu, 21 Apr 2016 16:40:59 -0600 Subject: [PATCH] Initial import. --- .gitignore | 1 + nauty-autotoolization.patch | 1506 ++++++++++++++++++++++++++ nauty-fix-gt_numorbits.patch | 36 + nauty-fix-include-extern.patch | 18 + nauty-help2man.patch | 389 +++++++ nauty-includes.patch | 117 +++ nauty-popcnt.patch | 1803 ++++++++++++++++++++++++++++++++ nauty-tool-prefix.patch | 568 ++++++++++ nauty-zlib-blisstog.patch | 211 ++++ nauty.spec | 132 +++ sources | 1 + 11 files changed, 4782 insertions(+) create mode 100644 nauty-autotoolization.patch create mode 100644 nauty-fix-gt_numorbits.patch create mode 100644 nauty-fix-include-extern.patch create mode 100644 nauty-help2man.patch create mode 100644 nauty-includes.patch create mode 100644 nauty-popcnt.patch create mode 100644 nauty-tool-prefix.patch create mode 100644 nauty-zlib-blisstog.patch create mode 100644 nauty.spec diff --git a/.gitignore b/.gitignore index e69de29..52b0dbb 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/nauty26r5.tar.gz diff --git a/nauty-autotoolization.patch b/nauty-autotoolization.patch new file mode 100644 index 0000000..a3fd73e --- /dev/null +++ b/nauty-autotoolization.patch @@ -0,0 +1,1506 @@ +Description: upstream autotoolization + Attempt to autotoolize nauty source. +Origin: debian +Author: Jerome Benoit +Last-Update: 2016-03-19 + +--- a/configure.ac ++++ b/configure.ac +@@ -1,5 +1,22 @@ + dnl Process this file with autoconf to produce a configure script. +-AC_INIT(nauty-h.in) ++AC_INIT([nauty],[@INJECTVER@],[bdm@cs.anu.edu.au],[nauty],[http://pallini.di.uniroma1.it/]) ++AC_CONFIG_MACRO_DIR([m4]) ++AC_CONFIG_AUX_DIR([autotool]) ++AC_CONFIG_SRCDIR([dreadnaut.c]) ++AC_CONFIG_HEADER([nauty/nauty_config.h]) ++AM_INIT_AUTOMAKE([foreign]) ++AM_MAINTAINER_MODE ++ ++LIBNAUTY_VERSION_MAJOR=${PACKAGE_VERSION%%.*} ++LIBNAUTY_VERSION_MINOR=${PACKAGE_VERSION#*.} ++LIBNAUTY_VERSION_MINOR=${LIBNAUTY_VERSION_MINOR%%.*} ++LIBNAUTY_VERSION_MICRO=${PACKAGE_VERSION##*.} ++LIBNAUTY_LT_VERSION="$(expr ${LIBNAUTY_VERSION_MAJOR} + ${LIBNAUTY_VERSION_MINOR}):${LIBNAUTY_VERSION_MICRO}:${LIBNAUTY_VERSION_MINOR}" ++ ++AC_SUBST(LIBNAUTY_VERSION_MAJOR) ++AC_SUBST(LIBNAUTY_VERSION_MINOR) ++AC_SUBST(LIBNAUTY_VERSION_MICRO) ++AC_SUBST(LIBNAUTY_LT_VERSION) + + AC_DEFUN([AX_TLS], [ + AC_MSG_CHECKING(for thread local storage (TLS) class) +@@ -48,7 +65,7 @@ + + dnl CVT_YESNO([YES-NO VARIABLE],[0-1 VARIABLE]) + dnl Make a 0-1 output variable from a yes/no shell variable +-AC_DEFUN(CVT_YESNO,[if test x"$$1" = x"yes"; then ++AC_DEFUN([CVT_YESNO],[if test x"$$1" = x"yes"; then + $2=1 + else + $2=0 +@@ -58,82 +75,89 @@ + dnl Checks for system features + AC_CANONICAL_HOST + +-dnl Checks for C compiler and sets CFLAGS if not set by user +-user_cflags="$CFLAGS" ++AC_PATH_PROG([HELP2MAN],[help2man]) + AC_PROG_CC +-CFLAGS=$user_cflags ++AC_PROG_INSTALL ++AC_PROG_LN_S ++AC_PROG_MAKE_SET ++LT_INIT ++ ++dnl dnl Checks for C compiler and sets CFLAGS if not set by user ++dnl user_cflags="$CFLAGS" ++dnl AC_PROG_CC ++dnl CFLAGS=$user_cflags + MORECFLAGS="" + dnl we need AC_SYS_LARGEFILE and AC_FUNC_FSEEKO + AC_SYS_LARGEFILE + AS_IF([test x"$ac_cv_sys_file_offset_bits" = xno],[ac_cv_sys_file_offset_bits=0],[]) + AC_SUBST(ac_cv_sys_file_offset_bits) + +-if test x"$user_cflags" = x"" -o x"$user_cflags" = x-m32 ; then +- if test "$CC" = "icc" ; then +- AC_TRY_CFLAGS([-O3],[CFLAGS="$CFLAGS -O3"]); +- if test x"$ac_cv_try_cflags_ok" = x"no"; then +- AC_TRY_CFLAGS([-O2],[CFLAGS="$CFLAGS -O2"],[CFLAGS="$CFLAGS -O"]); +- fi +- else +- AC_TRY_CFLAGS([-O4 -Werror],[CFLAGS="$CFLAGS -O4"]); +- if test x"$ac_cv_try_cflags_ok" = x"no"; then +- AC_TRY_CFLAGS([-O3],[CFLAGS="$CFLAGS -O3"]); +- if test x"$ac_cv_try_cflags_ok" = x"no"; then +- AC_TRY_CFLAGS([-O2],[CFLAGS="$CFLAGS -O2"],[CFLAGS="$CFLAGS -O"]); +- fi +- fi +- fi +- +- if test "$CC" = "gcc" ; then +- gccver=`gcc --version 2>/dev/null || echo 0.0.0` +- else +- gccver=0.0.0 +- fi +- +- case "$host" in +- *i686-apple-darwin*) +- AC_TRY_CFLAGS([-fast],[CFLAGS="$MORECFLAGS -fast"]);; +- *pentium*solaris*) +- ;; +- *pentium4*) +- AC_TRY_CFLAGS([-march=pentium4],[CFLAGS="$CFLAGS -march=pentium4"]);; +- *pentium3*|*i686*|*athlon*) +- AC_TRY_CFLAGS([-march=i686],[CFLAGS="$CFLAGS -march=i686"]);; +- *pentium2*|*i586*) +- AC_TRY_CFLAGS([-march=i586],[CFLAGS="$CFLAGS -march=i586"]);; +- *powerpc*) +- machtype=`/usr/bin/machine 2>/dev/null || echo unknown` +- case "$machtype" in +- ppc740?) +- AC_TRY_CFLAGS([-mcpu=7400],[CFLAGS="$CFLAGS -mcpu=7400"]) +- AC_TRY_CFLAGS([-mtune=7400],[CFLAGS="$CFLAGS -mtune=7400"]);; +- ppc745?) +- AC_TRY_CFLAGS([-mcpu=7450],[CFLAGS="$CFLAGS -mcpu=7450"]) +- AC_TRY_CFLAGS([-mtune=7450],[CFLAGS="$CFLAGS -mtune=7450"]) +- case "$gccver" in +- *\ 4.[[0-9]].[[0-9]]\ *) +- AC_TRY_CFLAGS([$CFLAGS -fast], +- [MORECFLAGS="$MORECFLAGS -fast"]);; +- esac;; +- ppc970) +- AC_TRY_CFLAGS([-mcpu=g5],[CFLAGS="$CFLAGS -mcpu=g5"]) +- AC_TRY_CFLAGS([-mtune=g5],[CFLAGS="$CFLAGS -mtune=g5"]) +- AC_TRY_CFLAGS([-fast],[CFLAGS="$MORECFLAGS -fast"]);; +- *) +- AC_TRY_CFLAGS([-mpowerpc],[CFLAGS="$CFLAGS -mpowerpc"]);; +- esac;; +- *osf*) +- AC_TRY_CFLAGS([-fast],[CFLAGS="$CFLAGS -fast"]);; +- *sparcv8*|*sparcv9*) +- AC_TRY_CFLAGS([-msupersparc],[CFLAGS="$CFLAGS -msupersparc"]) +- if test x"$ac_cv_try_cflags_ok" = x"no"; then +- AC_TRY_CFLAGS([-cg92],[CFLAGS="$CFLAGS -cg92"]) +- if test x"$ac_cv_try_cflags_ok" = x"no"; then +- AC_TRY_CFLAGS([-xcg92],[CFLAGS="$CFLAGS -xcg92"]) +- fi +- fi;; +- esac +-fi ++dnl if test x"$user_cflags" = x"" -o x"$user_cflags" = x-m32 ; then ++dnl if test "$CC" = "icc" ; then ++dnl AC_TRY_CFLAGS([-O3],[CFLAGS="$CFLAGS -O3"]); ++dnl if test x"$ac_cv_try_cflags_ok" = x"no"; then ++dnl AC_TRY_CFLAGS([-O2],[CFLAGS="$CFLAGS -O2"],[CFLAGS="$CFLAGS -O"]); ++dnl fi ++dnl else ++dnl AC_TRY_CFLAGS([-O4 -Werror],[CFLAGS="$CFLAGS -O4"]); ++dnl if test x"$ac_cv_try_cflags_ok" = x"no"; then ++dnl AC_TRY_CFLAGS([-O3],[CFLAGS="$CFLAGS -O3"]); ++dnl if test x"$ac_cv_try_cflags_ok" = x"no"; then ++dnl AC_TRY_CFLAGS([-O2],[CFLAGS="$CFLAGS -O2"],[CFLAGS="$CFLAGS -O"]); ++dnl fi ++dnl fi ++dnl fi ++dnl ++dnl if test "$CC" = "gcc" ; then ++dnl gccver=`gcc --version 2>/dev/null || echo 0.0.0` ++dnl else ++dnl gccver=0.0.0 ++dnl fi ++dnl ++dnl case "$host" in ++dnl *i686-apple-darwin*) ++dnl AC_TRY_CFLAGS([-fast],[CFLAGS="$MORECFLAGS -fast"]);; ++dnl *pentium*solaris*) ++dnl ;; ++dnl *pentium4*) ++dnl AC_TRY_CFLAGS([-march=pentium4],[CFLAGS="$CFLAGS -march=pentium4"]);; ++dnl *pentium3*|*i686*|*athlon*) ++dnl AC_TRY_CFLAGS([-march=i686],[CFLAGS="$CFLAGS -march=i686"]);; ++dnl *pentium2*|*i586*) ++dnl AC_TRY_CFLAGS([-march=i586],[CFLAGS="$CFLAGS -march=i586"]);; ++dnl *powerpc*) ++dnl machtype=`/usr/bin/machine 2>/dev/null || echo unknown` ++dnl case "$machtype" in ++dnl ppc740?) ++dnl AC_TRY_CFLAGS([-mcpu=7400],[CFLAGS="$CFLAGS -mcpu=7400"]) ++dnl AC_TRY_CFLAGS([-mtune=7400],[CFLAGS="$CFLAGS -mtune=7400"]);; ++dnl ppc745?) ++dnl AC_TRY_CFLAGS([-mcpu=7450],[CFLAGS="$CFLAGS -mcpu=7450"]) ++dnl AC_TRY_CFLAGS([-mtune=7450],[CFLAGS="$CFLAGS -mtune=7450"]) ++dnl case "$gccver" in ++dnl *\ 4.[[0-9]].[[0-9]]\ *) ++dnl AC_TRY_CFLAGS([$CFLAGS -fast], ++dnl [MORECFLAGS="$MORECFLAGS -fast"]);; ++dnl esac;; ++dnl ppc970) ++dnl AC_TRY_CFLAGS([-mcpu=g5],[CFLAGS="$CFLAGS -mcpu=g5"]) ++dnl AC_TRY_CFLAGS([-mtune=g5],[CFLAGS="$CFLAGS -mtune=g5"]) ++dnl AC_TRY_CFLAGS([-fast],[CFLAGS="$MORECFLAGS -fast"]);; ++dnl *) ++dnl AC_TRY_CFLAGS([-mpowerpc],[CFLAGS="$CFLAGS -mpowerpc"]);; ++dnl esac;; ++dnl *osf*) ++dnl AC_TRY_CFLAGS([-fast],[CFLAGS="$CFLAGS -fast"]);; ++dnl *sparcv8*|*sparcv9*) ++dnl AC_TRY_CFLAGS([-msupersparc],[CFLAGS="$CFLAGS -msupersparc"]) ++dnl if test x"$ac_cv_try_cflags_ok" = x"no"; then ++dnl AC_TRY_CFLAGS([-cg92],[CFLAGS="$CFLAGS -cg92"]) ++dnl if test x"$ac_cv_try_cflags_ok" = x"no"; then ++dnl AC_TRY_CFLAGS([-xcg92],[CFLAGS="$CFLAGS -xcg92"]) ++dnl fi ++dnl fi;; ++dnl esac ++dnl fi + + echo CFLAGS=$CFLAGS + echo MORECFLAGS=$MORECFLAGS +@@ -431,6 +455,26 @@ + edit_msg="++++++ This file is automatically generated, don't edit it by hand! ++++++" + AC_SUBST(edit_msg) + +-AC_OUTPUT(makefile:makefile.in nauty.h:nauty-h.in +- naututil.h:naututil-h.in gtools.h:gtools-h.in) ++dnl Checks for linker script support ++gl_LD_VERSION_SCRIPT ++ ++dnl Checks for libraries ++## pkg-config ++PKG_PROG_PKG_CONFIG ++## math library ++LT_LIB_M ++## zlib Library (zlib) ++AM_PATH_ZLIB(1.2.7,[],[AC_MSG_WARN([could not find required version of zlib])]) ++## GNU MultiPrecision arithmetic library (GMP) ++AM_PATH_GMP(5.1.2,[],[AC_MSG_WARN([could not find required version of GMP])]) ++ ++AC_CONFIG_FILES([ ++ nauty.pc ++ Makefile ++ nauty/Makefile ++ nauty.h:nauty-h.in ++ naututil.h:naututil-h.in ++ gtools.h:gtools-h.in ++ ]) + ++AC_OUTPUT +--- /dev/null ++++ b/Makefile.am +@@ -0,0 +1,483 @@ ++AUTOMAKE_OPTIONS = foreign ++ACLOCAL_AMFLAGS = -I m4 ++ ++SUBDIRS = nauty ++ ++pkginclude_HEADERS = \ ++ nauty.h \ ++ nautinv.h \ ++ naurng.h \ ++ nausparse.h \ ++ naututil.h \ ++ naugroup.h \ ++ schreier.h \ ++ traces.h \ ++ gtools.h \ ++ gutils.h ++ ++pkgconfigdir = $(libdir)/pkgconfig ++pkgconfig_DATA= nauty.pc ++ ++bin_PROGRAMS = \ ++ dreadnaut \ ++ \ ++ addedgeg \ ++ amtog \ ++ biplabg \ ++ catg \ ++ complg \ ++ converseg \ ++ copyg \ ++ countg \ ++ cubhamg \ ++ deledgeg \ ++ delptg \ ++ directg \ ++ dretodot \ ++ dretog \ ++ genbg \ ++ genbgL \ ++ geng \ ++ genquarticg \ ++ genrang \ ++ genspecialg \ ++ gentourng \ ++ gentreeg \ ++ hamheuristic \ ++ labelg \ ++ linegraphg \ ++ listg \ ++ multig \ ++ newedgeg \ ++ NRswitchg \ ++ pickg \ ++ planarg \ ++ ranlabg \ ++ shortg \ ++ showg \ ++ subdivideg \ ++ twohamg \ ++ vcolg \ ++ watercluster2 \ ++ \ ++ blisstog \ ++ checks6 \ ++ sumlines ++ ++man_MANS = \ ++ dreadnaut.1 \ ++ \ ++ addedgeg.1 \ ++ amtog.1 \ ++ biplabg.1 \ ++ catg.1 \ ++ complg.1 \ ++ converseg.1 \ ++ copyg.1 \ ++ countg.1 \ ++ cubhamg.1 \ ++ deledgeg.1 \ ++ delptg.1 \ ++ directg.1 \ ++ dretodot.1 \ ++ dretog.1 \ ++ genbg.1 \ ++ genbgL.1 \ ++ geng.1 \ ++ genquarticg.1 \ ++ genrang.1 \ ++ genspecialg.1 \ ++ gentourng.1 \ ++ gentreeg.1 \ ++ hamheuristic.1 \ ++ labelg.1 \ ++ linegraphg.1 \ ++ listg.1 \ ++ multig.1 \ ++ newedgeg.1 \ ++ NRswitchg.1 \ ++ pickg.1 \ ++ planarg.1 \ ++ ranlabg.1 \ ++ shortg.1 \ ++ showg.1 \ ++ subdivideg.1 \ ++ twohamg.1 \ ++ vcolg.1 \ ++ watercluster2.1 \ ++ \ ++ blisstog.1 \ ++ checks6.1 \ ++ sumlines.1 ++ ++lib_LTLIBRARIES = \ ++ libnauty.la \ ++ libnautyA1.la \ ++ libnautyS0.la \ ++ libnautyW0.la \ ++ libnautyL0.la \ ++ libnautyS1.la \ ++ libnautyW1.la \ ++ libnautyL1.la ++ ++check_PROGRAMS = \ ++ dreadtest \ ++ dreadtest1 \ ++ dreadtestS \ ++ dreadtestW \ ++ dreadtestL \ ++ dreadtestS1 \ ++ dreadtestW1 \ ++ dreadtestL1 \ ++ dreadtest4K \ ++ naucompare ++ ++TESTS = runalltests ++ ++AM_CPPFLAGS = ++AM_CFLAGS = ++AM_LDFLAGS = ++LDADD = ++ ++NAUTY_LDADD = $(top_builddir)/libnauty.la $(threadlib) ++NAUTYW1_LDADD = $(top_builddir)/libnautyW1.la $(threadlib) ++NAUTYL1_LDADD = $(top_builddir)/libnautyL1.la $(threadlib) ++ ++AM_H2MFLAGS = \ ++ --manual="Nauty Manual" \ ++ --version-string="$(PACKAGE_VERSION)" \ ++ --source="nauty $(PACKAGE_VERSION)" \ ++ --no-info ++ ++%.1: % ++ $(HELP2MAN) \ ++ -s 1 \ ++ $(AM_H2MFLAGS) \ ++ -I $(top_srcdir)/man/$*.h2m \ ++ -n $(if $($*_DESCRIPTION), $($*_DESCRIPTION), "manual page for $*") \ ++ -o $@ \ ++ $(top_builddir)/$< ++ ++%.map: $(top_srcdir)/nauty.map ++ $(SED) -e 's#LIBNAUTY_#LIBNAUTY'$(subst nauty,,$*)'_#' $< > $@ ++ ++## ++#nauty_flavour_CPPFLAGS = ++nautyA1_flavour_CPPFLAGS = -DMAXN=WORDSIZE ++nautyS0_flavour_CPPFLAGS = -DWORDSIZE=16 ++nautyS1_flavour_CPPFLAGS = $(nautyA1_flavour_CPPFLAGS) $(nautyS0_flavour_CPPFLAGS) ++nautyW0_flavour_CPPFLAGS = -DWORDSIZE=32 ++nautyW1_flavour_CPPFLAGS = $(nautyA1_flavour_CPPFLAGS) $(nautyW0_flavour_CPPFLAGS) ++nautyL0_flavour_CPPFLAGS = -DWORDSIZE=64 ++nautyL1_flavour_CPPFLAGS = $(nautyA1_flavour_CPPFLAGS) $(nautyL0_flavour_CPPFLAGS) ++ ++ ++## short descriptions inspired from the basic functions of the programs as described ++## in section `Utilities' (15) of the `Nauty and Traces User's Guide' (version 2.6) ++dreadnaut_DESCRIPTION = "command line interface to nauty graph isomorphism library" ++addedgeg_DESCRIPTION = "add an edge in each possible way" ++amtog_DESCRIPTION = "read graphs in matrix format" ++biplabg_DESCRIPTION = "label bipartite graphs so the colour classes are contiguous" ++catg_DESCRIPTION = "concatenate files of graphs" ++complg_DESCRIPTION = "complement graphs" ++converseg_DESCRIPTION = "converse digraphs" ++copyg_DESCRIPTION = "convert format and select subset" ++countg_DESCRIPTION = "count graphs according to a variety of properties" ++cubhamg_DESCRIPTION = "find hamiltonian cycles in subcubic graphs" ++deledgeg_DESCRIPTION = "delete an edge in each possible way" ++delptg_DESCRIPTION = "delete vertices" ++directg_DESCRIPTION = "generate small digraphs with given underlying graph" ++dretodot_DESCRIPTION = "read graphs and initial coloring in dreadnaut format and write in dot format" ++dretog_DESCRIPTION = "read graphs in dreadnaut format" ++genbg_DESCRIPTION = "generate small bicoloured graphs" ++genbgL_DESCRIPTION = "$(shell printf "%s %s" $(genbg_DESCRIPTION) "(L1 flavour)")" ++geng_DESCRIPTION = "generate small graphs" ++genquarticg_DESCRIPTION = "generate quartic graphs" ++genrang_DESCRIPTION = "generate random graphs" ++genspecialg_DESCRIPTION = "generate special graphs" ++gentourng_DESCRIPTION = "generate small tournaments" ++gentreeg_DESCRIPTION = "generate trees" ++hamheuristic_DESCRIPTION = "try to find hamiltonian cycles in any graphs" ++labelg_DESCRIPTION = "canonically label graphs" ++linegraphg_DESCRIPTION = "compute the linegraphs of a file of graphs" ++listg_DESCRIPTION = "display graphs in a variety of forms" ++multig_DESCRIPTION = "generate small multigraphs with given underlying graph" ++newedgeg_DESCRIPTION = "create new edges from pairs of non-adjacent edges in each possible way" ++NRswitchg_DESCRIPTION = "complement vertex edges" ++pickg_DESCRIPTION = "select graphs according to a variety of properties" ++planarg_DESCRIPTION = "test graphs for planarity and find embeddings or obstructions" ++ranlabg_DESCRIPTION = "randomly relabel graphs" ++shortg_DESCRIPTION = "remove isomorphs from a file of graphs" ++showg_DESCRIPTION = "$(shell printf "%s %s" $(listg_DESCRIPTION) "(stand-alone subset of listg)")" ++subdivideg_DESCRIPTION = "compute the subdivision graphs of a file of graphs" ++twohamg_DESCRIPTION = "split quartic graphs into two hamiltonian cycles" ++vcolg_DESCRIPTION = "colour the vertices of graphs in all distinct ways" ++watercluster2_DESCRIPTION = "$(shell printf "%s %s" $(directg_DESCRIPTION) "(faster alternative to directg)")" ++blisstog_DESCRIPTION = "convert files of graphs in bliss format to stdout in sparse6 format" ++checks6_DESCRIPTION = "check a file of graphs and optionally perform corrections" ++sumlines_DESCRIPTION = "sum lines matching specified graph formats" ++ ++dreadnaut_CPPFLAGS = ++addedgeg_CPPFLAGS = ++amtog_CPPFLAGS = ++biplabg_CPPFLAGS = ++catg_CPPFLAGS = ++complg_CPPFLAGS = ++converseg_CPPFLAGS = ++copyg_CPPFLAGS = ++countg_CPPFLAGS = ++cubhamg_CPPFLAGS = ++deledgeg_CPPFLAGS = ++delptg_CPPFLAGS = ++directg_CPPFLAGS = ++dretodot_CPPFLAGS = ++dretog_CPPFLAGS = ++genbg_CPPFLAGS = $(nautyW1_flavour_CPPFLAGS) ++genbgL_CPPFLAGS = $(nautyL1_flavour_CPPFLAGS) -DMAXN1=30 ++geng_CPPFLAGS = $(nautyW1_flavour_CPPFLAGS) ++genquarticg_CPPFLAGS = $(nautyL1_flavour_CPPFLAGS) ++genrang_CPPFLAGS = ++genspecialg_CPPFLAGS = ++gentourng_CPPFLAGS = -DMAXN=24 ++gentreeg_CPPFLAGS = ++hamheuristic_CPPFLAGS = ++labelg_CPPFLAGS = ++linegraphg_CPPFLAGS = ++listg_CPPFLAGS = ++multig_CPPFLAGS = ++newedgeg_CPPFLAGS = ++NRswitchg_CPPFLAGS = ++pickg_CPPFLAGS = ++planarg_CPPFLAGS = ++ranlabg_CPPFLAGS = ++shortg_CPPFLAGS = ++showg_CPPFLAGS = ++subdivideg_CPPFLAGS = ++twohamg_CPPFLAGS = ++vcolg_CPPFLAGS = ++watercluster2_CPPFLAGS = -DMAXN=32 ++blisstog_CPPFLAGS = $(ZLIB_CFLAGS) ++checks6_CPPFLAGS = ++sumlines_CPPFLAGS = $(GMP_CFLAGS) ++ ++dreadnaut_SOURCES = dreadnaut.c ++addedgeg_SOURCES = addedgeg.c ++amtog_SOURCES = amtog.c ++biplabg_SOURCES = biplabg.c ++catg_SOURCES = catg.c ++complg_SOURCES = complg.c ++converseg_SOURCES = converseg.c ++copyg_SOURCES = copyg.c ++countg_SOURCES = testg.c ++cubhamg_SOURCES = cubhamg.c ++deledgeg_SOURCES = deledgeg.c ++delptg_SOURCES = delptg.c ++directg_SOURCES = directg.c ++dretodot_SOURCES = dretodot.c ++dretog_SOURCES = dretog.c ++genbg_SOURCES = genbg.c ++genbgL_SOURCES = genbg.c ++geng_SOURCES = geng.c ++genquarticg_SOURCES = genquarticg.c ++genrang_SOURCES = genrang.c ++genspecialg_SOURCES = genspecialg.c ++gentourng_SOURCES = gentourng.c ++gentreeg_SOURCES = gentreeg.c ++hamheuristic_SOURCES = hamheuristic.c ++labelg_SOURCES = labelg.c ++linegraphg_SOURCES = linegraphg.c ++listg_SOURCES = listg.c ++multig_SOURCES = multig.c ++newedgeg_SOURCES = newedgeg.c ++NRswitchg_SOURCES = NRswitchg.c ++pickg_SOURCES = testg.c ++planarg_SOURCES = planarg.c planarity.c ++ranlabg_SOURCES = ranlabg.c ++shortg_SOURCES = shortg.c ++showg_SOURCES = showg.c ++subdivideg_SOURCES = subdivideg.c ++twohamg_SOURCES = twohamg.c ++vcolg_SOURCES = vcolg.c ++watercluster2_SOURCES = watercluster2.c ++blisstog_SOURCES = blisstog.c ++checks6_SOURCES = checks6.c ++sumlines_SOURCES = sumlines.c ++ ++dreadnaut_LDADD = $(NAUTY_LDADD) ++addedgeg_LDADD = $(NAUTY_LDADD) ++amtog_LDADD = $(NAUTY_LDADD) ++biplabg_LDADD = $(NAUTY_LDADD) ++catg_LDADD = $(NAUTY_LDADD) ++complg_LDADD = $(NAUTY_LDADD) ++converseg_LDADD = $(NAUTY_LDADD) ++copyg_LDADD = $(NAUTY_LDADD) ++countg_LDADD = $(NAUTY_LDADD) ++cubhamg_LDADD = $(NAUTY_LDADD) ++deledgeg_LDADD = $(NAUTY_LDADD) ++delptg_LDADD = $(NAUTY_LDADD) ++directg_LDADD = $(NAUTY_LDADD) ++dretodot_LDADD = $(NAUTY_LDADD) $(LIBM) ++dretog_LDADD = $(NAUTY_LDADD) ++genbg_LDADD = $(NAUTYW1_LDADD) ++genbgL_LDADD = $(NAUTYL1_LDADD) ++geng_LDADD = $(NAUTYW1_LDADD) ++genquarticg_LDADD = $(NAUTYL1_LDADD) ++genrang_LDADD = $(NAUTY_LDADD) ++genspecialg_LDADD = $(NAUTY_LDADD) ++gentourng_LDADD = $(NAUTY_LDADD) ++gentreeg_LDADD = $(NAUTY_LDADD) ++hamheuristic_LDADD = $(NAUTY_LDADD) ++labelg_LDADD = $(NAUTY_LDADD) ++linegraphg_LDADD = $(NAUTY_LDADD) ++listg_LDADD = $(NAUTY_LDADD) ++multig_LDADD = $(NAUTY_LDADD) ++newedgeg_LDADD = $(NAUTY_LDADD) ++NRswitchg_LDADD = $(NAUTY_LDADD) ++pickg_LDADD = $(NAUTY_LDADD) ++planarg_LDADD = $(NAUTY_LDADD) ++ranlabg_LDADD = $(NAUTY_LDADD) ++shortg_LDADD = $(NAUTY_LDADD) ++showg_LDADD = ++subdivideg_LDADD = $(NAUTY_LDADD) ++twohamg_LDADD = $(NAUTY_LDADD) ++vcolg_LDADD = $(NAUTY_LDADD) ++watercluster2_LDADD = $(NAUTY_LDADD) ++blisstog_LDADD = $(NAUTY_LDADD) $(ZLIB_LIBS) ++checks6_LDADD = $(NAUTY_LDADD) ++sumlines_LDADD = $(GMP_LIBS) ++ ++libnauty_la_LD_VERSION_SCRIPT = ++libnautyA1_la_MAP = ++libnautyA1_la_LD_VERSION_SCRIPT = ++libnautyS0_la_MAP = ++libnautyS0_la_LD_VERSION_SCRIPT = ++libnautyS1_la_MAP = ++libnautyS1_la_LD_VERSION_SCRIPT = ++libnautyW0_la_MAP = ++libnautyW0_la_LD_VERSION_SCRIPT = ++libnautyW1_la_MAP = ++libnautyW1_la_LD_VERSION_SCRIPT = ++libnautyL0_la_MAP = ++libnautyL0_la_LD_VERSION_SCRIPT = ++libnautyL1_la_MAP = ++libnautyL1_la_LD_VERSION_SCRIPT = ++if HAVE_LD_VERSION_SCRIPT ++libnauty_la_LD_VERSION_SCRIPT += -Wl,--version-script=$(top_srcdir)/nauty.map ++libnautyA1_la_MAP += nautyA1.map ++libnautyA1_la_LD_VERSION_SCRIPT += -Wl,--version-script=$(top_builddir)/$(libnautyA1_la_MAP) ++libnautyS0_la_MAP += nautyS0.map ++libnautyS0_la_LD_VERSION_SCRIPT += -Wl,--version-script=$(top_builddir)/$(libnautyS0_la_MAP) ++libnautyS1_la_MAP += nautyS1.map ++libnautyS1_la_LD_VERSION_SCRIPT += -Wl,--version-script=$(top_builddir)/$(libnautyS1_la_MAP) ++libnautyW0_la_MAP += nautyW0.map ++libnautyW0_la_LD_VERSION_SCRIPT += -Wl,--version-script=$(top_builddir)/$(libnautyW0_la_MAP) ++libnautyW1_la_MAP += nautyW1.map ++libnautyW1_la_LD_VERSION_SCRIPT += -Wl,--version-script=$(top_builddir)/$(libnautyW1_la_MAP) ++libnautyL0_la_MAP += nautyL0.map ++libnautyL0_la_LD_VERSION_SCRIPT += -Wl,--version-script=$(top_builddir)/$(libnautyL0_la_MAP) ++libnautyL1_la_MAP += nautyL1.map ++libnautyL1_la_LD_VERSION_SCRIPT += -Wl,--version-script=$(top_builddir)/$(libnautyL1_la_MAP) ++endif ++ ++libnauty_la_LIBADD = $(threadlib) ++libnauty_la_LDFLAGS = -version-info $(LIBNAUTY_LT_VERSION) $(libnauty_la_LD_VERSION_SCRIPT) ++ ++libnauty_la_SOURCES = \ ++ nauty.c \ ++ nautil.c \ ++ nausparse.c \ ++ naugraph.c \ ++ naurng.c \ ++ schreier.c \ ++ traces.c \ ++ gtools.c \ ++ naututil.c \ ++ nautinv.c \ ++ gutil1.c \ ++ gutil2.c \ ++ gtnauty.c \ ++ naugroup.c ++ ++libnautyA1_la_DEPENDENCIES = $(libnautyA1_la_MAP) ++libnautyA1_la_CPPFLAGS = $(nautyA1_flavour_CPPFLAGS) ++libnautyA1_la_LIBADD = $(threadlib) ++libnautyA1_la_LDFLAGS = -version-info $(LIBNAUTY_LT_VERSION) $(libnautyA1_la_LD_VERSION_SCRIPT) ++libnautyA1_la_SOURCES =$(libnauty_la_SOURCES) ++ ++libnautyS0_la_DEPENDENCIES = $(libnautyS0_la_MAP) ++libnautyS0_la_CPPFLAGS = $(nautyS0_flavour_CPPFLAGS) ++libnautyS0_la_LIBADD = $(threadlib) ++libnautyS0_la_LDFLAGS = -version-info $(LIBNAUTY_LT_VERSION) $(libnautyS0_la_LD_VERSION_SCRIPT) ++libnautyS0_la_SOURCES =$(libnauty_la_SOURCES) ++ ++libnautyS1_la_DEPENDENCIES = $(libnautyS1_la_MAP) ++libnautyS1_la_CPPFLAGS = $(nautyS1_flavour_CPPFLAGS) ++libnautyS1_la_LIBADD = $(threadlib) ++libnautyS1_la_LDFLAGS = -version-info $(LIBNAUTY_LT_VERSION) $(libnautyS1_la_LD_VERSION_SCRIPT) ++libnautyS1_la_SOURCES =$(libnauty_la_SOURCES) ++ ++libnautyW0_la_DEPENDENCIES = $(libnautyW0_la_MAP) ++libnautyW0_la_CPPFLAGS = $(nautyW0_flavour_CPPFLAGS) ++libnautyW0_la_LIBADD = $(threadlib) ++libnautyW0_la_LDFLAGS = -version-info $(LIBNAUTY_LT_VERSION) $(libnautyW0_la_LD_VERSION_SCRIPT) ++libnautyW0_la_SOURCES =$(libnauty_la_SOURCES) ++ ++libnautyW1_la_DEPENDENCIES = $(libnautyW1_la_MAP) ++libnautyW1_la_CPPFLAGS = $(nautyW1_flavour_CPPFLAGS) ++libnautyW1_la_LIBADD = $(threadlib) ++libnautyW1_la_LDFLAGS = -version-info $(LIBNAUTY_LT_VERSION) $(libnautyW1_la_LD_VERSION_SCRIPT) ++libnautyW1_la_SOURCES =$(libnauty_la_SOURCES) ++ ++libnautyL0_la_DEPENDENCIES = $(libnautyL0_la_MAP) ++libnautyL0_la_CPPFLAGS = $(nautyL0_flavour_CPPFLAGS) ++libnautyL0_la_LIBADD = $(threadlib) ++libnautyL0_la_LDFLAGS = -version-info $(LIBNAUTY_LT_VERSION) $(libnautyL0_la_LD_VERSION_SCRIPT) ++libnautyL0_la_SOURCES =$(libnauty_la_SOURCES) ++ ++libnautyL1_la_DEPENDENCIES = $(libnautyL1_la_MAP) ++libnautyL1_la_CPPFLAGS = $(nautyL1_flavour_CPPFLAGS) ++libnautyL1_la_LIBADD = $(threadlib) ++libnautyL1_la_LDFLAGS = -version-info $(LIBNAUTY_LT_VERSION) $(libnautyL1_la_LD_VERSION_SCRIPT) ++libnautyL1_la_SOURCES =$(libnauty_la_SOURCES) ++ ++dreadtest_CPPFLAGS = $(dreadnaut_CPPFLAGS) -DDREADTEST ++dreadtest1_CPPFLAGS = $(dreadtest_CPPFLAGS) $(nautyA1_flavour_CPPFLAGS) ++dreadtestS_CPPFLAGS = $(dreadtest_CPPFLAGS) $(nautyS0_flavour_CPPFLAGS) ++dreadtestS1_CPPFLAGS = $(dreadtest_CPPFLAGS) $(nautyS1_flavour_CPPFLAGS) ++dreadtestW_CPPFLAGS = $(dreadtest_CPPFLAGS) $(nautyW0_flavour_CPPFLAGS) ++dreadtestW1_CPPFLAGS = $(dreadtest_CPPFLAGS) $(nautyW1_flavour_CPPFLAGS) ++dreadtestL_CPPFLAGS = $(dreadtest_CPPFLAGS) $(nautyL0_flavour_CPPFLAGS) ++dreadtestL1_CPPFLAGS = $(dreadtest_CPPFLAGS) $(nautyL1_flavour_CPPFLAGS) ++dreadtest4K_CPPFLAGS = $(dreadtest_CPPFLAGS) -DMAXN=4096 ++ ++dreadtest_SOURCES = $(dreadnaut_SOURCES) ++dreadtest1_SOURCES = $(dreadnaut_SOURCES) ++dreadtestS1_SOURCES = $(dreadnaut_SOURCES) ++dreadtestS_SOURCES = $(dreadnaut_SOURCES) ++dreadtestW_SOURCES = $(dreadnaut_SOURCES) ++dreadtestW1_SOURCES = $(dreadnaut_SOURCES) ++dreadtestL_SOURCES = $(dreadnaut_SOURCES) ++dreadtestL1_SOURCES = $(dreadnaut_SOURCES) ++dreadtest4K_SOURCES = $(dreadnaut_SOURCES) $(libnauty_la_SOURCES) ++ ++dreadtest_LDADD = $(NAUTY_LDADD) ++dreadtest1_LDADD = $(top_builddir)/libnautyA1.la $(threadlib) ++dreadtestS_LDADD = $(top_builddir)/libnautyS0.la $(threadlib) ++dreadtestS1_LDADD = $(top_builddir)/libnautyS1.la $(threadlib) ++dreadtestW_LDADD = $(top_builddir)/libnautyW0.la $(threadlib) ++dreadtestW1_LDADD = $(top_builddir)/libnautyW1.la $(threadlib) ++dreadtestL_LDADD = $(top_builddir)/libnautyL0.la $(threadlib) ++dreadtestL1_LDADD = $(top_builddir)/libnautyL1.la $(threadlib) ++dreadtest4K_LDADD = $(threadlib) ++ ++CLEANFILES = \ ++ $(man_MANS) \ ++ $(libnautyA1_la_MAP) \ ++ $(libnautyS0_la_MAP) \ ++ $(libnautyS1_la_MAP) \ ++ $(libnautyW0_la_MAP) \ ++ $(libnautyW1_la_MAP) \ ++ $(libnautyL0_la_MAP) \ ++ $(libnautyL1_la_MAP) \ ++ runtest-*.data \ ++ runtest-*.atad +--- /dev/null ++++ b/m4/ld-version-script.m4 +@@ -0,0 +1,53 @@ ++# ld-version-script.m4 serial 3 ++dnl Copyright (C) 2008-2012 Free Software Foundation, Inc. ++dnl This file is free software; the Free Software Foundation ++dnl gives unlimited permission to copy and/or distribute it, ++dnl with or without modifications, as long as this notice is preserved. ++ ++dnl From Simon Josefsson ++ ++# FIXME: The test below returns a false positive for mingw ++# cross-compiles, 'local:' statements does not reduce number of ++# exported symbols in a DLL. Use --disable-ld-version-script to work ++# around the problem. ++ ++# gl_LD_VERSION_SCRIPT ++# -------------------- ++# Check if LD supports linker scripts, and define automake conditional ++# HAVE_LD_VERSION_SCRIPT if so. ++AC_DEFUN([gl_LD_VERSION_SCRIPT], ++[ ++ AC_ARG_ENABLE([ld-version-script], ++ AS_HELP_STRING([--enable-ld-version-script], ++ [enable linker version script (default is enabled when possible)]), ++ [have_ld_version_script=$enableval], []) ++ if test -z "$have_ld_version_script"; then ++ AC_MSG_CHECKING([if LD -Wl,--version-script works]) ++ save_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" ++ cat > conftest.map < conftest.map <$out2 >$out1 ++ ++if [ -d $top_workingdir/.libs ]; then ++ sed -i 's@'$top_workingdir'/.libs/lt-@./@' $out2 ++fi ++ + LC_COLLATE=C sort $out2 >>$out1 + if ./naucompare "$out1" "$ok" ; then + rm $out1 $out2 +--- /dev/null ++++ b/nauty.map +@@ -0,0 +1,279 @@ ++LIBNAUTY_2.5 { ++global: ++## nauty.h ++labelorg; ++nauty_kill_request; ++alloc_error; ++breakout; ++cheapautom; ++doref; ++extra_autom; ++extra_level; ++isautom; ++dispatch_graph; ++itos; ++fmperm; ++fmptn; ++longprune; ++nauty; ++maketargetcell; ++nextelement; ++orbjoin; ++permset; ++putstring; ++refine; ++refine1; ++shortprune; ++targetcell; ++testcanlab; ++updatecan; ++writeperm; ++nauty_freedyn; ++nauty_check; ++naugraph_check; ++nautil_check; ++nautil_freedyn; ++naugraph_freedyn; ++densenauty; ++writegroupsize; ++## nautinv.h ++adjacencies; ++adjtriang; ++cellcliq; ++cellfano; ++cellfano2; ++cellind; ++cellquads; ++cellquins; ++celltrips; ++cellstarts; ++cliques; ++distances; ++getbigcells; ++indsets; ++nautinv_check; ++nautinv_freedyn; ++quadruples; ++refinvar; ++setnbhd; ++triples; ++twopaths; ++## naurng.h ++ran_init; ++ran_nextran; ++## nausparse.h ++dispatch_sparse; ++targetcell_sg; ++cheapautom_sg; ++isautom_sg; ++refine_sg; ++testcanlab_sg; ++updatecan_sg; ++testcanlab_tr; ++comparelab_tr; ++updatecan_tr; ++init_sg; ++nausparse_freedyn; ++nausparse_check; ++nauty_to_sg; ++sg_to_nauty; ++sortlists_sg; ++aresame_sg; ++put_sg; ++copy_sg; ++distvals; ++sparsenauty; ++adjacencies_sg; ++distances_sg; ++## naututil.h ++complement; ++converse; ++converse_sg; ++copycomment; ++complement_sg; ++countcells; ++flushline; ++fixit; ++getint; ++getint_sl; ++hash; ++hashgraph; ++hashgraph_sg; ++individualise; ++listhash; ++mathon; ++mathon_sg; ++naututil_check; ++naututil_freedyn; ++putcanon; ++putcanon_sg; ++putdegs; ++putdegs_sg; ++putdegseq; ++putdegseq_sg; ++putgraph; ++putgraph_sg; ++putmapping; ++putorbits; ++putorbitsplus; ++putptn; ++putquotient; ++putquotient_sg; ++putset; ++putset_firstbold; ++rangraph; ++rangraph2; ++rangraph2_sg; ++ranreg_sg; ++ranperm; ++readgraph; ++readgraph_sg; ++readgraph_swg; ++readinteger; ++readinteger_sl; ++readperm; ++readptn; ++readvperm; ++readstring; ++relabel; ++relabel_sg; ++sethash; ++setinter; ++setsize; ++sublabel; ++sublabel_sg; ++subpartition; ++unitptn; ++## naugroup.h ++freepermrec; ++groupptr; ++newpermrec; ++groupautomproc; ++grouplevelproc; ++makecosetreps; ++permcycles; ++allgroup; ++allgroup2; ++allgroup3; ++freegroup; ++## schreier.h ++freeschreier; ++addpermutation; ++findpermutation; ++addgenerator; ++condaddgenerator; ++expandschreier; ++getorbits; ++getorbitsmin; ++pruneset; ++newgroup; ++schreier_freedyn; ++schreier_fails; ++dumpschreier; ++schreier_gens; ++deleteunmarked; ++grouporder; ++schreier_check; ++## traces.h ++Traces; ++refine_tr; ++traces_freedyn; ++## gtools.h ++gtools_check; ++opengraphfile; ++writeline; ++gtools_getline; ++graphsize; ++encodegraphsize; ++stringcounts; ++stringtograph; ++stringtograph_inc; ++edgecount; ++checkgline; ++readgg; ++readg; ++readgg_inc; ++readg_inc; ++ntog6; ++ntos6; ++ntod6; ++sgtos6; ++sgtog6; ++sgtod6; ++writeg6; ++writed6; ++writes6; ++writeg6_sg; ++writes6_sg; ++writed6_sg; ++ntois6; ++writeis6; ++writepc_sg; ++stringtosparsegraph; ++read_sg; ++read_sg_loops; ++read_sgg_loops; ++readpc_sg; ++readpcle_sg; ++getecline; ++writelast; ++longval; ++arg_int; ++arg_long; ++arg_range; ++doublevalue; ++arg_double; ++arg_doublerange; ++arg_sequence; ++writerange; ++gt_abort; ++stringcopy; ++strhaschar; ++fcanonise; ++fcanonise_inv; ++fcanonise_inv_sg; ++setlabptn; ++fgroup; ++fgroup_inv; ++istransitive; ++tg_canonise; ++readg_code; ++readg_line; ++ogf_linelen; ++is_pipe; ++gt_numorbits; ++## gutils.h ++degstats; ++degstats2; ++diamstats; ++find_dist; ++find_dist2; ++girth; ++isbiconnected1; ++isbiconnected; ++isbipartite; ++bipartiteside; ++twocolouring; ++isconnected1; ++isconnected; ++issubconnected; ++maxcliques; ++loopcount; ++pathcount1; ++cyclecount1; ++cyclecount; ++indpathcount1; ++indcyclecount1; ++indcyclecount; ++commonnbrs; ++contract1; ++cstarcontent; ++numtriangles1; ++numtriangles; ++numdirtriangles; ++delete1; ++conncontent; ++stronglyconnected; ++ ++local: *; ++}; +--- /dev/null ++++ b/m4/gmp.m4 +@@ -0,0 +1,168 @@ ++dnl Configure paths for GMP ++dnl Based on macros by Owen Taylor. ++dnl Hans Petter Jansson 2001-04-29 ++dnl Modified slightly by Allin Cottrell, April 2003 ++dnl modified by Jerome Benoit 2013/11/26 ++ ++dnl AM_PATH_GMP([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) ++dnl Test for GMP, and define GMP_CFLAGS and GMP_LIBS. ++dnl ++AC_DEFUN([AM_PATH_GMP], ++[dnl ++ ++ AC_ARG_WITH([gmp], ++ [AS_HELP_STRING([--without-gmp],[Disable support for GMP])], ++ [],[with_gmp=yes]) ++ ++ AC_MSG_CHECKING(whether GMP is disabled) ++ if test x"$with_gmp" != xno ; then ++ ++ AC_MSG_RESULT(no) ++ ++ AC_ARG_WITH(gmp-prefix,[ --with-gmp-prefix=PFX Prefix where GMP is installed (optional)], ++ gmp_config_prefix="$withval", gmp_config_prefix="") ++ ++ if test x$gmp_config_prefix != x ; then ++ gmp_config_args="$gmp_config_args --prefix=$gmp_config_prefix" ++ fi ++ ++ min_gmp_version=ifelse([$1], ,1.0.0,$1) ++ ++ AC_MSG_CHECKING(for GMP - version >= $min_gmp_version) ++ ++ GMP_CFLAGS="-I$gmp_config_prefix/include" ++ GMP_LIBS="-L$gmp_config_prefix/lib -lgmp" ++ ++ ac_save_CFLAGS="$CFLAGS" ++ ac_save_LIBS="$LIBS" ++ CFLAGS="$CFLAGS $GMP_CFLAGS" ++ LIBS="$GMP_LIBS $LIBS" ++ ++dnl ++dnl Now check if the installed GMP is sufficiently new. ++dnl ++ rm -f conf.gmptest ++ AC_TRY_RUN([ ++#include ++#include ++#include ++#include ++ ++int ++main () ++{ ++ int gmp_major_version = 0, gmp_minor_version = 0, gmp_micro_version = 0; ++ int major, minor, micro; ++ char *tmp_version; ++ mpz_t a, b, c; ++ ++ mpz_init (a); ++ mpz_init (b); ++ mpz_init (c); ++ mpz_mul (c, a, b); ++ ++ system ("touch conf.gmptest"); ++ ++#ifdef __GNU_MP_VERSION ++ gmp_major_version = __GNU_MP_VERSION; ++#endif ++ ++#ifdef __GNU_MP_VERSION_MINOR ++ gmp_minor_version = __GNU_MP_VERSION_MINOR; ++#endif ++ ++#ifdef __GNU_MP_VERSION_PATCHLEVEL ++ gmp_micro_version = __GNU_MP_VERSION_PATCHLEVEL; ++#endif ++ ++ /* HP/UX 9 (%@#!) writes to sscanf strings */ ++ tmp_version = strdup("$min_gmp_version"); ++ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { ++ printf("%s, bad version string\n", "$min_gmp_version"); ++ exit(1); ++ } ++ ++ if ((gmp_major_version > major) || ++ ((gmp_major_version == major) && (gmp_minor_version > minor)) || ++ ((gmp_major_version == major) && (gmp_minor_version == minor) && (gmp_micro_version >= micro))) ++ { ++ return 0; ++ } ++ else ++ { ++ printf("\n*** An old version of GNU MP (%d.%d.%d) was found.\n", ++ gmp_major_version, gmp_minor_version, gmp_micro_version); ++ printf("*** You need a version of GNU MP newer than %d.%d.%d. The latest version of\n", ++ major, minor, micro); ++ ++ printf("*** GNU MP is always available from http://gmplib.org.\n"); ++ printf("***\n"); ++ } ++ ++ return 1; ++} ++],, no_gmp=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) ++ CFLAGS="$ac_save_CFLAGS" ++ LIBS="$ac_save_LIBS" ++ ++ if test "x$no_gmp" = x ; then ++ AC_MSG_RESULT(yes) ++ ifelse([$2], , :, [$2]) ++ else ++ AC_MSG_RESULT(no) ++ if test -f conf.gmptest ; then ++ : ++ else ++ echo "*** Could not run GNU MP test program, checking why..." ++ CFLAGS="$CFLAGS $GMP_CFLAGS" ++ LIBS="$LIBS $GMP_LIBS" ++ AC_TRY_LINK([ ++#include ++#include ++], [ return (1); ], ++ [ echo "*** The test program compiled, but did not run. This usually means" ++ echo "*** that the run-time linker is not finding GNU MP or finding the wrong" ++ echo "*** version of GNU MP. If it is not finding GNU MP, you'll need to set your" ++ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" ++ echo "*** to the installed location. Also, make sure you have run ldconfig if that" ++ echo "*** is required on your system" ++ echo "***" ++ echo "*** If you have an old version installed, it is best to remove it, although" ++ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ++ echo "***" ], ++ [ echo "*** The test program failed to compile or link. See the file config.log for the" ++ echo "*** exact error that occured. This usually means GNU MP was incorrectly installed" ++ echo "*** or that you have moved GNU MP since it was installed." ]) ++ CFLAGS="$ac_save_CFLAGS" ++ LIBS="$ac_save_LIBS" ++ fi ++ GMP_CFLAGS="" ++ GMP_LIBS="" ++ ifelse([$3], , :, [$3]) ++ fi ++ if test "$GMP_CFLAGS" = "-I/include" ; then ++ GMP_CFLAGS="" ++ fi ++ if test "$GMP_LIBS" = "-L/lib -lgmp" ; then ++ GMP_LIBS="-lgmp" ++ fi ++ ++ rm -f conf.gmptest ++ ++ else ++ ++ AC_MSG_RESULT(yes) ++ ++ AC_DEFINE([WITHOUT_GMP],[1],[GMP is disabled]) ++ ++ GMP_CFLAGS="" ++ GMP_LIBS="" ++ ++ fi ++ ++ AC_SUBST(GMP_CFLAGS) ++ AC_SUBST(GMP_LIBS) ++ ++ AM_CONDITIONAL([WITH_GMP_IS_YES],[test x"$with_gmp" != xno]) ++ ++]) +--- a/gtools-h.in ++++ b/gtools-h.in +@@ -60,8 +60,8 @@ + This twisted expression works up to n=160529 in 32-bit arithmetic + and for larger n if size_t has 64 bits. */ + +-#include "naututil.h" /* which includes stdio.h */ +-#include "nausparse.h" ++#include /* which includes stdio.h */ ++#include + + #if HAVE_ERRNO_H + #include +--- a/naugroup.h ++++ b/naugroup.h +@@ -3,7 +3,10 @@ + Procedures for handling groups found by nauty. + */ + +-#include "nauty.h" ++#ifndef _NAUGROUP_H_ /* only process this file once */ ++#define _NAUGROUP_H_ ++ ++#include + + typedef struct perm_struct + { +@@ -53,3 +56,5 @@ + #ifdef __cplusplus + } + #endif ++ ++#endif /* _NAUGROUP_H_ */ +--- a/naurng.h ++++ b/naurng.h +@@ -11,8 +11,10 @@ + random number 0..k-1. + */ + +-#ifndef NAURNG_H +-#include "nauty.h" ++#ifndef _NAURNG_H_ /* only process this file once */ ++#define _NAURNG_H_ ++ ++#include + + #ifdef __cplusplus + extern "C" { +@@ -36,5 +38,4 @@ + var = __getkran % (k);} + #define INITRANBYTIME ran_init((long)time(NULL)) + +-#define NAURNG_H +-#endif ++#endif /* _NAURNG_H_ */ +--- a/nausparse.h ++++ b/nausparse.h +@@ -23,7 +23,7 @@ + #ifndef _NAUSPARSE_H_ /* only process this file once */ + #define _NAUSPARSE_H_ + +-#include "nauty.h" ++#include + + #ifndef SG_WEIGHT + #define SG_WEIGHT int +@@ -125,4 +125,4 @@ + } + #endif + +-#endif ++#endif /* _NAUSPARSE_H_ */ +--- a/nautinv.h ++++ b/nautinv.h +@@ -10,7 +10,10 @@ + * * + *****************************************************************************/ + +-#include "nauty.h" /* which includes stdio.h */ ++#ifndef _NAUTINV_H_ /* only process this file once */ ++#define _NAUTINV_H_ ++ ++#include /* which includes stdio.h */ + + #ifdef __cplusplus + extern "C" { +@@ -40,3 +43,5 @@ + #ifdef __cplusplus + } + #endif ++ ++#endif /* _NAUTINV_H_ */ +--- a/naututil-h.in ++++ b/naututil-h.in +@@ -115,9 +115,13 @@ + * * + *****************************************************************************/ + +-#include "nauty.h" /* which includes stdio.h */ +-#include "nausparse.h" +-#include "naurng.h" ++#ifndef _NAUTUTIL_H_ /* only process this file once */ ++#define _NAUTUTIL_H_ ++ ++#include /* which includes stdio.h */ ++#include ++#include ++ + /* At this point we can assume that , , , + , or and if necessary have + been included if they exist. */ +@@ -287,3 +291,5 @@ + #endif /*NAUTY_SEED_DEFINED*/ + + /* @edit_msg@ */ ++ ++#endif /* _NAUTUTIL_H_ */ +--- a/schreier.h ++++ b/schreier.h +@@ -3,8 +3,8 @@ + #ifndef _SCHREIER_H_ /* only process this file once */ + #define _SCHREIER_H_ + +-#include "nauty.h" +-#include "naurng.h" ++#include ++#include + + typedef struct permnodestruct + { +--- /dev/null ++++ b/nauty/Makefile.am +@@ -0,0 +1,29 @@ ++ ++header-links: remove-links ++ HEADERLIST=" \ ++ $(top_builddir)/nauty.h \ ++ $(top_builddir)/naututil.h \ ++ $(top_builddir)/gtools.h \ ++ $(top_srcdir)/nautinv.h \ ++ $(top_srcdir)/naurng.h \ ++ $(top_srcdir)/nausparse.h \ ++ $(top_srcdir)/naugroup.h \ ++ $(top_srcdir)/schreier.h \ ++ $(top_srcdir)/traces.h \ ++ $(top_srcdir)/gutils.h \ ++ "; \ ++ for h in $$HEADERLIST; do \ ++ BASENAME=`basename $$h`; \ ++ test -e $$BASENAME || $(LN_S) $$h $$BASENAME; \ ++ done ++ ++remove-links: ++ rm -f nauty.h nautinv.h naurng.h nausparse.h naututil.h naugroup.h schreier.h traces.h gtools.h gutils.h ++ ++all-local: header-links ++ ++clean-local: remove-links ++ ++distclean-local: remove-links ++ -rm -f Makefile ++ +--- /dev/null ++++ b/nauty.pc.in +@@ -0,0 +1,12 @@ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++libdir=@libdir@ ++includedir=@includedir@ ++ ++Name: nauty ++Description: nauty graph automorphism library ++Version: @PACKAGE_VERSION@ ++URL: @PACKAGE_URL@ ++Libs: -L${libdir} -l@PACKAGE@ ++Libs.private: @threadlib@ ++Cflags: -I${includedir} +--- /dev/null ++++ b/m4/zlib.m4 +@@ -0,0 +1,28 @@ ++dnl Configure paths for zlib ++dnl Jerome Benoit 2013/11/26 ++ ++AC_DEFUN([AM_PATH_ZLIB], ++[dnl ++ AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl ++dnl AC_REQUIRE([PKG_CHECK_MODULES])dnl ++ ++ AC_ARG_WITH([zlib], ++ [AS_HELP_STRING([--without-zlib],[disable support for ZLIB])], ++ [],[with_zlib=yes]) ++ ++ AC_MSG_CHECKING([whether ZLIB is disabled]) ++ AS_IF([test x"$with_zlib" != "xno"],[dnl then ++ AC_MSG_RESULT(no) ++ PKG_CHECK_MODULES(ZLIB,zlib >= $1,[$2],[$3]) ++ ],[dnl else ++ AC_MSG_RESULT(yes) ++ AC_DEFINE([WITHOUT_ZLIB],[1],[ZLIB is disabled]) ++ ZLIB_CFLAGS="" ++ ZLIB_LIBS="" ++ AC_SUBST(ZLIB_CFLAGS) ++ AC_SUBST(ZLIB_LIBS) ++ ]) ++ ++ AM_CONDITIONAL([WITH_ZLIB_IS_YES],[test x"$with_zlib" != xno]) ++ ++]) +--- a/traces.h ++++ b/traces.h +@@ -22,6 +22,9 @@ + * 28-Jan-16 : version ready for nauty and Traces v.2.6 distribution * + *****************************************************************************/ + ++#ifndef _TRACES_H_ /* only process this file once */ ++#define _TRACES_H_ ++ + #include "gtools.h" + #include "schreier.h" + +@@ -61,3 +64,5 @@ + TracesStats*,sparsegraph*); + extern void refine_tr(sparsegraph*,int*,int*,int*,int*,TracesOptions*); + extern void traces_freedyn(void); ++ ++#endif /* _TRACES_H_ */ +--- a/gutils.h ++++ b/gutils.h +@@ -1,5 +1,8 @@ + /* gutils.h - procedure declarations for gutil1.c and gutil2.c */ + ++#ifndef _GUTILS_H_ /* only process this file once */ ++#define _GUTILS_H_ ++ + #ifdef __cplusplus + extern "C" { + #endif +@@ -44,3 +47,5 @@ + #ifdef __cplusplus + } + #endif ++ ++#endif /* _GUTILS_H_ */ diff --git a/nauty-fix-gt_numorbits.patch b/nauty-fix-gt_numorbits.patch new file mode 100644 index 0000000..b708e36 --- /dev/null +++ b/nauty-fix-gt_numorbits.patch @@ -0,0 +1,36 @@ +Description: explicit extern declaration for gt_numorbits +Origin: debian +Author: Jerome Benoit +Last-Update: 2013-11-22 + +--- a/labelg.c ++++ b/labelg.c +@@ -88,7 +88,6 @@ + + static nauty_counter orbtotal; + static double unorbtotal; +-extern int gt_numorbits; + + /**************************************************************************/ + +--- a/gtools-h.in ++++ b/gtools-h.in +@@ -273,6 +273,7 @@ + extern TLS_ATTR char *readg_line; + extern TLS_ATTR size_t ogf_linelen; + extern TLS_ATTR boolean is_pipe; ++extern TLS_ATTR int gt_numorbits; + + #ifdef __cplusplus + } +--- a/gtnauty.c ++++ b/gtnauty.c +@@ -18,7 +18,7 @@ + static int fuzz2[] = {006532,070236,035523,062437}; + #define FUZZ2(x) ((x) ^ fuzz2[(x)&3]) + +-int gt_numorbits; ++TLS_ATTR int gt_numorbits; + + #ifdef REFINE + void REFINE(graph*,int*,int*,int,int*,int*,set*,int*,int,int); diff --git a/nauty-fix-include-extern.patch b/nauty-fix-include-extern.patch new file mode 100644 index 0000000..8a53ad3 --- /dev/null +++ b/nauty-fix-include-extern.patch @@ -0,0 +1,18 @@ +Description: explicit extern declaration in naurng.h +Origin: debian +Author: Jerome Benoit +Last-Update: 2013-11-22 + +--- a/naurng.h ++++ b/naurng.h +@@ -18,8 +18,8 @@ + extern "C" { + #endif + +-void ran_init(long seed); +-long ran_nextran(void); ++extern void ran_init(long seed); ++extern long ran_nextran(void); + + #ifdef __cplusplus + } diff --git a/nauty-help2man.patch b/nauty-help2man.patch new file mode 100644 index 0000000..22de855 --- /dev/null +++ b/nauty-help2man.patch @@ -0,0 +1,389 @@ +Description: format usages and helps + Attempt to format usages and helps of the invited + programs wrt to the original gtools. +Origin: debian +Author: Jerome Benoit +Last-Update: 2016-03-19 + +--- a/watercluster2.c ++++ b/watercluster2.c +@@ -1,54 +1,58 @@ + // cc -O4 -o water2 -DWORDSIZE=32 -DMAXN=WORDSIZE nauty.c naugraph.c nautil.c gtools.c schreier.c naurng.c watercluster2.c + +-/* +-Reads graphs in g6 code or multicode (optional) from stdin and directs them +- +-options: +- +-ix means: the indegree of every vertex may be at most x. +- +-oy means: the outdegree of every vertex may be at most y. +- +- S means: allow that for every pair of vertices x,y at most one of the edges x-->y +- and y-->x may be present. By default both of them may be present in the same graph. +- +- +- T means: Output directed graphs in T-code. This is a simple ASCII output format. Every line +- contains one graph. First the number of vertices, then the number of +- directed edges and then the list of directed edges with the start first +- and the end then. E.g.: 3 2 0 1 2 1 means 3 vertices, 2 directed edges: +- 0-->1 and 2-->1 +- +- B means: Output the directed graphs in a binary code. Every item of the code is an unsigned +- char. The first unsigned char is the number nv of vertices. The vertices are numbered 1..nv +- Then the list of vertices x for which there is a directed edge 1->x follow. This list is +- ended by a 0. Then the list of outgoing neighbours of 2 follows -- again ended with a 0, etc. +- The code is complete with the 0 ending the list of outgoing neighbours of nv. +- +- C means: Do really construct all the directed graphs in memory, but don't output them. This is not +- a big difference in case of restricted in- and outdegrees, because all that is done extra is that +- edges are directed instead of just keeping track of in- and out-degrees. This option is intended only +- for testing purposes to test also routines that are normally not used when counting. Things that would +- speed up the counting also in some cases of restricted in- and out-degrees -- like multiplying the +- possibilities of assigning directions to edges that can be assigned directions independent +- of each other (depending on the degrees of the endvertices and overlaps) -- are not included. +- In case of not restrictive bounds on the in- and out-degree it not really constructing the graphs +- can be considerably faster. In cases of restricted in- and out-degrees the only difference is that +- the graph isn't modified... +- The fact that in case of no output the graph is not modified is mainly to save time for the one +- case of waterclusters, where large numbers were determined. If large numbers (without output) +- for other cases shall be determined, one should think about adding the multiplication routines. +- +- m read multicode +- +-This program uses different labelling routines -- all based on the ideas of +- +-G. Brinkmann, Generating water clusters and other directed graphs, +-Journal of Mathematical Chemistry 46, 1112--1121 (2009) ++#define GTOOL_USAGEHELP_COMPATIBILITY + +-October 10, 2011: corrected error caused by overflow of 32bit int used as hashvalue. ++#define USAGE "watercluster2 [ix] [oy] [S] [T] [B] [C] [m]" + +-Sep, 2012: PROCESS feature added by BDM. ++#define HELPTEXT \ ++" Reads graphs in g6 code or multicode (optional) from stdin and directs them\n\ ++\n\ ++ ix : the indegree of every vertex may be at most x.\n\ ++ The default maximum indegree is unlimited.\n\ ++\n\ ++ oy : the outdegree of every vertex may be at most y.\n\ ++ The default maximum outdegree is unlimited.\n\ ++\n\ ++ S : allow that for every pair of vertices x,y at most one of the edges x-->y\n\ ++ and y-->x may be present. By default both of them may be present in the same graph.\n\ ++\n\ ++\n\ ++ T : Output directed graphs in T-code. This is a simple ASCII output format. Every line\n\ ++ contains one graph. First the number of vertices, then the number of\n\ ++ directed edges and then the list of directed edges with the start first\n\ ++ and the end then. E.g.: 3 2 0 1 2 1 means 3 vertices, 2 directed edges:\n\ ++ 0-->1 and 2-->1\n\ ++\n\ ++ B : Output the directed graphs in a binary code. Every item of the code is an unsigned\n\ ++ char. The first unsigned char is the number nv of vertices. The vertices are numbered 1..nv\n\ ++ Then the list of vertices x for which there is a directed edge 1->x follow. This list is\n\ ++ ended by a 0. Then the list of outgoing neighbours of 2 follows -- again ended with a 0, etc.\n\ ++ The code is complete with the 0 ending the list of outgoing neighbours of nv.\n\ ++\n\ ++ C : Do really construct all the directed graphs in memory, but don't output them. This is not\n\ ++ a big difference in case of restricted in- and outdegrees, because all that is done extra is that\n\ ++ edges are directed instead of just keeping track of in- and out-degrees. This option is intended only\n\ ++ for testing purposes to test also routines that are normally not used when counting. Things that would\n\ ++ speed up the counting also in some cases of restricted in- and out-degrees -- like multiplying the\n\ ++ possibilities of assigning directions to edges that can be assigned directions independent\n\ ++ of each other (depending on the degrees of the endvertices and overlaps) -- are not included.\n\ ++ In case of not restrictive bounds on the in- and out-degree it not really constructing the graphs\n\ ++ can be considerably faster. In cases of restricted in- and out-degrees the only difference is that\n\ ++ the graph isn't modified...\n\ ++ The fact that in case of no output the graph is not modified is mainly to save time for the one\n\ ++ case of waterclusters, where large numbers were determined. If large numbers (without output)\n\ ++ for other cases shall be determined, one should think about adding the multiplication routines.\n\ ++\n\ ++ m : read multicode instead of g6 code\n\ ++\n\ ++This program uses different labelling routines -- all based on the ideas of\n\ ++\n\ ++G. Brinkmann, Generating water clusters and other directed graphs,\n\ ++Journal of Mathematical Chemistry 46, 1112--1121 (2009)\n" ++/* ++ * October 10, 2011: corrected error caused by overflow of 32bit int used as hashvalue. ++ * ++ * Sep, 2012: PROCESS feature added by BDM. + */ + + /* PROCESS feature +@@ -67,7 +71,7 @@ + * + * If SUMMARY is defined, it must expand as the name of a procedure + * with prototype void SUMMARY(void). It is called at the end after +- * the normal summary. ++ * the normal summary. + */ + + //#include +@@ -500,7 +504,7 @@ + return 1; + } + +- ++#ifndef GTOOL_USAGEHELP_COMPATIBILITY + void usage(char name[]) + { + +@@ -518,6 +522,7 @@ + exit(1); + + } ++#endif + + /**********DECODE_TO_NAUTY****************************************************/ + +@@ -4013,6 +4018,15 @@ + int multicode=0, g6code=1; + long long int last=0LL; + ++#ifdef GTOOL_USAGEHELP_COMPATIBILITY ++ if (argc > 1 && (strcmp(argv[1],"-help") == 0 ++ || (strcmp(argv[1],"--help") == 0))) ++ { ++ printf("Usage: %s\n\n%s",USAGE,HELPTEXT); ++ exit(0); ++ } ++#endif ++ + if (sizeof(long long int)<8) + { + fprintf(stderr,"This may cause problems with the hashing function for large degree -- exit().\n"); +@@ -4028,7 +4042,15 @@ + else if (argv[i][0]=='B') direct_output=3; + else if (argv[i][0]=='S') double_allowed=0; + else if (argv[i][0]=='m') { g6code=0; multicode=1; } +- else usage(argv[0]); ++ else { ++#ifdef GTOOL_USAGEHELP_COMPATIBILITY ++ fprintf(stderr,">E Usage: %s\n",USAGE); ++ fprintf(stderr,"Use watercluster2 -help to see a list of the options.\n"); ++ exit(1); ++#else ++ usage(argv[0]); ++#endif ++ } + } + + #ifdef PROCESS +--- a/genbg.c ++++ b/genbg.c +@@ -3,8 +3,7 @@ + /* TODO: consider colour swaps */ + + #define USAGE \ +-"genbg [-c -ugs -vq -lzF] [-Z#] [-D#] [-A] [-d#|-d#:#] [-D#|-D#:#] n1 n2 \n\ +- [mine[:maxe]] [res/mod] [file]" ++"genbg [-c -ugs -vq -lzF] [-Z#] [-D#] [-A] [-d#|-d#:#] [-D#|-D#:#] n1 n2 [mine[:maxe]] [res/mod] [file]" + + #define HELPTEXT \ + " Find all bicoloured graphs of a specified class.\n\ +--- a/geng.c ++++ b/geng.c +@@ -6,8 +6,7 @@ + /* geng.c version 2.9; B D McKay, Jan 2016. */ + + #define USAGE \ +-"geng [-cCmtfbd#D#] [-uygsnh] [-lvq] \n\ +- [-x#X#] n [mine[:maxe]] [res/mod] [file]" ++"geng [-cCmtfbd#D#] [-uygsnh] [-lvq] [-x#X#] n [mine[:maxe]] [res/mod] [file]" + + #define HELPTEXT \ + " Generate all graphs of a specified class.\n\ +--- a/genrang.c ++++ b/genrang.c +@@ -2,8 +2,7 @@ + /* TODO: Check allocs for no edges */ + + #define USAGE \ +-"genrang [-P#|-P#/#|-e#|-r#|-R#|-d#] [-l#] [-m#] [-t] [-T] [-a] \n" \ +-" [-s|-g|-z] [-S#] [-q] n|n1,n2 num [outfile]" ++"genrang [-P#|-P#/#|-e#|-r#|-R#|-d#] [-l#] [-m#] [-t] [-T] [-a] [-s|-g|-z] [-S#] [-q] n|n1,n2 num [outfile]" + + #define HELPTEXT \ + " Generate random graphs.\n\ +--- a/vcolg.c ++++ b/vcolg.c +@@ -1,8 +1,7 @@ + /* vcolg.c version 1.0; B D McKay, Aug 31, 2013 */ + + #define USAGE \ +-"vcolg [-q] [-u|-T|-G|-A|-B] [-e#|-e#:#] \n" \ +-" [-m#] [-f#] [-D#|-r#|-l#] [infile [outfile]]" ++"vcolg [-q] [-u|-T|-G|-A|-B] [-e#|-e#:#] [-m#] [-f#] [-D#|-r#|-l#] [infile [outfile]]" + + #define HELPTEXT \ + " Read undirected loop-free graphs and colour their vertices in\n\ +--- a/genspecialg.c ++++ b/genspecialg.c +@@ -1,20 +1,22 @@ + /* genspecialg.c version 1.1; B D McKay, Feb 12, 2016 */ + +-#define USAGE "genspecialg \n\ +-[-s|-g|-z|-d] [-q] \ +-[-p#|-c#|-e#|-k#|-b#,#|-Q#|-f#|-J#,#|-P#,#|C#,#...|G#,#...|T#,#...] [outfile]" ++#define USAGE "genspecialg [-s|-g|-z|-d] [-q] [-p#|-c#|-e#|-k#|-b#,#|-Q#|-f#|-J#,#|-P#,#|C#[,#]|G#[,#]|T#[,#]] [outfile]" + + #define HELPTEXT \ + " Generate one particular graph.\n\ +- # : size parameter called n in the descriptions\n\ + \n\ ++Options:\n\ ++General Options:\n\ + -s : Write in sparse6 format (default)\n\ + -g : Write in graph6 format\n\ + -z : Make digraph versions and write in digraph6 format\n\ + -d : Write in dreadnaut format (can be used with -z)\n\ + -q : Suppress summary\n\ + \n\ +- If defined, the digraph version is shown in parentheses:\n\ ++Special Options:\n\ ++ If defined, the digraph version is shown in parentheses;\n\ ++ # size parameter called n in the descriptions.\n\ ++\n\ + -p# : path (directed path) on n vertices.\n\ + -c# : cycle (directed cycle) on n vertices.\n\ + -e# : empty graph (digraph with loops only) on n vertices.\n\ +@@ -24,9 +26,9 @@ + -P#,# : generalized Petersen graph; usual one is -P5,2\n\ + -Q# : hypercube on 2^n vertices and degree n.\n\ + -J#,# : Johnson graph J(n,k), args are n and k.\n\ +- -C#,#... : circulant (di)graph.\n\ +- -T#,#... : theta (di)graph Theta(#,#,...), give path lengths.\n\ +- -G#,#... : (directed) grid, use negative values for open directions\n" ++ -C#[,#] : circulant (di)graph.\n\ ++ -T#[,#] : theta (di)graph Theta(#[,#]), give path lengths.\n\ ++ -G#[,#] : (directed) grid, use negative values for open directions\n" + + /* Ideas: multipartite, knesser, full trees */ + +--- a/cubhamg.c ++++ b/cubhamg.c +@@ -1,54 +1,53 @@ +-/* cubhamg.c : pick those inputs that are nonhamiltonian and +- have max degree <= 3. ++/* cubhamg.c : pick those inputs that are nonhamiltonian and have max degree <= 3. */ + +- Usage: +-cubhamg [-#] [-v|-V] [-n#-#|-y#-#|-i|-I|-o|-x|-e|-E] [-b|-t] [infile [outfile]] ++#define USAGE "cubhamg [-#] [-v|-V] [-n#-#|-y#-#|-i|-I|-o|-x|-e|-E] [-b|-t] [infile [outfile]]" + +- infile is the name of the input file in graph6/sparse6 format +- outfile is the name of the output file in the same format ++#define HELPTEXT \ ++" Pick those inputs that are nonhamiltonian and have max degree <= 3.\n\ ++\n\ ++ infile is the name of the input file in graph6/sparse6 format (default: stdin)\n\ ++\n\ ++ outfile is the name of the output file in the same format (default: stdout)\n\ ++\n\ ++ The output file will have a header >>graph6<< or >>sparse6<< if the input file does.\n\ ++\n\ ++Options:\n\ ++ -# A parameter useful for tuning (default 100)\n\ ++ -v Report nonhamiltonian graphs and noncubic graphs\n\ ++ -V .. in addition give a cycle for the hamiltonian ones\n\ ++ -n#-# If the two numbers are v and i, then the i-th edge\n\ ++ out of vertex v is required to be not in the cycle.\n\ ++ It must be that i=1..3 and v=0..n-1.\n\ ++ -y#-# If the two numbers are v and i, then the i-th edge\n\ ++ out of vertex v is required to be in the cycle.\n\ ++ It must be that i=1..3 and v=0..n-1.\n\ ++ You can use any number of -n/-y switches to force\n\ ++ edges. Out of range first arguments are ignored.\n\ ++ If -y and -n give same edge, -y wins.\n\ ++ -i Test + property: for each edge e, there is a hamiltonian cycle using e.\n\ ++ -I Test ++ property: for each pair of edges e,e', there is\n\ ++ a hamiltonian cycle which uses both e and e'.\n\ ++ -o Test - property: for each edge e, there is a hamiltonian cycle avoiding e.\n\ ++ -x Test +- property: for each pair of edges e,e', there is\n\ ++ a hamiltonian cycle which uses e but avoids e'.\n\ ++ -e Test 3/4 property: for each edge e, at least 3 of the 4\n\ ++ paths of length 3 passing through e lie on hamiltonian cycles.\n\ ++ -E Test 3/4+ property: for each edge e failing the 3/4 property,\n\ ++ all three ways of joining e to the rest of the graph are\n\ ++ hamiltonian avoiding e.\n\ ++ -T# Specify a timeout, being a limit on how many search tree\n\ ++ nodes are made. If the timeout occurs, the graph is\n\ ++ written to the output as if it is nonhamiltonian.\n\ ++ -R# Specify the number of repeat attempts for each stage.\n\ ++ -F Analyze covering paths from 2 or 4 vertices of degree 2.\n\ ++\n\ ++ -b Require biconnectivity\n\ ++ -t Require triconnectivity (note: quadratic algorithm)\n\ ++\n\ ++Comments:\n\ ++ -y, -n, -#, -R and -T are ignored for -i, -I, -x, -o, -e, -E, -F\n" + +- stdin and stdout are the defaults for infile and outfile +- +- The output file will have a header >>graph6<< or >>sparse6<< +- if and only if the input file does. +- +- Optional switches: +- +- -# A parameter useful for tuning (default 100) +- -v Report nonhamiltonian graphs and noncubic graphs +- -V .. in addition give a cycle for the hamiltonian ones +- -n#-# If the two numbers are v and i, then the i-th edge +- out of vertex v is required to be not in the cycle. +- It must be that i=1..3 and v=0..n-1. +- -y#-# If the two numbers are v and i, then the i-th edge +- out of vertex v is required to be in the cycle. +- It must be that i=1..3 and v=0..n-1. +- You can use any number of -n/-y switches to force +- edges. Out of range first arguments are ignored. +- If -y and -n give same edge, -y wins. +- -i Test + property: for each edge e, there is a hamiltonian +- cycle using e. +- -I Test ++ property: for each pair of edges e,e', there is +- a hamiltonian cycle which uses both e and e'. +- -o Test - property: for each edge e, there is a hamiltonian +- cycle avoiding e. +- -x Test +- property: for each pair of edges e,e', there is +- a hamiltonian cycle which uses e but avoids e'. +- -e Test 3/4 property: for each edge e, at least 3 of the 4 +- paths of length 3 passing through e lie on hamiltonian cycles. +- -E Test 3/4+ property: for each edge e failing the 3/4 property, +- all three ways of joining e to the rest of the graph are +- hamiltonian avoiding e. +- -T# Specify a timeout, being a limit on how many search tree +- nodes are made. If the timeout occurs, the graph is +- written to the output as if it is nonhamiltonian. +- -R# Specify the number of repeat attempts for each stage. +- -F Analyze covering paths from 2 or 4 vertices of degree 2. +- +- -b Require biconnectivity +- -t Require triconnectivity (note: quadratic algorithm) +- +- -y, -n, -#, -R and -T are ignored for -i, -I, -x, -o, -e, -E, -F ++/************************************************************************** + + B. D. McKay, Nov 1995 + Aug 1996 + Feb 2002 + Jul 2008 + Nov 2015 + +@@ -1611,6 +1610,8 @@ + char *arg; + int codetype; + ++ HELP; ++ + infilename = outfilename = NULL; + badargs = FALSE; + e34plus = e34 = in = out = inin = inout = FALSE; +@@ -1729,8 +1730,8 @@ + + if (badargs) + { +- fprintf(stderr, +- ">E Usage: cubhamg [-#] [-v | -V] [-n#-#] [-y#-#] [infile [outfile]]\n"); ++ fprintf(stderr, ">E Usage: " USAGE "\n" ); ++ GETHELP; + exit(1); + } + diff --git a/nauty-includes.patch b/nauty-includes.patch new file mode 100644 index 0000000..30fff3b --- /dev/null +++ b/nauty-includes.patch @@ -0,0 +1,117 @@ +Description: system preprocessing directive #include for examples +Origin: debian +Author: Jerome Benoit +Last-Update: 2013-11-24 + +--- a/nautyex1.c ++++ b/nautyex1.c +@@ -5,7 +5,7 @@ + */ + + #define MAXN 1000 /* Define this before including nauty.h */ +-#include "nauty.h" /* which includes and other system files */ ++#include /* which includes and other system files */ + + int + main(int argc, char *argv[]) +--- a/nautyex10.c ++++ b/nautyex10.c +@@ -6,7 +6,7 @@ + those here, it can be faster for some very difficult graphs. + */ + +-#include "traces.h" ++#include + + int + main(int argc, char *argv[]) +--- a/nautyex2.c ++++ b/nautyex2.c +@@ -4,7 +4,7 @@ + This version uses dynamic allocation. + */ + +-#include "nauty.h" ++#include + /* MAXN=0 is defined by nauty.h, which implies dynamic allocation */ + + int +--- a/nautyex3.c ++++ b/nautyex3.c +@@ -2,8 +2,8 @@ + polygon, where n is a number supplied by the user. + */ + +-#include "nauty.h" /* which includes */ +-#include "naugroup.h" ++#include /* which includes */ ++#include + + /**************************************************************************/ + +--- a/nautyex4.c ++++ b/nautyex4.c +@@ -3,7 +3,7 @@ + This version uses sparse form with dynamic allocation. + */ + +-#include "nausparse.h" /* which includes nauty.h */ ++#include /* which includes nauty.h */ + + int + main(int argc, char *argv[]) +--- a/nautyex5.c ++++ b/nautyex5.c +@@ -3,7 +3,7 @@ + This version uses sparse form with dynamic allocation. + */ + +-#include "nausparse.h" /* which includes nauty.h */ ++#include /* which includes nauty.h */ + + int + main(int argc, char *argv[]) +--- a/nautyex6.c ++++ b/nautyex6.c +@@ -4,7 +4,7 @@ + This version uses dense form with dynamic allocation. + */ + +-#include "nauty.h" ++#include + + int + main(int argc, char *argv[]) +--- a/nautyex7.c ++++ b/nautyex7.c +@@ -3,7 +3,7 @@ + This version uses Traces. + */ + +-#include "traces.h" ++#include + + int + main(int argc, char *argv[]) +--- a/nautyex8.c ++++ b/nautyex8.c +@@ -3,7 +3,7 @@ + This version uses dense form with dynamic allocation. + */ + +-#include "nauty.h" ++#include + + int + main(int argc, char *argv[]) +--- a/nautyex9.c ++++ b/nautyex9.c +@@ -7,7 +7,7 @@ + that p is a prime.) + */ + +-#include "traces.h" ++#include + + int + main(int argc, char *argv[]) diff --git a/nauty-popcnt.patch b/nauty-popcnt.patch new file mode 100644 index 0000000..5235107 --- /dev/null +++ b/nauty-popcnt.patch @@ -0,0 +1,1803 @@ +Description: enable runtime detection of popcnt-enabled CPU +Origin: fedora +Author: Jerry James +Last-Update: 2016-04-20 + +--- a/addedgeg.c ++++ b/addedgeg.c +@@ -74,6 +74,23 @@ no4path(graph *g, int m, int n, int v, i + } + + /*************************************************************************/ ++STATIC_POPCNTFUNC(int,compute_degree,(const graph *g, int *deg, int m, int n), ++{ ++ const setword *gv; ++ int v, actmaxdeg = 0; ++ ++ for (v = 0, gv = g; v < n; ++v, gv += m) ++ { ++ int i, degv = 0; ++ for (i = 0; i < m; ++i) ++ degv += POPCOUNT(gv[i]); ++ if (degv > actmaxdeg) actmaxdeg = degv; ++ deg[v] = degv; ++ } ++ return actmaxdeg; ++}) ++ ++/*************************************************************************/ + + int + main(int argc, char *argv[]) +@@ -89,7 +106,7 @@ main(int argc, char *argv[]) + nauty_counter nin,nout; + char *arg,sw; + setword *gv,*gw; +- int maxdeg,actmaxdeg,degv; ++ int maxdeg,actmaxdeg; + double t; + #if MAXN + graph h[MAXN*MAXM]; +@@ -208,16 +225,7 @@ main(int argc, char *argv[]) + DYNALLOC1(int,dist,dist_sz,n,"addedgeg"); + #endif + +- actmaxdeg = n; +- for (v = 0, gv = g; v < n; ++v, gv += m) +- { +- degv = 0; +- for (i = 0; i < m; ++i) +- degv += POPCOUNT(gv[i]); +- if (degv < actmaxdeg) actmaxdeg = degv; +- deg[v] = degv; +- } +- ++ actmaxdeg = compute_degree(g, deg, m, n); + if (actmaxdeg > maxdeg) continue; + + okdist[0] = okdist[1] = FALSE; +--- a/complg.c ++++ b/complg.c +@@ -50,6 +50,17 @@ compl(graph *g, int m, int n, graph *h, + } + } + ++/*************************************************************************/ ++STATIC_POPCNTFUNC(size_t __attribute__((pure)),num_edges, ++ (const graph *g, size_t gwords), ++{ ++ size_t ii, ned; ++ ++ ned = 0; ++ for (ii = 0; ii < gwords; ++ii) ned += POPCOUNT(g[ii]); ++ return ned; ++}) ++ + /**************************************************************************/ + + int +@@ -172,10 +183,10 @@ main(int argc, char *argv[]) + + if (restricted || Restricted) + { +- ned = loops = 0; ++ loops = 0; + gwords = m * (size_t)n; + nn = n * (size_t)(n-1); +- for (ii = 0; ii < gwords; ++ii) ned += POPCOUNT(g[ii]); ++ ned = num_edges(g, gwords); + for (ii = 0; ii < n; ++ii) if (ISELEMENT(g+m*ii,ii)) ++loops; + if (Lswitch) + { +--- a/configure.ac ++++ b/configure.ac +@@ -300,6 +300,9 @@ dnl --disable-popcnt disables the use of + AC_MSG_CHECKING(if popcnt instruction is available and requested) + AC_ARG_ENABLE([popcnt], + AS_HELP_STRING([--disable-popcnt], [Disable popcnt extensions]), [popcntarg=given], [popcntarg=notgiven]) ++AC_ARG_ENABLE([runtime-popcnt], ++ AS_HELP_STRING([--enable-runtime-popcnt], [Detect popcnt extensions at runtime]), ++ [runtime_popcnt=1;enable_popcnt=yes], [runtime_popcnt=0]) + AS_IF([test "x$popcntarg" = "xnotgiven" -o "x$enable_popcnt" = "xyes"], [ + have_hwpopcnt=0 + test -e /proc/cpuinfo && grep -i popcnt /proc/cpuinfo >/dev/null && have_hwpopcnt=1 +@@ -329,7 +332,6 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([#include + main(){unsigned int x; x = _mm_popcnt_u64(x);}])], [have_mmpop64=1], [have_mmpop64=0]) + AC_MSG_RESULT($have_mmpop64) + ], [ +-CFLAGS="$CFLAGS -mpopcnt" + AC_MSG_CHECKING(if __builtin_popcount() is supported) + AC_LINK_IFELSE([AC_LANG_SOURCE([main(){unsigned int x; x = __builtin_popcount(x);}])], [have_popcnt=1], [have_popcnt=0]) + AC_MSG_RESULT($have_popcnt) +@@ -348,6 +350,7 @@ AC_SUBST(have_popcntl) + AC_SUBST(have_popcntll) + AC_SUBST(have_mmpop32) + AC_SUBST(have_mmpop64) ++AC_SUBST(runtime_popcnt) + AC_SUBST(MORECFLAGS) + + dnl --disable-clz disables the use of gcc extensions __builtin_clz*() +--- a/deledgeg.c ++++ b/deledgeg.c +@@ -16,6 +16,23 @@ + + #include "gtools.h" + ++/*************************************************************************/ ++STATIC_POPCNTFUNC(int,compute_degree,(const graph *g, int *deg, int m, int n), ++{ ++ const setword *gv; ++ int v, actmindeg = n; ++ ++ for (v = 0, gv = g; v < n; ++v, gv += m) ++ { ++ int i, degv = 0; ++ for (i = 0; i < m; ++i) ++ degv += POPCOUNT(gv[i]); ++ if (degv < actmindeg) actmindeg = degv; ++ deg[v] = degv; ++ } ++ return actmindeg; ++}) ++ + /**************************************************************************/ + + int +@@ -25,13 +42,13 @@ main(int argc, char *argv[]) + FILE *infile,*outfile; + boolean badargs,dolabel,quiet,dswitch; + boolean digraph; +- int i,j,m,n,v,w,argnum; ++ int j,m,n,v,w,argnum; + int codetype,outcode; + graph *g,*gq; + nauty_counter nin,nout; + char *arg,sw; + setword *gv,*gw; +- int mindeg,actmindeg,degv; ++ int mindeg,actmindeg; + boolean zswitch; + double t; + #if MAXN +@@ -136,16 +153,7 @@ main(int argc, char *argv[]) + DYNALLOC1(int,deg,deg_sz,n,"deledgeg"); + #endif + +- actmindeg = n; +- for (v = 0, gv = g; v < n; ++v, gv += m) +- { +- degv = 0; +- for (i = 0; i < m; ++i) +- degv += POPCOUNT(gv[i]); +- if (degv < actmindeg) actmindeg = degv; +- deg[v] = degv; +- } +- ++ actmindeg = compute_degree(g, deg, m, n); + if (actmindeg < mindeg) continue; + + if (zswitch || digraph) +--- a/delptg.c ++++ b/delptg.c +@@ -104,6 +104,22 @@ search(int level, int ndel, int *del, gr + } + } + ++/*************************************************************************/ ++STATIC_POPCNTFUNC(void,check_degree, ++ (const graph *g, boolean *degok, int m, int n, long mindeg, long maxdeg), ++{ ++ const setword *gv; ++ int v; ++ ++ for (v = 0, gv = g; v < n; ++v, gv += m) ++ { ++ int i, degv = 0; ++ for (i = 0; i < m; ++i) ++ degv += POPCOUNT(gv[i]); ++ degok[v] = (degv >= mindeg) && (degv <= maxdeg); ++ } ++}) ++ + /**************************************************************************/ + + int +@@ -112,15 +128,13 @@ main(int argc, char *argv[]) + char *infilename,*outfilename; + FILE *infile; + boolean badargs,quiet,dswitch,nswitch; +- int i,j,m,n,v,argnum; ++ int j,m,n,argnum; + int ndel; + int codetype; + graph *g; + nauty_counter nin; + char *arg,sw; +- setword *gv; + long mindeg,maxdeg; +- int degv; + double t; + #if MAXN + boolean degok[MAXN]; +@@ -239,13 +253,7 @@ main(int argc, char *argv[]) + DYNALLOC1(int,del,del_sz,n,"delptg"); + #endif + +- for (v = 0, gv = g; v < n; ++v, gv += m) +- { +- degv = 0; +- for (i = 0; i < m; ++i) +- degv += POPCOUNT(gv[i]); +- degok[v] = (degv >= mindeg) && (degv <= maxdeg); +- } ++ check_degree(g, degok, m, n, mindeg, maxdeg); + + search(0,ndel,del,g,m,n,degok); + +--- a/directg.c ++++ b/directg.c +@@ -380,6 +380,16 @@ scan(int level, int ne, int minarcs, int + return level-1; + } + ++/*************************************************************************/ ++STATIC_POPCNTFUNC(int __attribute__((pure)),compute_degree,(const set *s, int m), ++{ ++ int i, deg; ++ ++ deg = 0; ++ for (i = 0; i < m; ++i) deg += POPCOUNT(s[i]); ++ return deg; ++}) ++ + /**************************************************************************/ + + static void +@@ -406,8 +416,7 @@ direct(graph *g, int nfixed, long minarc + ne = 0; + for (i = 0, gi = g; i < n; ++i, gi += m) + { +- deg = 0; +- for (j = 0; j < m; ++j) deg += POPCOUNT(gi[j]); ++ deg = compute_degree(gi, m); + if (deg == 0) + { + lab[++j0] = i; +--- a/genbg.c ++++ b/genbg.c +@@ -465,8 +465,7 @@ isconnected(graph *g, int n) + + /**************************************************************************/ + +-static boolean +-distinvar(graph *g, int *invar, int n1, int n2) ++STATIC_POPCNTFUNC(boolean,distinvar,(graph *g, int *invar, int n1, int n2), + /* make distance invariant/ + exit immediately FALSE if n-1 not maximal else exit TRUE + Note: only invar[n1..n1+n2-1] set */ +@@ -498,7 +497,7 @@ distinvar(graph *g, int *invar, int n1, + if (v < n-1 && inv > invar[n-1]) return FALSE; + } + return TRUE; +-} ++}) + + /**************************************************************************/ + +@@ -654,10 +653,10 @@ userautomproc(int count, int *p, int *or + * * + *****************************************************************************/ + +-static void +-refinex(graph *g, int *lab, int *ptn, int level, int *numcells, ++STATIC_POPCNTFUNC(void,refinex, ++ (graph *g, int *lab, int *ptn, int level, int *numcells, + int *count, set *active, boolean goodret, +- int *code, int m, int n) ++ int *code, int m, int n), + { + int i,c1,c2,labc1; + setword x; +@@ -790,7 +789,7 @@ refinex(graph *g, int *lab, int *ptn, in + } + } + } +-} ++}) + + /**************************************************************************/ + +@@ -938,9 +937,28 @@ accept1(graph *g, int n2, int x, graph * + } + + /**************************************************************************/ ++#ifdef INSTRUMENT ++#define INSTRUMENT_VAR(var) ++var ++#define INSTRUMENT_UNIQ(var) if (nuniq) ++var ++#else ++#define INSTRUMENT_VAR(var) ++#define INSTRUMENT_UNIQ(var) ++#endif + +-static boolean +-accept2(graph *g, int n2, int x, graph *gx, int *deg, boolean nuniq) ++#ifdef PRUNE1 ++#define DO_PRUNE1(a,b,c,d,e) if (PRUNE1(a,b,c,d,e)) return FALSE ++#else ++#define DO_PRUNE1(a,b,c,d,e) ++#endif ++ ++#ifdef PRUNE2 ++#define DO_PRUNE2(a,b,c,d,e) if (PRUNE2(a,b,c,d,e)) return FALSE ++#else ++#define DO_PRUNE2(a,b,c,d,e) ++#endif ++ ++STATIC_POPCNTFUNC(boolean,accept2, ++ (graph *g, int n2, int x, graph *gx, int *deg, boolean nuniq), + /* decide if n in theta(g+x) -- version for n+1 == maxn */ + { + int i,n; +@@ -957,10 +975,8 @@ accept2(graph *g, int n2, int x, graph * + static DEFAULTOPTIONS_GRAPH(options); + setword workspace[50]; + +-#ifdef INSTRUMENT +- ++a2calls; +- if (nuniq) ++a2uniq; +-#endif ++ INSTRUMENT_VAR(a2calls); ++ INSTRUMENT_UNIQ(a2uniq); + n = n1 + n2; + nx = n + 1; + for (i = 0; i < n; ++i) +@@ -980,18 +996,12 @@ accept2(graph *g, int n2, int x, graph * + gx[n] |= bit[i]; + ++degx[i]; + } +-#ifdef PRUNE1 +- if (PRUNE1(gx,degx,n1,n2+1,maxn2)) return FALSE; +-#endif ++ DO_PRUNE1(gx,degx,n1,n2+1,maxn2); + + if (nuniq) + { +-#ifdef INSTRUMENT +- ++a2succs; +-#endif +-#ifdef PRUNE2 +- if (PRUNE2(gx,degx,n1,n2+1,maxn2)) return FALSE; +-#endif ++ INSTRUMENT_VAR(a2succs); ++ DO_PRUNE2(gx,degx,n1,n2+1,maxn2); + if (canonise) makecanon(gx,gcan,n1,n2+1); + return TRUE; + } +@@ -1040,12 +1050,8 @@ accept2(graph *g, int n2, int x, graph * + { + if (j0 == n) + { +-#ifdef INSTRUMENT +- ++a2succs; +-#endif +-#ifdef PRUNE2 +- if (PRUNE2(gx,degx,n1,n2+1,maxn2)) return FALSE; +-#endif ++ INSTRUMENT_VAR(a2succs); ++ DO_PRUNE2(gx,degx,n1,n2+1,maxn2); + if (canonise) makecanon(gx,gcan,n1,n2+1); + return TRUE; + } +@@ -1096,12 +1102,8 @@ accept2(graph *g, int n2, int x, graph * + { + if (j0 == n) + { +-#ifdef INSTRUMENT +- ++a2succs; +-#endif +-#ifdef PRUNE2 +- if (PRUNE2(gx,degx,n1,n2+1,maxn2)) return FALSE; +-#endif ++ INSTRUMENT_VAR(a2succs); ++ DO_PRUNE2(gx,degx,n1,n2+1,maxn2); + if (canonise) makecanon(gx,gcan,n1,n2+1); + return TRUE; + } +@@ -1117,12 +1119,8 @@ accept2(graph *g, int n2, int x, graph * + return FALSE; + else if (code > 0 || numcells >= nx-4) + { +-#ifdef INSTRUMENT +- ++a2succs; +-#endif +-#ifdef PRUNE2 +- if (PRUNE2(gx,degx,n1,n2+1,maxn2)) return FALSE; +-#endif ++ INSTRUMENT_VAR(a2succs); ++ DO_PRUNE2(gx,degx,n1,n2+1,maxn2); + if (canonise) makecanon(gx,gcan,n1,n2+1); + return TRUE; + } +@@ -1133,25 +1131,19 @@ accept2(graph *g, int n2, int x, graph * + options.defaultptn = FALSE; + + active[0] = 0; +-#ifdef INSTRUMENT +- ++a2nauty; +-#endif ++ INSTRUMENT_VAR(a2nauty); + nauty(gx,lab,ptn,active,orbits,&options,&stats,workspace,50,1,nx,gcan); + + if (orbits[lab[n]] == orbits[n]) + { +-#ifdef INSTRUMENT +- ++a2succs; +-#endif +-#ifdef PRUNE2 +- if (PRUNE2(gx,degx,n1,n2+1,maxn2)) return FALSE; +-#endif ++ INSTRUMENT_VAR(a2succs); ++ DO_PRUNE2(gx,degx,n1,n2+1,maxn2); + if (canonise) makecanon(gx,gcan,n1,n2+1); + return TRUE; + } + else + return FALSE; +-} ++}) + + /**************************************************************************/ + +--- a/geng.c ++++ b/geng.c +@@ -703,8 +703,7 @@ gcomplement(graph *g, graph *gc, int n) + + /**********************************************************************/ + +-static boolean +-distinvar(graph *g, int *invar, int n) ++STATIC_POPCNTFUNC(boolean,distinvar,(graph *g, int *invar, int n), + /* make distance invariant + return FALSE if n-1 not maximal else return TRUE */ + { +@@ -734,7 +733,7 @@ distinvar(graph *g, int *invar, int n) + if (v < n-1 && inv > invar[n-1]) return FALSE; + } + return TRUE; +-} ++}) + + /**************************************************************************/ + +@@ -1174,9 +1173,9 @@ userautomprocb(int count, int *p, int *o + * * + *****************************************************************************/ + +-static void +-refinex(graph *g, int *lab, int *ptn, int level, int *numcells, +- int *count, set *active, boolean goodret, int *code, int m, int n) ++STATIC_POPCNTFUNC(void,refinex, ++ (graph *g, int *lab, int *ptn, int level, int *numcells, ++ int *count, set *active, boolean goodret, int *code, int m, int n), + { + int i,c1,c2,labc1; + setword x,lact; +@@ -1307,7 +1306,7 @@ refinex(graph *g, int *lab, int *ptn, in + } + } + } +-} ++}) + + /**************************************************************************/ + +@@ -1540,9 +1539,22 @@ accept1b(graph *g, int n, xword x, graph + } + + /**************************************************************************/ ++#ifdef INSTRUMENT ++#define INSTRUMENT_VAR(var) ++var ++#define INSTRUMENT_UNIQ(var) if (nuniq) ++var ++#else ++#define INSTRUMENT_VAR(var) ++#define INSTRUMENT_UNIQ(var) ++#endif + +-static boolean +-accept2(graph *g, int n, xword x, graph *gx, int *deg, boolean nuniq) ++#ifdef PREPRUNE ++#define DO_PREPRUNE(a,b,c) if (PREPRUNE(a,b,c)) return FALSE ++#else ++#define DO_PREPRUNE(a,b,c) ++#endif ++ ++STATIC_POPCNTFUNC(boolean,accept2, ++ (graph *g, int n, xword x, graph *gx, int *deg, boolean nuniq), + /* decide if n in theta(g+x) -- version for n+1 == maxn */ + { + int i; +@@ -1560,10 +1572,8 @@ accept2(graph *g, int n, xword x, graph + setword workspace[50]; + boolean cheapacc; + +-#ifdef INSTRUMENT +- ++a2calls; +- if (nuniq) ++a2uniq; +-#endif ++ INSTRUMENT_VAR(a2calls); ++ INSTRUMENT_UNIQ(a2uniq); + nx = n + 1; + for (i = 0; i < n; ++i) + { +@@ -1583,15 +1593,11 @@ accept2(graph *g, int n, xword x, graph + ++degx[i]; + } + +-#ifdef PREPRUNE +- if (PREPRUNE(gx,n+1,maxn)) return FALSE; +-#endif ++ DO_PREPRUNE(gx,n+1,maxn); + + if (nuniq) + { +-#ifdef INSTRUMENT +- ++a2succs; +-#endif ++ INSTRUMENT_VAR(a2succs); + if (canonise) makecanon(gx,gcan,nx); + return TRUE; + } +@@ -1631,9 +1637,7 @@ accept2(graph *g, int n, xword x, graph + { + if (j0 == n) + { +-#ifdef INSTRUMENT +- ++a2succs; +-#endif ++ INSTRUMENT_VAR(a2succs); + if (canonise) makecanon(gx,gcan,nx); + return TRUE; + } +@@ -1676,9 +1680,7 @@ accept2(graph *g, int n, xword x, graph + { + if (j0 == n) + { +-#ifdef INSTRUMENT +- ++a2succs; +-#endif ++ INSTRUMENT_VAR(a2succs); + if (canonise) makecanon(gx,gcan,nx); + return TRUE; + } +@@ -1718,9 +1720,7 @@ accept2(graph *g, int n, xword x, graph + + if (cheapacc) + { +-#ifdef INSTRUMENT +- ++a2succs; +-#endif ++ INSTRUMENT_VAR(a2succs); + if (canonise) makecanon(gx,gcan,nx); + return TRUE; + } +@@ -1729,22 +1729,18 @@ accept2(graph *g, int n, xword x, graph + options.defaultptn = FALSE; + + active[0] = 0; +-#ifdef INSTRUMENT +- ++a2nauty; +-#endif ++ INSTRUMENT_VAR(a2nauty); + nauty(gx,lab,ptn,active,orbits,&options,&stats,workspace,50,1,nx,gcan); + + if (orbits[lab[n]] == orbits[n]) + { +-#ifdef INSTRUMENT +- ++a2succs; +-#endif ++ INSTRUMENT_VAR(a2succs); + if (canonise) makecanon(gx,gcan,nx); + return TRUE; + } + else + return FALSE; +-} ++}) + + /**************************************************************************/ + +--- a/genquarticg.c ++++ b/genquarticg.c +@@ -228,9 +228,9 @@ isbiconnected(graph *g, int n) + * of the graph reaches nmax after which it is written to outputfile * + ****************************************************************************/ + +-static void +-extend(int n, graph *g, edgestruct *edge, pairstruct *epair, int numpair, +- int *epairorbit, int *multar, setword *zar, int *col00w, boolean connectflag) ++STATIC_POPCNTFUNC(void,extend, ++ (int n, graph *g, edgestruct *edge, pairstruct *epair, int numpair, ++ int *epairorbit, int *multar, setword *zar, int *col00w, boolean connectflag), + { + int vm1, vm2, vm3, vm4, vt1, vt2, vt3, vt4, c, b, mcol1, mcol, + tcol, got_one, i, j, k, numpair1, numdovi, maxdovi, i1, j1, i2, j2, +@@ -916,7 +916,7 @@ extend(int n, graph *g, edgestruct *edge + + } //end for c.. + +-} ++}) + + /***************************************************************************** + * * +@@ -1160,9 +1160,9 @@ init_refinex( int *clr, int *lb, int *p, + * code := -1 for n-1 not max, 0 for maybe, 1 for definite * + * * + *****************************************************************************/ +-static void +-refinex(graph *g, int *lab, int *ptn, int level, int *numcells, int *count, +- set *active, boolean goodret, int *code, int m, int n) ++STATIC_POPCNTFUNC(void,refinex, ++ (graph *g, int *lab, int *ptn, int level, int *numcells, int *count, ++ set *active, boolean goodret, int *code, int m, int n), + { + int i, c1, c2, labc1, split1, split2, cell1, cell2, cnt, bmin, bmax; + int workperm[MAXN], bucket[MAXN+2]; +@@ -1290,7 +1290,7 @@ refinex(graph *g, int *lab, int *ptn, in + } + } + } +-} ++}) + + + /*****************************************************************************/ +--- a/gentourng.c ++++ b/gentourng.c +@@ -547,9 +547,9 @@ userautomproc(int count, int *p, int *or + * * + *****************************************************************************/ + +-static void +-refinex(graph *g, int *lab, int *ptn, int level, int *numcells, +- int *count, set *active, boolean goodret, int *code, int m, int n) ++STATIC_POPCNTFUNC(void,refinex, ++ (graph *g, int *lab, int *ptn, int level, int *numcells, ++ int *count, set *active, boolean goodret, int *code, int m, int n), + { + int i,c1,c2,labc1; + setword x,lact; +@@ -681,7 +681,7 @@ refinex(graph *g, int *lab, int *ptn, in + } + } + } +-} ++}) + + /**************************************************************************/ + +@@ -803,8 +803,7 @@ accept1(graph *g, int n, xword x, graph + + /**************************************************************************/ + +-static boolean +-hitinvar(graph *g, int *invar, int n) ++STATIC_POPCNTFUNC(boolean,hitinvar,(graph *g, int *invar, int n), + /* make hitting invariant + * return FALSE if n-1 not maximal else return TRUE */ + { +@@ -827,12 +826,26 @@ hitinvar(graph *g, int *invar, int n) + if (v < n-1 && inv > invar[n-1]) return FALSE; + } + return TRUE; +-} ++}) + + /**************************************************************************/ + +-static boolean +-accept2(graph *g, int n, xword x, graph *gx, int *deg, boolean nuniq) ++#ifdef INSTRUMENT ++#define INSTRUMENT_VAR(var) ++var ++#define INSTRUMENT_UNIQ(var) if (nuniq) ++var ++#else ++#define INSTRUMENT_VAR(var) ++#define INSTRUMENT_UNIQ(var) ++#endif ++ ++#ifdef PREPRUNE ++#define DO_PREPRUNE(a,b,c) if (PREPRUNE(a,b,c)) return FALSE ++#else ++#define DO_PREPRUNE(a,b,c) ++#endif ++ ++STATIC_POPCNTFUNC(boolean,accept2, ++ (graph *g, int n, xword x, graph *gx, int *deg, boolean nuniq), + /* decide if n in theta(g+x) -- version for n+1 == maxn */ + { + int i; +@@ -849,10 +862,8 @@ accept2(graph *g, int n, xword x, graph + setword workspace[50]; + boolean cheapacc; + +-#ifdef INSTRUMENT +- ++a2calls; +- if (nuniq) ++a2uniq; +-#endif ++ INSTRUMENT_VAR(a2calls); ++ INSTRUMENT_UNIQ(a2uniq); + nx = n + 1; + gxn = 0; + +@@ -873,15 +884,11 @@ accept2(graph *g, int n, xword x, graph + gx[n] = gxn; + degx[n] = degn = XPOPCOUNT(x); + +-#ifdef PREPRUNE +- if (PREPRUNE(gx,n+1,maxn)) return FALSE; +-#endif ++ DO_PREPRUNE(gx,n+1,maxn); + + if (nuniq) + { +-#ifdef INSTRUMENT +- ++a2succs; +-#endif ++ INSTRUMENT_VAR(a2succs); + if (canonise) makecanon(gx,gcan,nx); + return TRUE; + } +@@ -920,9 +927,7 @@ accept2(graph *g, int n, xword x, graph + { + if (j0 == n) + { +-#ifdef INSTRUMENT +- ++a2succs; +-#endif ++ INSTRUMENT_VAR(a2succs); + if (canonise) makecanon(gx,gcan,nx); + return TRUE; + } +@@ -965,9 +970,7 @@ accept2(graph *g, int n, xword x, graph + { + if (j0 == n) + { +-#ifdef INSTRUMENT +- ++a2succs; +-#endif ++ INSTRUMENT_VAR(a2succs); + if (canonise) makecanon(gx,gcan,nx); + return TRUE; + } +@@ -986,9 +989,7 @@ accept2(graph *g, int n, xword x, graph + + if (cheapacc) + { +-#ifdef INSTRUMENT +- ++a2succs; +-#endif ++ INSTRUMENT_VAR(a2succs); + if (canonise) makecanon(gx,gcan,nx); + return TRUE; + } +@@ -998,22 +999,18 @@ accept2(graph *g, int n, xword x, graph + options.defaultptn = FALSE; + + active[0] = 0; +-#ifdef INSTRUMENT +- ++a2nauty; +-#endif ++ INSTRUMENT_VAR(a2nauty); + nauty(gx,lab,ptn,active,orbits,&options,&stats,workspace,50,1,nx,gcan); + + if (orbits[lab[n]] == orbits[n]) + { +-#ifdef INSTRUMENT +- ++a2succs; +-#endif ++ INSTRUMENT_VAR(a2succs); + if (canonise) makecanon(gx,gcan,nx); + return TRUE; + } + else + return FALSE; +-} ++}) + + /**************************************************************************/ + +--- a/gutil1.c ++++ b/gutil1.c +@@ -5,9 +5,9 @@ + + /**************************************************************************/ + +-void +-degstats(graph *g, int m, int n, unsigned long *edges, int *mindeg, +- int *mincount, int *maxdeg, int *maxcount, boolean *eulerian) ++POPCNTFUNC(void,degstats, ++ (graph *g, int m, int n, unsigned long *edges, int *mindeg, ++ int *mincount, int *maxdeg, int *maxcount, boolean *eulerian), + /* Compute degree-related graph properties. + *edges = number of edges + *mindeg, *mincount = minimum degree and how many there are +@@ -60,16 +60,16 @@ degstats(graph *g, int m, int n, unsigne + *maxcount = maxdc; + *edges = ned / 2; + *eulerian = (dor & 1) == 0; +-} ++}) + + /**************************************************************************/ + +-void +-degstats2(graph *g, boolean digraph, int m, int n, ++POPCNTFUNC(void,degstats2, ++ (graph *g, boolean digraph, int m, int n, + unsigned long *edges, int *loops, + int *minindeg, int *minincount, int *maxindeg, int *maxincount, + int *minoutdeg, int *minoutcount, int *maxoutdeg, int *maxoutcount, +- boolean *eulerian) ++ boolean *eulerian), + /* Compute degree-related graph properties. + *edges = number of edges (including loops), directed edges for digraphs + *loops = number of loops +@@ -232,12 +232,11 @@ degstats2(graph *g, boolean digraph, int + if (indeg[i] != outdeg[i]) break; + *eulerian = (i == n); + } +-} ++}) + + /*********************************************************************/ + +-boolean +-isconnected1(graph *g, int n) ++POPCNTFUNC(boolean,isconnected1,(graph *g, int n), + /* test if g is connected (m=1) */ + { + setword seen,expanded,toexpand; +@@ -254,7 +253,7 @@ isconnected1(graph *g, int n) + } + + return POPCOUNT(seen) == n; +-} ++}) + + /**************************************************************************/ + +@@ -304,24 +303,18 @@ isconnected(graph *g, int m, int n) + + /**************************************************************************/ + +-boolean +-issubconnected(graph *g, set *sub, int m, int n) ++POPCNTFUNC(boolean,issubconnected,(graph *g, set *sub, int m, int n), + /* Test if the subset of g induced by sub is connected. Empty is connected. */ + { + int i,head,tail,w,subsize; + set *gw; +-#if MAXN +- int queue[MAXN],visited[MAXN]; +- setword subw[MAXM]; +-#else +- DYNALLSTAT(int,queue,queue_sz); +- DYNALLSTAT(int,visited,visited_sz); +- DYNALLSTAT(set,subw,subw_sz); ++ DCL_DYNINT(queue); ++ DCL_DYNINT(visited); ++ DCL_DYNSET(subw); + +- DYNALLOC1(int,queue,queue_sz,n,"issubconnected"); +- DYNALLOC1(int,visited,visited_sz,n,"issubconnected"); +- DYNALLOC1(set,subw,subw_sz,m,"issubconnected"); +-#endif ++ DEF_DYNINT(queue,n,"issubconnected"); ++ DEF_DYNINT(visited,n,"issubconnected"); ++ DEF_DYNSET(subw,m,"issubconnected"); + + subsize = 0; + for (i = 0; i < m; ++i) subsize += (sub[i] ? POPCOUNT(sub[i]) : 0); +@@ -353,7 +346,7 @@ issubconnected(graph *g, set *sub, int m + } + + return tail == subsize; +-} ++}) + + /**********************************************************************/ + +--- a/gutil2.c ++++ b/gutil2.c +@@ -21,8 +21,7 @@ loopcount(graph *g, int m, int n) + + /**************************************************************************/ + +-long +-pathcount1(graph *g, int start, setword body, setword last) ++POPCNTFUNC(long,pathcount1,(graph *g, int start, setword body, setword last), + /* Number of paths in g starting at start, lying within body and + ending in last. {start} and last should be disjoint subsets of body. */ + { +@@ -43,7 +42,7 @@ pathcount1(graph *g, int start, setword + } + + return count; +-} ++}) + + /**************************************************************************/ + +@@ -86,8 +85,7 @@ cyclecount(graph *g, int m, int n) + + /**************************************************************************/ + +-long +-indpathcount1(graph *g, int start, setword body, setword last) ++POPCNTFUNC(long,indpathcount1,(graph *g, int start, setword body, setword last), + /* Number of induced paths in g starting at start, extravertices within + * body and ending in last. + * {start}, body and last should be disjoint. */ +@@ -108,7 +106,7 @@ indpathcount1(graph *g, int start, setwo + } + + return count; +-} ++}) + + /**************************************************************************/ + +@@ -153,8 +151,7 @@ indcyclecount(graph *g, int m, int n) + + /**************************************************************************/ + +-long +-numtriangles1(graph *g, int n) ++POPCNTFUNC(long,numtriangles1,(graph *g, int n), + /* The number of triangles in g */ + { + int i,j; +@@ -174,12 +171,11 @@ numtriangles1(graph *g, int n) + } + + return total; +-} ++}) + + /**************************************************************************/ + +-long +-numtriangles(graph *g, int m, int n) ++POPCNTFUNC(long,numtriangles,(graph *g, int m, int n), + /* The number of triangles in g */ + { + int i,j,k,kw; +@@ -204,7 +200,7 @@ numtriangles(graph *g, int m, int n) + } + + return total; +-} ++}) + + /**************************************************************************/ + +@@ -230,9 +226,8 @@ numdirtriangles(graph *g, int m, int n) + + /**************************************************************************/ + +-void +-commonnbrs(graph *g, int *minadj, int *maxadj, int *minnon, int *maxnon, +- int m, int n) ++POPCNTFUNC(void,commonnbrs, ++ (graph *g, int *minadj, int *maxadj, int *minnon, int *maxnon, int m, int n), + /* Count the common neighbours of pairs of vertices, and give the minimum + and maximum for adjacent and non-adjacent vertices. Undirected only. + Null minimums are n+1 and null maximums are -1. +@@ -273,7 +268,7 @@ commonnbrs(graph *g, int *minadj, int *m + *maxadj = maxa; + *minnon = minn; + *maxnon = maxn; +-} ++}) + + /**************************************************************************/ + +@@ -342,8 +337,7 @@ contract1(graph *g, graph *h, int v, int + static TLS_ATTR int knm[18][16]; /* knm[n,m] = conncontent(K_n - m*K_2) */ + static TLS_ATTR boolean knm_computed = FALSE; + +-int +-conncontent(graph *g, int m, int n) ++POPCNTFUNC(int,conncontent,(graph *g, int m, int n), + /* number of connected spanning subgraphs with an even number + of edges minus the number with an odd number of edges */ + { +@@ -403,14 +397,6 @@ conncontent(graph *g, int m, int n) + + if (mindeg == 0) return 0; + +-#if 0 +- if (mindeg == 1 && ne == n-1) +- { +- if (isconnected1(g,n)) return ((n&1) ? 1 : -1); +- else return 0; +- } +-#endif +- + /* Cases of clique and near-clique */ + + if (mindeg == n-1) +@@ -494,7 +480,7 @@ conncontent(graph *g, int m, int n) + v2 = conncontent(h,m,n-1); + + return v1 - v2; +-} ++}) + + boolean + stronglyconnected(graph *g, int m, int n) +--- a/listg.c ++++ b/listg.c +@@ -252,8 +252,8 @@ putcgraph(FILE *f, graph *g, int linelen + + /**************************************************************************/ + +-static void +-putve(FILE *f, unsigned long id, graph *g, boolean digraph, int m, int n) ++STATIC_POPCNTFUNC(void,putve, ++ (FILE *f, unsigned long id, graph *g, boolean digraph, int m, int n), + /* Write the numbers of vertices and edges */ + { + unsigned long ne; +@@ -265,7 +265,7 @@ putve(FILE *f, unsigned long id, graph * + + fprintf(f,"Graph %lu has %d vertices and %lu edges.\n",id,n, + (digraph?ne:ne/2)); +-} ++}) + + /**************************************************************************/ + +@@ -326,8 +326,8 @@ putdotty(FILE *f, graph *g, unsigned lon + + /**************************************************************************/ + +-static void +-putbliss(FILE *f, unsigned long id, graph *g, int m, int n) ++STATIC_POPCNTFUNC(void,putbliss, ++ (FILE *f, unsigned long id, graph *g, int m, int n), + /* Write the graph in Bliss format, according to + * http://www.tcs.hut.fi/Software/bliss/fileformat.shtml */ + { +@@ -346,7 +346,7 @@ putbliss(FILE *f, unsigned long id, grap + for (i = 0, pg = g; i < n; ++i, pg += m) + for (j = nextelement(pg,m,i); j >= 0; j = nextelement(pg,m,j)) + fprintf(f,"e %d %d\n",i+1,j+1); +-} ++}) + + /**************************************************************************/ + +--- a/multig.c ++++ b/multig.c +@@ -442,6 +442,18 @@ scan_reg(int level, int ne, long minedge + + /**************************************************************************/ + ++STATIC_POPCNTFUNC(int __attribute__((pure)),compute_degree, ++ (const set *gi, int m), ++{ ++ int i, thisdeg; ++ ++ thisdeg = 0; ++ for (i = 0; i < m; ++i) thisdeg += POPCOUNT(gi[i]); ++ return thisdeg; ++}) ++ ++/**************************************************************************/ ++ + static void + multi(graph *g, int nfixed, long minedges, long maxedges, long maxmult, + int maxdeg, boolean lswitch, int m, int n) +@@ -469,8 +481,7 @@ multi(graph *g, int nfixed, long minedge + maxd = 0; + for (i = 0, gi = g; i < n; ++i, gi += m) + { +- thisdeg = 0; +- for (j = 0; j < m; ++j) thisdeg += POPCOUNT(gi[j]); ++ thisdeg = compute_degree(gi, m); + deg[i] = thisdeg; + if (thisdeg > maxd) maxd = thisdeg; + if (thisdeg == 0) lab[++j0] = i; +--- a/naugraph.c ++++ b/naugraph.c +@@ -173,16 +173,17 @@ updatecan(graph *g, graph *canong, int * + * * + *****************************************************************************/ + ++#if MAXM==1 + void + refine(graph *g, int *lab, int *ptn, int level, int *numcells, + int *count, set *active, int *code, int m, int n) + { +- +-#if MAXM==1 + refine1(g,lab,ptn,level,numcells,count,active,code,m,n); + } + #else +- ++POPCNTFUNC(void,refine,(graph *g, int *lab, int *ptn, int level, int *numcells, ++ int *count, set *active, int *code, int m, int n), ++{ + int i,c1,c2,labc1; + setword x; + set *set1,*set2; +@@ -192,11 +193,9 @@ refine(graph *g, int *lab, int *ptn, int + set *gptr; + int maxcell,maxpos,hint; + +-#if !MAXN +- DYNALLOC1(int,workperm,workperm_sz,n,"refine"); +- DYNALLOC1(set,workset,workset_sz,m,"refine"); +- DYNALLOC1(int,bucket,bucket_sz,n+2,"refine"); +-#endif ++ DEF_DYNINT(workperm,n,"refine"); ++ DEF_DYNSET(workset,m,"refine"); ++ DEF_DYNINT(bucket,n+2,"refine"); + + longcode = *numcells; + split1 = -1; +@@ -324,7 +323,7 @@ refine(graph *g, int *lab, int *ptn, int + + longcode = MASH(longcode,*numcells); + *code = CLEANUP(longcode); +-} ++}) + #endif /* else case of MAXM==1 */ + + /***************************************************************************** +@@ -336,9 +335,8 @@ refine(graph *g, int *lab, int *ptn, int + * * + *****************************************************************************/ + +-void +-refine1(graph *g, int *lab, int *ptn, int level, int *numcells, +- int *count, set *active, int *code, int m, int n) ++POPCNTFUNC(void,refine1,(graph *g, int *lab, int *ptn, int level, ++ int *numcells, int *count, set *active, int *code, int m, int n), + { + int i,c1,c2,labc1; + setword x; +@@ -348,10 +346,8 @@ refine1(graph *g, int *lab, int *ptn, in + set *gptr,workset0; + int maxcell,maxpos,hint; + +-#if !MAXN +- DYNALLOC1(int,workperm,workperm_sz,n,"refine1"); +- DYNALLOC1(int,bucket,bucket_sz,n+2,"refine1"); +-#endif ++ DEF_DYNINT(workperm,n,"refine1"); ++ DEF_DYNINT(bucket,n+2,"refine1"); + + longcode = *numcells; + split1 = -1; +@@ -474,7 +470,7 @@ refine1(graph *g, int *lab, int *ptn, in + + longcode = MASH(longcode,*numcells); + *code = CLEANUP(longcode); +-} ++}) + + /***************************************************************************** + * * +--- a/nausparse.c ++++ b/nausparse.c +@@ -1473,8 +1473,7 @@ copy_sg(sparsegraph *sg1, sparsegraph *s + * * + *****************************************************************************/ + +-sparsegraph* +-nauty_to_sg(graph *g, sparsegraph *sg, int m, int n) ++POPCNTFUNC(sparsegraph*,nauty_to_sg,(graph *g, sparsegraph *sg, int m, int n), + { + int *d,*e; + int i,k; +@@ -1512,7 +1511,7 @@ nauty_to_sg(graph *g, sparsegraph *sg, i + } + + return sg; +-} ++}) + + /***************************************************************************** + * * +--- a/nautinv.c ++++ b/nautinv.c +@@ -221,6 +221,19 @@ twopaths(graph *g, int *lab, int *ptn, i + } + } + ++STATIC_POPCNTFUNC(int __attribute__((pure)),disjoint_edges, ++ (const set *ws, const set *gw, int m), ++{ ++ int i,pc; ++ setword sw; ++ ++ pc = 0; ++ for (i = M; --i >= 0;) ++ if ((sw = ws[i] ^ gw[i]) != 0) ++ pc += POPCOUNT(sw); ++ return pc; ++}) ++ + /***************************************************************************** + * * + * quadruples() assigns to each vertex v a value depending on the set of * +@@ -236,7 +249,6 @@ quadruples(graph *g, int *lab, int *ptn, + int *invar, int invararg, boolean digraph, int m, int n) + { + int i,pc; +- setword sw; + set *gw; + int wt; + int v,iv,v1,v2,v3; +@@ -284,9 +296,7 @@ quadruples(graph *g, int *lab, int *ptn, + if (wv3 == wv && v3 <= v) continue; + wv3 += wv2; + gw = GRAPHROW(g,v3,m); +- pc = 0; +- for (i = M; --i >= 0;) +- if ((sw = ws1[i] ^ gw[i]) != 0) pc += POPCOUNT(sw); ++ pc = disjoint_edges(ws1,gw,m); + wt = (FUZZ1(pc)+wv3) & 077777; + wt = FUZZ2(wt); + ACCUM(invar[v],wt); +@@ -315,7 +325,6 @@ triples(graph *g, int *lab, int *ptn, in + int *invar, int invararg, boolean digraph, int m, int n) + { + int i,pc; +- setword sw; + set *gw; + int wt; + int v,iv,v1,v2; +@@ -355,9 +364,7 @@ triples(graph *g, int *lab, int *ptn, in + if (wv2 == wv && v2 <= v) continue; + wv2 += wv1; + gw = GRAPHROW(g,v2,m); +- pc = 0; +- for (i = M; --i >= 0;) +- if ((sw = workset[i] ^ gw[i]) != 0) pc += POPCOUNT(sw); ++ pc = disjoint_edges(workset,gw,m); + wt = (FUZZ1(pc)+wv2) & 077777; + wt = FUZZ2(wt); + ACCUM(invar[v],wt); +@@ -382,8 +389,7 @@ void + adjtriang(graph *g, int *lab, int *ptn, int level, int numcells, int tvpos, + int *invar, int invararg, boolean digraph, int m, int n) + { +- int j,pc; +- setword sw; ++ int pc; + set *gi; + int wt; + int i,v1,v2; +@@ -421,10 +427,8 @@ adjtriang(graph *g, int *lab, int *ptn, + i = -1; + while ((i = nextelement(workset,M,i)) >= 0) + { +- pc = 0; + gi = GRAPHROW(g,i,m); +- for (j = M; --j >= 0;) +- if ((sw = workset[j] & gi[j]) != 0) pc += POPCOUNT(sw); ++ pc = disjoint_edges(workset,gi,m); + pc = (pc + wt) & 077777; + ACCUM(invar[i],pc); + } +@@ -509,7 +513,6 @@ celltrips(graph *g, int *lab, int *ptn, + int *invar, int invararg, boolean digraph, int m, int n) + { + int i,pc; +- setword sw; + set *gw; + int wt; + int v,iv,v1,iv1,v2,iv2; +@@ -545,10 +548,7 @@ celltrips(graph *g, int *lab, int *ptn, + { + v2 = lab[iv2]; + gw = GRAPHROW(g,v2,m); +- pc = 0; +- for (i = M; --i >= 0;) +- if ((sw = workset[i] ^ gw[i]) != 0) +- pc += POPCOUNT(sw); ++ pc = disjoint_edges(workset,gw,m); + wt = FUZZ1(pc); + ACCUM(invar[v],wt); + ACCUM(invar[v1],wt); +@@ -577,7 +577,6 @@ cellquads(graph *g, int *lab, int *ptn, + int *invar, int invararg, boolean digraph, int m, int n) + { + int i,pc; +- setword sw; + set *gw; + int wt; + int v,iv,v1,iv1,v2,iv2,v3,iv3; +@@ -619,10 +618,7 @@ cellquads(graph *g, int *lab, int *ptn, + { + v3 = lab[iv3]; + gw = GRAPHROW(g,v3,m); +- pc = 0; +- for (i = M; --i >= 0;) +- if ((sw = ws1[i] ^ gw[i]) != 0) +- pc += POPCOUNT(sw); ++ pc = disjoint_edges(ws1,gw,m); + wt = FUZZ1(pc); + ACCUM(invar[v],wt); + ACCUM(invar[v1],wt); +@@ -653,7 +649,6 @@ cellquins(graph *g, int *lab, int *ptn, + int *invar, int invararg, boolean digraph, int m, int n) + { + int i,pc; +- setword sw; + set *gw; + int wt; + int v,iv,v1,iv1,v2,iv2,v3,iv3,v4,iv4; +@@ -701,10 +696,7 @@ cellquins(graph *g, int *lab, int *ptn, + { + v4 = lab[iv4]; + gw = GRAPHROW(g,v4,m); +- pc = 0; +- for (i = M; --i >= 0;) +- if ((sw = ws2[i] ^ gw[i]) != 0) +- pc += POPCOUNT(sw); ++ pc = disjoint_edges(ws2,gw,m); + wt = FUZZ1(pc); + ACCUM(invar[v],wt); + ACCUM(invar[v1],wt); +@@ -749,6 +741,21 @@ uniqinter(set *s1, set *s2, int m) + return -1; + } + ++STATIC_POPCNTFUNC(int __attribute__((pure)),triedges, ++ (const set *s0, const set *s1, const set *s2, int m), ++{ ++ int i,pc; ++ setword sw; ++ ++ pc = 0; ++ for (i = M; --i >= 0;) ++ { ++ sw = s0[i] & s1[i] & s2[i]; ++ if (sw) pc += POPCOUNT(sw); ++ } ++ return pc; ++}) ++ + /***************************************************************************** + * * + * cellfano2() assigns to each vertex v a value depending on the set of * +@@ -765,7 +772,6 @@ cellfano2(graph *g, int *lab, int *ptn, + int *invar, int invararg, boolean digraph, int m, int n) + { + int i,pc; +- setword sw; + int wt; + int v0,v1,v2,v3,iv0,iv1,iv2,iv3; + int icell,bigcells,cell1,cell2; +@@ -847,12 +853,7 @@ cellfano2(graph *g, int *lab, int *ptn, + gp1 = GRAPHROW(g,pnt1,m); + gp2 = GRAPHROW(g,pnt2,m); + +- pc = 0; +- for (i = M; --i >= 0;) +- { +- sw = gp0[i] & gp1[i] & gp2[i]; +- if (sw) pc += POPCOUNT(sw); +- } ++ pc = triedges(gp0,gp1,gp2,m); + wt = FUZZ1(pc); + ACCUM(invar[v0],wt); + ACCUM(invar[v1],wt); +@@ -914,7 +915,6 @@ cellfano(graph *g, int *lab, int *ptn, i + int *invar, int invararg, boolean digraph, int m, int n) + { + int i,pc; +- setword sw; + int wt; + int v0,v1,v2,v3,iv0,iv1,iv2,iv3; + int icell,bigcells,cell1,cell2; +@@ -989,12 +989,7 @@ cellfano(graph *g, int *lab, int *ptn, i + setnbhd(g,m,n,workset,pt1); + for (i = M; --i >= 0;) workset[i] = w02[i] & w13[i]; + setnbhd(g,m,n,workset,pt2); +- pc = 0; +- for (i = M; --i >= 0;) +- { +- sw = pt0[i] & pt1[i] & pt2[i]; +- if (sw) pc += POPCOUNT(sw); +- } ++ pc = triedges(pt0,pt1,pt2,m); + wt = FUZZ1(pc); + ACCUM(invar[v0],wt); + ACCUM(invar[v1],wt); +@@ -1238,6 +1233,20 @@ cliques(graph *g, int *lab, int *ptn, in + } + } + ++STATIC_POPCNTFUNC(int,common_edges,(set *ns, const set *gv, int m), ++{ ++ int i,pc; ++ setword sw; ++ ++ pc = 0; ++ for (i = M; --i >= 0;) ++ { ++ ns[i] = gv[i] & workset[i]; ++ if ((sw = ns[i]) != 0) pc += POPCOUNT(sw); ++ } ++ return pc; ++}) ++ + /***************************************************************************** + * * + * cellcliq() assigns to each vertex v a value depending on the number of * +@@ -1260,7 +1269,6 @@ cellcliq(graph *g, int *lab, int *ptn, i + int *cellstart,*cellsize; + int iv,icell,bigcells,cell1,cell2; + int pc; +- setword sw; + + #if !MAXN + DYNALLOC1(set,workset,workset_sz,m,"cellcliq"); +@@ -1293,13 +1301,7 @@ cellcliq(graph *g, int *lab, int *ptn, i + v[0] = lab[iv]; + gv = GRAPHROW(g,v[0],m); + ns = (set*)wss; +- pc = 0; +- +- for (i = M; --i >= 0;) +- { +- ns[i] = gv[i] & workset[i]; +- if ((sw = ns[i]) != 0) pc += POPCOUNT(sw); +- } ++ pc = common_edges(ns,gv,m); + if (pc <= 1 || pc >= cellsize[icell] - 2) continue; + + ss = 1; +@@ -1333,6 +1335,20 @@ cellcliq(graph *g, int *lab, int *ptn, i + } + } + ++STATIC_POPCNTFUNC(int,not_common_edges,(set *ns, const set *gv, int m), ++{ ++ int i,pc; ++ setword sw; ++ ++ pc = 0; ++ for (i = M; --i >= 0;) ++ { ++ ns[i] = ~gv[i] & workset[i]; ++ if ((sw = ns[i]) != 0) pc += POPCOUNT(sw); ++ } ++ return pc; ++}) ++ + /***************************************************************************** + * * + * cellind() assigns to each vertex v a value depending on the number of * +@@ -1389,13 +1405,7 @@ cellind(graph *g, int *lab, int *ptn, in + v[0] = lab[iv]; + gv = GRAPHROW(g,v[0],m); + ns = (set*)wss; +- pc = 0; +- +- for (i = M; --i >= 0;) +- { +- ns[i] = ~gv[i] & workset[i]; +- if ((sw = ns[i]) != 0) pc += POPCOUNT(sw); +- } ++ pc = not_common_edges(ns,gv,m); + if (pc <= 1 || pc >= cellsize[icell] - 2) continue; + + ss = 1; +@@ -1554,9 +1564,9 @@ nautinv_freedyn(void) + * * + *****************************************************************************/ + +-static int +-semirefine(graph *g, int *lab, int *ptn, int level, int *numcells, +- int strength, set *active, int m, int n) ++STATIC_POPCNTFUNC(int,semirefine, ++ (graph *g, int *lab, int *ptn, int level, int *numcells, ++ int strength, set *active, int m, int n), + { + int i,c1,c2,labc1; + setword x; +@@ -1567,12 +1577,10 @@ semirefine(graph *g, int *lab, int *ptn, + set *gptr; + int maxcell,maxpos,hint; + +-#if !MAXN +- DYNALLOC1(int,workperm,workperm_sz,n,"refine"); +- DYNALLOC1(set,workset,workset_sz,m,"refine"); +- DYNALLOC1(int,bucket,bucket_sz,n+2,"refine"); +- DYNALLOC1(int,count,count_sz,n,"refine"); +-#endif ++ DEF_DYNINT(workperm,n,"refine"); ++ DEF_DYNSET(workset,m,"refine"); ++ DEF_DYNINT(bucket,n+2,"refine"); ++ DEF_DYNINT(count,n,"refine"); + + longcode = *numcells; + split1 = -1; +@@ -1700,7 +1708,7 @@ semirefine(graph *g, int *lab, int *ptn, + + longcode = MASH(longcode,FUZZ2(*numcells)); + return CLEANUP(longcode); +-} ++}) + + void + refinvar(graph *g, int *lab, int *ptn, int level, int numcells, int tvpos, +--- a/naututil.c ++++ b/naututil.c +@@ -134,15 +134,18 @@ static const long fuzz2[] = {2001381726L + * * + *****************************************************************************/ + +-int +-setinter(set *set1, set *set2, int m) ++#if MAXM==1 ++POPCNTFUNC(int,setinter,(set *set1, set *set2, int m), + { + setword x; + +-#if MAXM==1 + if ((x = *set1 & *set2) != 0) return POPCOUNT(x); + else return 0; ++}) + #else ++POPCNTFUNC(int,setinter,(set *set1, set *set2, int m), ++{ ++ setword x; + int count,i; + + count = 0; +@@ -154,8 +157,8 @@ setinter(set *set1, set *set2, int m) + } + + return count; ++}) + #endif +-} + + /***************************************************************************** + * * +@@ -163,14 +166,15 @@ setinter(set *set1, set *set2, int m) + * * + *****************************************************************************/ + +-int +-setsize(set *set1, int m) +-{ +- + #if MAXM==1 ++POPCNTFUNC(int,setsize,(set *set1, int m), ++{ + if (set1 != 0) return POPCOUNT(*set1); + else return 0; ++}) + #else ++POPCNTFUNC(int,setsize,(set *set1, int m), ++{ + int count,i; + setword x; + +@@ -179,8 +183,8 @@ setsize(set *set1, int m) + if ((x = *set1++) != 0) count += POPCOUNT(x); + + return count; ++}) + #endif +-} + + /***************************************************************************** + * * +--- a/nauty-h.in ++++ b/nauty-h.in +@@ -66,6 +66,7 @@ it is necessary to check they are correc + #define HAVE_POPCNTLL @have_popcntll@ + #define HAVE_MMPOP32 @have_mmpop32@ + #define HAVE_MMPOP64 @have_mmpop64@ ++#define RUNTIME_POPCNT @runtime_popcnt@ + + /*==================================================================*/ + +@@ -763,7 +764,7 @@ typedef unsigned long nauty_counter; + /* Note that, unlike icc, gcc will not use the POPCNT instruction without + permission, in which case it defines __POPCNT__ . + */ +-#ifdef __POPCNT__ ++#if defined(__POPCNT__) || RUNTIME_POPCNT + #if defined(SETWORD_LONGLONG) && HAVE_POPCNTLL + #undef POPCOUNT + #define POPCOUNT(x) __builtin_popcountll(x) +@@ -779,6 +780,47 @@ typedef unsigned long nauty_counter; + #endif + #endif + ++/* Determine popcount support at runtime */ ++#if RUNTIME_POPCNT ++#if !defined(__x86_64__) && !defined(__i386__) ++#error Runtime popcount support is only available on x86 or x86_64. ++#endif ++#ifndef __GNUC__ ++#error Runtime popcount support is only available with GCC. ++#endif ++#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) ++#error Runtime popcount support is only available with GCC 4.6 or later. ++#endif ++#include ++ ++#define SLOWPOPCNT(type,name,params,...) \ ++ static type slow_##name params __VA_ARGS__ ++#define FASTPOPCNT(type,name,params,...) \ ++ static type __attribute__((target ("popcnt"))) fast_##name params \ ++ __VA_ARGS__ ++#define POPCNTHDR(type,name,params,...) \ ++ SLOWPOPCNT(type,name,params,__VA_ARGS__) \ ++ FASTPOPCNT(type,name,params,__VA_ARGS__) \ ++ static void __attribute__((optimize ("O0"))) \ ++ (*resolve_##name (void))(void) { \ ++ unsigned int eax, ebx, ecx, edx; \ ++ return (__get_cpuid(1, &eax, &ebx, &ecx, &edx) && \ ++ (ecx & bit_POPCNT) != 0) \ ++ ? (void (*)(void))&fast_##name \ ++ : (void (*)(void))&slow_##name; \ ++ } ++#define POPCNTFUNC(type,name,params,...) \ ++ POPCNTHDR(type,name,params,__VA_ARGS__) \ ++ type __attribute__((ifunc ("resolve_" #name))) name params; ++#define STATIC_POPCNTFUNC(type,name,params,...) \ ++ POPCNTHDR(type,name,params,__VA_ARGS__) \ ++ static type __attribute__((ifunc ("resolve_" #name))) name params; ++#else ++#define POPCNTFUNC(type,name,params,...) type name params __VA_ARGS__ ++#define STATIC_POPCNTFUNC(type,name,params,...) \ ++ static type name params __VA_ARGS__ ++#endif ++ + #ifdef NAUTY_IN_MAGMA + #undef POPCOUNT + #undef FIRSTBIT +@@ -1035,6 +1077,18 @@ extern void free(void*); + #define CONDYNFREE(name,name_sz,minsz) \ + if (name_sz > (size_t)(minsz)) {DYNFREE(name,name_sz);} + ++#if MAXN ++#define DCL_DYNINT(var) int var[MAXN] ++#define DCL_DYNSET(var) setword var[MAXM] ++#define DEF_DYNINT(var,n,name) ++#define DEF_DYNSET(var,n,name) ++#else ++#define DCL_DYNINT(var) DYNALLSTAT(int,var,var##_sz) ++#define DCL_DYNSET(var) DYNALLSTAT(set,var,var##_sz) ++#define DEF_DYNINT(var,n,name) DYNALLOC1(int,var,var##_sz,n,name) ++#define DEF_DYNSET(var,n,name) DYNALLOC1(set,var,var##_sz,n,name) ++#endif ++ + /* File to write error messages to (used as first argument to fprintf()). */ + #define ERRFILE stderr + +--- a/vcolg.c ++++ b/vcolg.c +@@ -130,6 +130,22 @@ testmax(int *p, int n, int *abort) + + /**************************************************************************/ + ++#ifndef OUTPROC ++STATIC_POPCNTFUNC(size_t __attribute__((pure)),compute_degree, ++(const graph *g, int m, int n), ++{ ++ const graph *gi; ++ size_t ne; ++ ++ ne = 0; ++ for (gi = g + m*(size_t)n; --gi >= g; ) ++ ne += POPCOUNT(*gi); ++ return ne / 2; ++}) ++#endif ++ ++/**************************************************************************/ ++ + static int + trythisone(grouprec *group, graph *g, int m, int n) + /* Try one solution, accept if maximal. */ +@@ -174,10 +190,7 @@ trythisone(grouprec *group, graph *g, in + #ifdef OUTPROC + OUTPROC(outfile,g,col,m,n); + #else +- ne = 0; +- for (gi = g + m*(size_t)n; --gi >= g; ) +- ne += POPCOUNT(*gi); +- ne /= 2; ++ ne = compute_degree(g,m,n); + fprintf(outfile,"%d %lu",n,(unsigned long)ne); + + for (i = 0; i < n; ++i) fprintf(outfile," %d",col[i]); +--- a/watercluster2.c ++++ b/watercluster2.c +@@ -557,7 +557,7 @@ void decode_to_nauty(unsigned char *code + + /****************************************INIT_FOR_G6*****************************/ + +-void init_for_g6(graph g[],int aantal_toppen, int degree[]) ++STATIC_POPCNTFUNC(void,init_for_g6,(graph g[],int aantal_toppen, int degree[]), + { + int i; + +@@ -569,7 +569,7 @@ void init_for_g6(graph g[],int aantal_to + aantal_gerichte_bogen=0; + return; + +-} ++}) + + + /***************************FILL_EDGELIST**************************/ +@@ -1202,7 +1202,8 @@ void construct_operations_in(int list[], + + /**********************************CONSTRUCT_EXTENSIONS**************************/ + +-void construct_extensions(int still_open[], int orbit[], graph touched, int first_in_orbit, graph sameorbit) ++STATIC_POPCNTFUNC(void,construct_extensions, ++ (int still_open[], int orbit[], graph touched, int first_in_orbit, graph sameorbit), + { + int top, top2, j, end, list[MAXN], decided[MAXN], error, lowerlimit_outdeg, readylist[MAXN], *readyrun, dummy; + int minout, do_double=0, i, mindouble; +@@ -1362,7 +1363,7 @@ for (number_operations=0; (top=(*still_o + } + } + return; +-} ++}) + + int compare_op(unsigned char *op1, unsigned char *op2) + // returns 0 if operations are the same, something negative if op1 +@@ -1489,7 +1490,8 @@ void compute_edgeorbits(int edgelist[][2 + + /******************************CANONICAL****************************/ + +-int canonical(unsigned char operation[], int vertexorbit[], int *newgroup, int orbitid, graph touched) ++STATIC_POPCNTFUNC(int,canonical, ++ (unsigned char operation[], int vertexorbit[], int *newgroup, int orbitid, graph touched), + + // checks whether the operation is canonical in vertexorbit. Returns 1 if yes, 0 otherwise. + // In newgroup it is stored whether a new group has been computed for this (*newgroup=1) or not +@@ -1786,7 +1788,7 @@ int canonical(unsigned char operation[], + else { return 0; } + + +-} ++}) + + int all_diff_colours(graph testset, int orbitid) + // returns 1 if all elements have some different vertex invariant and 0 otherwise +@@ -3728,7 +3730,7 @@ int test_possible(graph globalg[],int gl + + + +-void waterclusters (graph g[], int n) ++STATIC_POPCNTFUNC(void,waterclusters,(graph g[], int n), + { + int i, j, k, orbitsize, start, end, fixed_edge, dummy, maxgraphdeg, biggest_orbit; + BOOG kleinste_orbit[MAX_BOGEN+1]; /* het is mogelijk dat er maar 1 orbit is */ +@@ -3891,7 +3893,7 @@ void waterclusters (graph g[], int n) + + + return; +-} ++}) + + + diff --git a/nauty-tool-prefix.patch b/nauty-tool-prefix.patch new file mode 100644 index 0000000..27b7524 --- /dev/null +++ b/nauty-tool-prefix.patch @@ -0,0 +1,568 @@ +Description: debianization: nauty tools suite prefix + Prepend nauty- to the names of the nauty tools, named gtools. +Author: Jerome Benoit +Last-Update: 2016-03-19 + +--- a/Makefile.am ++++ b/Makefile.am +@@ -21,94 +21,94 @@ + bin_PROGRAMS = \ + dreadnaut \ + \ +- addedgeg \ +- amtog \ +- biplabg \ +- catg \ +- complg \ +- converseg \ +- copyg \ +- countg \ +- cubhamg \ +- deledgeg \ +- delptg \ +- directg \ +- dretodot \ +- dretog \ +- genbg \ +- genbgL \ +- geng \ +- genquarticg \ +- genrang \ +- genspecialg \ +- gentourng \ +- gentreeg \ +- hamheuristic \ +- labelg \ +- linegraphg \ +- listg \ +- multig \ +- newedgeg \ +- NRswitchg \ +- pickg \ +- planarg \ +- ranlabg \ +- shortg \ +- showg \ +- subdivideg \ +- twohamg \ +- vcolg \ +- watercluster2 \ ++ nauty-addedgeg \ ++ nauty-amtog \ ++ nauty-biplabg \ ++ nauty-catg \ ++ nauty-complg \ ++ nauty-converseg \ ++ nauty-copyg \ ++ nauty-countg \ ++ nauty-cubhamg \ ++ nauty-deledgeg \ ++ nauty-delptg \ ++ nauty-directg \ ++ nauty-dretodot \ ++ nauty-dretog \ ++ nauty-genbg \ ++ nauty-genbgL \ ++ nauty-geng \ ++ nauty-genquarticg \ ++ nauty-genrang \ ++ nauty-genspecialg \ ++ nauty-gentourng \ ++ nauty-gentreeg \ ++ nauty-hamheuristic \ ++ nauty-labelg \ ++ nauty-linegraphg \ ++ nauty-listg \ ++ nauty-multig \ ++ nauty-newedgeg \ ++ nauty-NRswitchg \ ++ nauty-pickg \ ++ nauty-planarg \ ++ nauty-ranlabg \ ++ nauty-shortg \ ++ nauty-showg \ ++ nauty-subdivideg \ ++ nauty-twohamg \ ++ nauty-vcolg \ ++ nauty-watercluster2 \ + \ +- blisstog \ +- checks6 \ +- sumlines ++ nauty-blisstog \ ++ nauty-checks6 \ ++ nauty-sumlines + + man_MANS = \ + dreadnaut.1 \ + \ +- addedgeg.1 \ +- amtog.1 \ +- biplabg.1 \ +- catg.1 \ +- complg.1 \ +- converseg.1 \ +- copyg.1 \ +- countg.1 \ +- cubhamg.1 \ +- deledgeg.1 \ +- delptg.1 \ +- directg.1 \ +- dretodot.1 \ +- dretog.1 \ +- genbg.1 \ +- genbgL.1 \ +- geng.1 \ +- genquarticg.1 \ +- genrang.1 \ +- genspecialg.1 \ +- gentourng.1 \ +- gentreeg.1 \ +- hamheuristic.1 \ +- labelg.1 \ +- linegraphg.1 \ +- listg.1 \ +- multig.1 \ +- newedgeg.1 \ +- NRswitchg.1 \ +- pickg.1 \ +- planarg.1 \ +- ranlabg.1 \ +- shortg.1 \ +- showg.1 \ +- subdivideg.1 \ +- twohamg.1 \ +- vcolg.1 \ +- watercluster2.1 \ ++ nauty-addedgeg.1 \ ++ nauty-amtog.1 \ ++ nauty-biplabg.1 \ ++ nauty-catg.1 \ ++ nauty-complg.1 \ ++ nauty-converseg.1 \ ++ nauty-copyg.1 \ ++ nauty-countg.1 \ ++ nauty-cubhamg.1 \ ++ nauty-deledgeg.1 \ ++ nauty-delptg.1 \ ++ nauty-directg.1 \ ++ nauty-dretodot.1 \ ++ nauty-dretog.1 \ ++ nauty-genbg.1 \ ++ nauty-genbgL.1 \ ++ nauty-geng.1 \ ++ nauty-genquarticg.1 \ ++ nauty-genrang.1 \ ++ nauty-genspecialg.1 \ ++ nauty-gentourng.1 \ ++ nauty-gentreeg.1 \ ++ nauty-hamheuristic.1 \ ++ nauty-labelg.1 \ ++ nauty-linegraphg.1 \ ++ nauty-listg.1 \ ++ nauty-multig.1 \ ++ nauty-newedgeg.1 \ ++ nauty-NRswitchg.1 \ ++ nauty-pickg.1 \ ++ nauty-planarg.1 \ ++ nauty-ranlabg.1 \ ++ nauty-shortg.1 \ ++ nauty-showg.1 \ ++ nauty-subdivideg.1 \ ++ nauty-twohamg.1 \ ++ nauty-vcolg.1 \ ++ nauty-watercluster2.1 \ + \ +- blisstog.1 \ +- checks6.1 \ +- sumlines.1 ++ nauty-blisstog.1 \ ++ nauty-checks6.1 \ ++ nauty-sumlines.1 + + lib_LTLIBRARIES = \ + libnauty.la \ +@@ -153,8 +153,8 @@ + $(HELP2MAN) \ + -s 1 \ + $(AM_H2MFLAGS) \ +- -I $(top_srcdir)/man/$*.h2m \ +- -n $(if $($*_DESCRIPTION), $($*_DESCRIPTION), "manual page for $*") \ ++ -I $(top_srcdir)/man/$(subst nauty-,,$*).h2m \ ++ -n $(if $($(subst -,_,$*)_DESCRIPTION), $($(subst -,_,$*)_DESCRIPTION), "manual page for $*") \ + -o $@ \ + $(top_builddir)/$< + +@@ -175,176 +175,176 @@ + ## short descriptions inspired from the basic functions of the programs as described + ## in section `Utilities' (15) of the `Nauty and Traces User's Guide' (version 2.6) + dreadnaut_DESCRIPTION = "command line interface to nauty graph isomorphism library" +-addedgeg_DESCRIPTION = "add an edge in each possible way" +-amtog_DESCRIPTION = "read graphs in matrix format" +-biplabg_DESCRIPTION = "label bipartite graphs so the colour classes are contiguous" +-catg_DESCRIPTION = "concatenate files of graphs" +-complg_DESCRIPTION = "complement graphs" +-converseg_DESCRIPTION = "converse digraphs" +-copyg_DESCRIPTION = "convert format and select subset" +-countg_DESCRIPTION = "count graphs according to a variety of properties" +-cubhamg_DESCRIPTION = "find hamiltonian cycles in subcubic graphs" +-deledgeg_DESCRIPTION = "delete an edge in each possible way" +-delptg_DESCRIPTION = "delete vertices" +-directg_DESCRIPTION = "generate small digraphs with given underlying graph" +-dretodot_DESCRIPTION = "read graphs and initial coloring in dreadnaut format and write in dot format" +-dretog_DESCRIPTION = "read graphs in dreadnaut format" +-genbg_DESCRIPTION = "generate small bicoloured graphs" +-genbgL_DESCRIPTION = "$(shell printf "%s %s" $(genbg_DESCRIPTION) "(L1 flavour)")" +-geng_DESCRIPTION = "generate small graphs" +-genquarticg_DESCRIPTION = "generate quartic graphs" +-genrang_DESCRIPTION = "generate random graphs" +-genspecialg_DESCRIPTION = "generate special graphs" +-gentourng_DESCRIPTION = "generate small tournaments" +-gentreeg_DESCRIPTION = "generate trees" +-hamheuristic_DESCRIPTION = "try to find hamiltonian cycles in any graphs" +-labelg_DESCRIPTION = "canonically label graphs" +-linegraphg_DESCRIPTION = "compute the linegraphs of a file of graphs" +-listg_DESCRIPTION = "display graphs in a variety of forms" +-multig_DESCRIPTION = "generate small multigraphs with given underlying graph" +-newedgeg_DESCRIPTION = "create new edges from pairs of non-adjacent edges in each possible way" +-NRswitchg_DESCRIPTION = "complement vertex edges" +-pickg_DESCRIPTION = "select graphs according to a variety of properties" +-planarg_DESCRIPTION = "test graphs for planarity and find embeddings or obstructions" +-ranlabg_DESCRIPTION = "randomly relabel graphs" +-shortg_DESCRIPTION = "remove isomorphs from a file of graphs" +-showg_DESCRIPTION = "$(shell printf "%s %s" $(listg_DESCRIPTION) "(stand-alone subset of listg)")" +-subdivideg_DESCRIPTION = "compute the subdivision graphs of a file of graphs" +-twohamg_DESCRIPTION = "split quartic graphs into two hamiltonian cycles" +-vcolg_DESCRIPTION = "colour the vertices of graphs in all distinct ways" +-watercluster2_DESCRIPTION = "$(shell printf "%s %s" $(directg_DESCRIPTION) "(faster alternative to directg)")" +-blisstog_DESCRIPTION = "convert files of graphs in bliss format to stdout in sparse6 format" +-checks6_DESCRIPTION = "check a file of graphs and optionally perform corrections" +-sumlines_DESCRIPTION = "sum lines matching specified graph formats" ++nauty_addedgeg_DESCRIPTION = "add an edge in each possible way" ++nauty_amtog_DESCRIPTION = "read graphs in matrix format" ++nauty_biplabg_DESCRIPTION = "label bipartite graphs so the colour classes are contiguous" ++nauty_catg_DESCRIPTION = "concatenate files of graphs" ++nauty_complg_DESCRIPTION = "complement graphs" ++nauty_converseg_DESCRIPTION = "converse digraphs" ++nauty_copyg_DESCRIPTION = "convert format and select subset" ++nauty_countg_DESCRIPTION = "count graphs according to a variety of properties" ++nauty_cubhamg_DESCRIPTION = "find hamiltonian cycles in subcubic graphs" ++nauty_deledgeg_DESCRIPTION = "delete an edge in each possible way" ++nauty_delptg_DESCRIPTION = "delete vertices" ++nauty_directg_DESCRIPTION = "generate small digraphs with given underlying graph" ++nauty_dretodot_DESCRIPTION = "read graphs and initial coloring in dreadnaut format and write in dot format" ++nauty_dretog_DESCRIPTION = "read graphs in dreadnaut format" ++nauty_genbg_DESCRIPTION = "generate small bicoloured graphs" ++nauty_genbgL_DESCRIPTION = "$(shell printf "%s %s" $(nauty_genbg_DESCRIPTION) "(L1 flavour)")" ++nauty_geng_DESCRIPTION = "generate small graphs" ++nauty_genquarticg_DESCRIPTION = "generate quartic graphs" ++nauty_genrang_DESCRIPTION = "generate random graphs" ++nauty_genspecialg_DESCRIPTION = "generate special graphs" ++nauty_gentourng_DESCRIPTION = "generate small tournaments" ++nauty_gentreeg_DESCRIPTION = "generate trees" ++nauty_hamheuristic_DESCRIPTION = "try to find hamiltonian cycles in any graphs" ++nauty_labelg_DESCRIPTION = "canonically label graphs" ++nauty_linegraphg_DESCRIPTION = "compute the linegraphs of a file of graphs" ++nauty_listg_DESCRIPTION = "display graphs in a variety of forms" ++nauty_multig_DESCRIPTION = "generate small multigraphs with given underlying graph" ++nauty_newedgeg_DESCRIPTION = "create new edges from pairs of non-adjacent edges in each possible way" ++nauty_NRswitchg_DESCRIPTION = "complement vertex edges" ++nauty_pickg_DESCRIPTION = "select graphs according to a variety of properties" ++nauty_planarg_DESCRIPTION = "test graphs for planarity and find embeddings or obstructions" ++nauty_ranlabg_DESCRIPTION = "randomly relabel graphs" ++nauty_shortg_DESCRIPTION = "remove isomorphs from a file of graphs" ++nauty_showg_DESCRIPTION = "$(shell printf "%s %s" $(nauty_listg_DESCRIPTION) "(stand-alone subset of listg)")" ++nauty_subdivideg_DESCRIPTION = "compute the subdivision graphs of a file of graphs" ++nauty_twohamg_DESCRIPTION = "split quartic graphs into two hamiltonian cycles" ++nauty_vcolg_DESCRIPTION = "colour the vertices of graphs in all distinct ways" ++nauty_watercluster2_DESCRIPTION = "$(shell printf "%s %s" $(nauty_directg_DESCRIPTION) "(faster alternative to directg)")" ++nauty_blisstog_DESCRIPTION = "convert files of graphs in bliss format to stdout in sparse6 format" ++nauty_checks6_DESCRIPTION = "check a file of graphs and optionally perform corrections" ++nauty_sumlines_DESCRIPTION = "sum lines matching specified graph formats" + + dreadnaut_CPPFLAGS = +-addedgeg_CPPFLAGS = +-amtog_CPPFLAGS = +-biplabg_CPPFLAGS = +-catg_CPPFLAGS = +-complg_CPPFLAGS = +-converseg_CPPFLAGS = +-copyg_CPPFLAGS = +-countg_CPPFLAGS = +-cubhamg_CPPFLAGS = +-deledgeg_CPPFLAGS = +-delptg_CPPFLAGS = +-directg_CPPFLAGS = +-dretodot_CPPFLAGS = +-dretog_CPPFLAGS = +-genbg_CPPFLAGS = $(nautyW1_flavour_CPPFLAGS) +-genbgL_CPPFLAGS = $(nautyL1_flavour_CPPFLAGS) -DMAXN1=30 +-geng_CPPFLAGS = $(nautyW1_flavour_CPPFLAGS) +-genquarticg_CPPFLAGS = $(nautyL1_flavour_CPPFLAGS) +-genrang_CPPFLAGS = +-genspecialg_CPPFLAGS = +-gentourng_CPPFLAGS = -DMAXN=24 +-gentreeg_CPPFLAGS = +-hamheuristic_CPPFLAGS = +-labelg_CPPFLAGS = +-linegraphg_CPPFLAGS = +-listg_CPPFLAGS = +-multig_CPPFLAGS = +-newedgeg_CPPFLAGS = +-NRswitchg_CPPFLAGS = +-pickg_CPPFLAGS = +-planarg_CPPFLAGS = +-ranlabg_CPPFLAGS = +-shortg_CPPFLAGS = +-showg_CPPFLAGS = +-subdivideg_CPPFLAGS = +-twohamg_CPPFLAGS = +-vcolg_CPPFLAGS = +-watercluster2_CPPFLAGS = -DMAXN=32 +-blisstog_CPPFLAGS = $(ZLIB_CFLAGS) +-checks6_CPPFLAGS = +-sumlines_CPPFLAGS = $(GMP_CFLAGS) ++nauty_addedgeg_CPPFLAGS = ++nauty_amtog_CPPFLAGS = ++nauty_biplabg_CPPFLAGS = ++nauty_catg_CPPFLAGS = ++nauty_complg_CPPFLAGS = ++nauty_converseg_CPPFLAGS = ++nauty_copyg_CPPFLAGS = ++nauty_countg_CPPFLAGS = ++nauty_cubhamg_CPPFLAGS = ++nauty_deledgeg_CPPFLAGS = ++nauty_delptg_CPPFLAGS = ++nauty_directg_CPPFLAGS = ++nauty_dretodot_CPPFLAGS = ++nauty_dretog_CPPFLAGS = ++nauty_genbg_CPPFLAGS = $(nautyW1_flavour_CPPFLAGS) ++nauty_genbgL_CPPFLAGS = $(nautyL1_flavour_CPPFLAGS) -DMAXN1=30 ++nauty_geng_CPPFLAGS = $(nautyW1_flavour_CPPFLAGS) ++nauty_genquarticg_CPPFLAGS = $(nautyL1_flavour_CPPFLAGS) ++nauty_genrang_CPPFLAGS = ++nauty_genspecialg_CPPFLAGS = ++nauty_gentourng_CPPFLAGS = -DMAXN=24 ++nauty_gentreeg_CPPFLAGS = ++nauty_hamheuristic_CPPFLAGS = ++nauty_labelg_CPPFLAGS = ++nauty_linegraphg_CPPFLAGS = ++nauty_listg_CPPFLAGS = ++nauty_multig_CPPFLAGS = ++nauty_newedgeg_CPPFLAGS = ++nauty_NRswitchg_CPPFLAGS = ++nauty_pickg_CPPFLAGS = ++nauty_planarg_CPPFLAGS = ++nauty_ranlabg_CPPFLAGS = ++nauty_shortg_CPPFLAGS = ++nauty_showg_CPPFLAGS = ++nauty_subdivideg_CPPFLAGS = ++nauty_twohamg_CPPFLAGS = ++nauty_vcolg_CPPFLAGS = ++nauty_watercluster2_CPPFLAGS = -DMAXN=32 ++nauty_blisstog_CPPFLAGS = $(ZLIB_CFLAGS) ++nauty_checks6_CPPFLAGS = ++nauty_sumlines_CPPFLAGS = $(GMP_CFLAGS) + + dreadnaut_SOURCES = dreadnaut.c +-addedgeg_SOURCES = addedgeg.c +-amtog_SOURCES = amtog.c +-biplabg_SOURCES = biplabg.c +-catg_SOURCES = catg.c +-complg_SOURCES = complg.c +-converseg_SOURCES = converseg.c +-copyg_SOURCES = copyg.c +-countg_SOURCES = testg.c +-cubhamg_SOURCES = cubhamg.c +-deledgeg_SOURCES = deledgeg.c +-delptg_SOURCES = delptg.c +-directg_SOURCES = directg.c +-dretodot_SOURCES = dretodot.c +-dretog_SOURCES = dretog.c +-genbg_SOURCES = genbg.c +-genbgL_SOURCES = genbg.c +-geng_SOURCES = geng.c +-genquarticg_SOURCES = genquarticg.c +-genrang_SOURCES = genrang.c +-genspecialg_SOURCES = genspecialg.c +-gentourng_SOURCES = gentourng.c +-gentreeg_SOURCES = gentreeg.c +-hamheuristic_SOURCES = hamheuristic.c +-labelg_SOURCES = labelg.c +-linegraphg_SOURCES = linegraphg.c +-listg_SOURCES = listg.c +-multig_SOURCES = multig.c +-newedgeg_SOURCES = newedgeg.c +-NRswitchg_SOURCES = NRswitchg.c +-pickg_SOURCES = testg.c +-planarg_SOURCES = planarg.c planarity.c +-ranlabg_SOURCES = ranlabg.c +-shortg_SOURCES = shortg.c +-showg_SOURCES = showg.c +-subdivideg_SOURCES = subdivideg.c +-twohamg_SOURCES = twohamg.c +-vcolg_SOURCES = vcolg.c +-watercluster2_SOURCES = watercluster2.c +-blisstog_SOURCES = blisstog.c +-checks6_SOURCES = checks6.c +-sumlines_SOURCES = sumlines.c ++nauty_addedgeg_SOURCES = addedgeg.c ++nauty_amtog_SOURCES = amtog.c ++nauty_biplabg_SOURCES = biplabg.c ++nauty_catg_SOURCES = catg.c ++nauty_complg_SOURCES = complg.c ++nauty_converseg_SOURCES = converseg.c ++nauty_copyg_SOURCES = copyg.c ++nauty_countg_SOURCES = testg.c ++nauty_cubhamg_SOURCES = cubhamg.c ++nauty_deledgeg_SOURCES = deledgeg.c ++nauty_delptg_SOURCES = delptg.c ++nauty_directg_SOURCES = directg.c ++nauty_dretodot_SOURCES = dretodot.c ++nauty_dretog_SOURCES = dretog.c ++nauty_genbg_SOURCES = genbg.c ++nauty_genbgL_SOURCES = genbg.c ++nauty_geng_SOURCES = geng.c ++nauty_genquarticg_SOURCES = genquarticg.c ++nauty_genrang_SOURCES = genrang.c ++nauty_genspecialg_SOURCES = genspecialg.c ++nauty_gentourng_SOURCES = gentourng.c ++nauty_gentreeg_SOURCES = gentreeg.c ++nauty_hamheuristic_SOURCES = hamheuristic.c ++nauty_labelg_SOURCES = labelg.c ++nauty_linegraphg_SOURCES = linegraphg.c ++nauty_listg_SOURCES = listg.c ++nauty_multig_SOURCES = multig.c ++nauty_newedgeg_SOURCES = newedgeg.c ++nauty_NRswitchg_SOURCES = NRswitchg.c ++nauty_pickg_SOURCES = testg.c ++nauty_planarg_SOURCES = planarg.c planarity.c ++nauty_ranlabg_SOURCES = ranlabg.c ++nauty_shortg_SOURCES = shortg.c ++nauty_showg_SOURCES = showg.c ++nauty_subdivideg_SOURCES = subdivideg.c ++nauty_twohamg_SOURCES = twohamg.c ++nauty_vcolg_SOURCES = vcolg.c ++nauty_watercluster2_SOURCES = watercluster2.c ++nauty_blisstog_SOURCES = blisstog.c ++nauty_checks6_SOURCES = checks6.c ++nauty_sumlines_SOURCES = sumlines.c + + dreadnaut_LDADD = $(NAUTY_LDADD) +-addedgeg_LDADD = $(NAUTY_LDADD) +-amtog_LDADD = $(NAUTY_LDADD) +-biplabg_LDADD = $(NAUTY_LDADD) +-catg_LDADD = $(NAUTY_LDADD) +-complg_LDADD = $(NAUTY_LDADD) +-converseg_LDADD = $(NAUTY_LDADD) +-copyg_LDADD = $(NAUTY_LDADD) +-countg_LDADD = $(NAUTY_LDADD) +-cubhamg_LDADD = $(NAUTY_LDADD) +-deledgeg_LDADD = $(NAUTY_LDADD) +-delptg_LDADD = $(NAUTY_LDADD) +-directg_LDADD = $(NAUTY_LDADD) +-dretodot_LDADD = $(NAUTY_LDADD) $(LIBM) +-dretog_LDADD = $(NAUTY_LDADD) +-genbg_LDADD = $(NAUTYW1_LDADD) +-genbgL_LDADD = $(NAUTYL1_LDADD) +-geng_LDADD = $(NAUTYW1_LDADD) +-genquarticg_LDADD = $(NAUTYL1_LDADD) +-genrang_LDADD = $(NAUTY_LDADD) +-genspecialg_LDADD = $(NAUTY_LDADD) +-gentourng_LDADD = $(NAUTY_LDADD) +-gentreeg_LDADD = $(NAUTY_LDADD) +-hamheuristic_LDADD = $(NAUTY_LDADD) +-labelg_LDADD = $(NAUTY_LDADD) +-linegraphg_LDADD = $(NAUTY_LDADD) +-listg_LDADD = $(NAUTY_LDADD) +-multig_LDADD = $(NAUTY_LDADD) +-newedgeg_LDADD = $(NAUTY_LDADD) +-NRswitchg_LDADD = $(NAUTY_LDADD) +-pickg_LDADD = $(NAUTY_LDADD) +-planarg_LDADD = $(NAUTY_LDADD) +-ranlabg_LDADD = $(NAUTY_LDADD) +-shortg_LDADD = $(NAUTY_LDADD) +-showg_LDADD = +-subdivideg_LDADD = $(NAUTY_LDADD) +-twohamg_LDADD = $(NAUTY_LDADD) +-vcolg_LDADD = $(NAUTY_LDADD) +-watercluster2_LDADD = $(NAUTY_LDADD) +-blisstog_LDADD = $(NAUTY_LDADD) $(ZLIB_LIBS) +-checks6_LDADD = $(NAUTY_LDADD) +-sumlines_LDADD = $(GMP_LIBS) ++nauty_addedgeg_LDADD = $(NAUTY_LDADD) ++nauty_amtog_LDADD = $(NAUTY_LDADD) ++nauty_biplabg_LDADD = $(NAUTY_LDADD) ++nauty_catg_LDADD = $(NAUTY_LDADD) ++nauty_complg_LDADD = $(NAUTY_LDADD) ++nauty_converseg_LDADD = $(NAUTY_LDADD) ++nauty_copyg_LDADD = $(NAUTY_LDADD) ++nauty_countg_LDADD = $(NAUTY_LDADD) ++nauty_cubhamg_LDADD = $(NAUTY_LDADD) ++nauty_deledgeg_LDADD = $(NAUTY_LDADD) ++nauty_delptg_LDADD = $(NAUTY_LDADD) ++nauty_directg_LDADD = $(NAUTY_LDADD) ++nauty_dretodot_LDADD = $(NAUTY_LDADD) $(LIBM) ++nauty_dretog_LDADD = $(NAUTY_LDADD) ++nauty_genbg_LDADD = $(NAUTYW1_LDADD) ++nauty_genbgL_LDADD = $(NAUTYL1_LDADD) ++nauty_geng_LDADD = $(NAUTYW1_LDADD) ++nauty_genquarticg_LDADD = $(NAUTYL1_LDADD) ++nauty_genrang_LDADD = $(NAUTY_LDADD) ++nauty_genspecialg_LDADD = $(NAUTY_LDADD) ++nauty_gentourng_LDADD = $(NAUTY_LDADD) ++nauty_gentreeg_LDADD = $(NAUTY_LDADD) ++nauty_hamheuristic_LDADD = $(NAUTY_LDADD) ++nauty_labelg_LDADD = $(NAUTY_LDADD) ++nauty_linegraphg_LDADD = $(NAUTY_LDADD) ++nauty_listg_LDADD = $(NAUTY_LDADD) ++nauty_multig_LDADD = $(NAUTY_LDADD) ++nauty_newedgeg_LDADD = $(NAUTY_LDADD) ++nauty_NRswitchg_LDADD = $(NAUTY_LDADD) ++nauty_pickg_LDADD = $(NAUTY_LDADD) ++nauty_planarg_LDADD = $(NAUTY_LDADD) ++nauty_ranlabg_LDADD = $(NAUTY_LDADD) ++nauty_shortg_LDADD = $(NAUTY_LDADD) ++nauty_showg_LDADD = ++nauty_subdivideg_LDADD = $(NAUTY_LDADD) ++nauty_twohamg_LDADD = $(NAUTY_LDADD) ++nauty_vcolg_LDADD = $(NAUTY_LDADD) ++nauty_watercluster2_LDADD = $(NAUTY_LDADD) ++nauty_blisstog_LDADD = $(NAUTY_LDADD) $(ZLIB_LIBS) ++nauty_checks6_LDADD = $(NAUTY_LDADD) ++nauty_sumlines_LDADD = $(GMP_LIBS) + + libnauty_la_LD_VERSION_SCRIPT = + libnautyA1_la_MAP = +--- a/runalltests ++++ b/runalltests +@@ -30,7 +30,7 @@ + eval $cmd <"$in" 2>$out2 >$out1 + + if [ -d $top_workingdir/.libs ]; then +- sed -i 's@'$top_workingdir'/.libs/lt-@./@' $out2 ++ sed -i 's@'$top_workingdir'/.libs/lt-nauty-@./@' $out2 + fi + + LC_COLLATE=C sort $out2 >>$out1 +@@ -82,13 +82,13 @@ + runonetest ./dreadtest4K nautest2.dre nautest2a.ans + runonetest "./dreadtest4K -o As" nautest2.dre nautest2b.ans + +-runonetest "./geng -ud1D7t 11" "" nautesta.ans +-runonetest "./geng -cd1f 10 | ./labelg -q" "" nautestb.ans +-runonetest "./genrang -r3 114 100 | ./countg --nedDr -q" "" nautestc.ans +-runonetest "./gentourng -q -z 8 | ./pickg -T3" "" nautestd.ans +-runonetest "./gentreeg -q -s 18 | ./countg -z6 --o" "" nauteste.ans +-runonetest "./geng -c -q 8 8 | ./directg -q -o | ./converseg -q | ./labelg -q" "" nautestf.ans +-runonetest "./genbg -q 4 3 10 | ./vcolg -m6 -T" "" nautestg.ans ++runonetest "./nauty-geng -ud1D7t 11" "" nautesta.ans ++runonetest "./nauty-geng -cd1f 10 | ./nauty-labelg -q" "" nautestb.ans ++runonetest "./nauty-genrang -r3 114 100 | ./nauty-countg --nedDr -q" "" nautestc.ans ++runonetest "./nauty-gentourng -q -z 8 | ./nauty-pickg -T3" "" nautestd.ans ++runonetest "./nauty-gentreeg -q -s 18 | ./nauty-countg -z6 --o" "" nauteste.ans ++runonetest "./nauty-geng -c -q 8 8 | ./nauty-directg -q -o | ./nauty-converseg -q | ./nauty-labelg -q" "" nautestf.ans ++runonetest "./nauty-genbg -q 4 3 10 | ./nauty-vcolg -m6 -T" "" nautestg.ans + + echo " " + diff --git a/nauty-zlib-blisstog.patch b/nauty-zlib-blisstog.patch new file mode 100644 index 0000000..1ad5103 --- /dev/null +++ b/nauty-zlib-blisstog.patch @@ -0,0 +1,211 @@ +Description: implement zlib support to blisstog utility + zlib is implemented to handle directly flate and compress files + for the blisstog nauty tool. +Origin: debian +Author: Jerome Benoit +Last-Update: 2016-03-18 + +--- a/blisstog.c ++++ b/blisstog.c +@@ -9,45 +9,37 @@ + -n#:# Specify a range of n values for output\n\ + Input files with name *.gz are ungzipped\n" + +-#define ZCAT "gunzip -c" /* name of zcat command (might be "gunzip -c") */ +- + /*************************************************************************/ + ++#include + #include "gtools.h" + ++#define BUFSIZE 256 ++ + typedef struct + { + int v,w; + } vpair; + +-static int +-nextchar(FILE *f) +-{ +- char s[2]; +- +- if (fscanf(f,"%1s",s) != 1) return EOF; +- else return s[0]; +-} +- + static boolean +-readblissgraph(FILE *f, sparsegraph *g) ++readblissgraph(gzFile f, sparsegraph *g) + /* Reads a graph from Bliss format into a sparse graph */ + { +- int n,c; ++ int n; + unsigned long ne,j; + int haven; + int i,v,w; +- int haveptn; + DYNALLSTAT(vpair,elist,elist_sz); ++ char buffer[BUFSIZE]; + ++ memset(buffer, '\0', BUFSIZE); + haven = 0; + j = 0; +- while ((c = nextchar(f)) >= 0) ++ while (gzgets(f, buffer, BUFSIZE) != NULL && strlen(buffer) < BUFSIZE - 1) + { +- switch (c) ++ switch (*buffer) + { + case 'c': +- while ((c = getc(f)) != '\n' && c != EOF) {} + break; + + case 'p': +@@ -56,7 +48,7 @@ + fprintf(stderr,"Duplicate p line\n"); + exit(1); + } +- if (fscanf(f," edge %d %lu",&n,&ne) != 2) ++ if (sscanf(buffer,"p edge %d %lu",&n,&ne) != 2) + { + fprintf(stderr,"Bad p line\n"); + return FALSE; +@@ -71,7 +63,7 @@ + fprintf(stderr,"Missing p line\n"); + return FALSE; + } +- if (fscanf(f,"%d%d",&w,&v) != 2 || w < 1 || w > n) ++ if (sscanf(buffer,"n %d%d",&w,&v) != 2 || w < 1 || w > n) + { + fprintf(stderr,"Bad n line\n"); + return FALSE; +@@ -84,7 +76,7 @@ + fprintf(stderr,"Missing p line or too many e lines\n"); + return FALSE; + } +- if (fscanf(f,"%d%d",&v,&w) != 2 || v < 1 || w < 1 || v > n || w > n) ++ if (sscanf(buffer,"e %d%d",&v,&w) != 2 || v < 1 || w < 1 || v > n || w > n) + { + fprintf(stderr,"Bad e line\n"); + return FALSE; +@@ -94,11 +86,22 @@ + break; + + default: +- fprintf(stderr,"Unknown line %c\n",c); ++ fprintf(stderr,"Unknown line\n"); + return FALSE; + } + } + ++ if (errno) ++ { ++ fputs("Corrupted data file\n", stderr); ++ return FALSE; ++ } ++ else if (strlen(buffer) == BUFSIZE - 1) ++ { ++ fputs("Corruped data line\n", stderr); ++ return FALSE; ++ } ++ + if (j != ne) + { + fprintf(stderr,"Wrong number of e lines\n"); +@@ -135,13 +138,10 @@ + int + main(int argc, char *argv[]) + { +- FILE *infile; ++ gzFile infile; + int j,firstarg; + SG_DECL(g); +- size_t flen; +- boolean ispipe; + int nmin,nmax; +- char zcmd[515]; + + HELP; PUTVERSION; + +@@ -160,53 +160,46 @@ + + if (argc == firstarg) + { +- if (!readblissgraph(stdin,&g)) ++ if ((infile = gzdopen(STDIN_FILENO,"r")) == NULL) + { +- fprintf(stderr,">E Bliss error in file %s\n","stdin"); ++ fputs(">E Can't open stdin\n", stderr); + gt_abort(NULL); + } + else +- writes6_sg(stdout,&g); ++ { ++ if (!readblissgraph(stdin,&g)) ++ { ++ fprintf(stderr,">E Bliss error in file %s\n","stdin"); ++ gt_abort(NULL); ++ } ++ else ++ writes6_sg(stdout,&g); ++ gzclose(infile); ++ } + } + else + { + for (j = firstarg; j < argc; ++j) + { +- flen = strlen(argv[j]); +- if (flen >= 3 && strcmp(argv[j]+flen-3,".gz") == 0) +- { +- sprintf(zcmd,"%s \"%s\"",ZCAT,argv[j]); +- if ((infile = popen(zcmd,"r")) == NULL) +- { +- fprintf(stderr, +- ">E blisstog: cannot open zcat pipe for \"%s\"\n", +- argv[j]); +- gt_abort(NULL); +- } +- ispipe = TRUE; +- } +- else +- { +- if ((infile = fopen(argv[j],"r")) == NULL) +- { +- fprintf(stderr,">E Can't open file %s\n",argv[j]); +- gt_abort(NULL); +- } +- ispipe = FALSE; +- } +- +- if (!readblissgraph(infile,&g)) ++ if ((infile = gzopen(argv[j],"r")) == NULL) + { +- fprintf(stderr,">E Bliss error in file %s\n",argv[j]); ++ fprintf(stderr,">E Can't open file %s\n",argv[j]); + gt_abort(NULL); + } +- else if (nmax < 0 || (g.nv >= nmin && g.nv <= nmax)) +- { +- sortlists_sg(&g); +- writes6_sg(stdout,&g); ++ else ++ { ++ if (!readblissgraph(infile,&g)) ++ { ++ fprintf(stderr,">E Bliss error in file %s\n",argv[j]); ++ gt_abort(NULL); ++ } ++ else if (nmax < 0 || (g.nv >= nmin && g.nv <= nmax)) ++ { ++ sortlists_sg(&g); ++ writes6_sg(stdout,&g); ++ } ++ gzclose(infile); + } +- +- if (ispipe) pclose(infile); else fclose(infile); + } + } + diff --git a/nauty.spec b/nauty.spec new file mode 100644 index 0000000..2d523a8 --- /dev/null +++ b/nauty.spec @@ -0,0 +1,132 @@ +%global nautybasever 2.6r5 +%global nautytarver %(tr -d . <<< %{nautybasever}) + +Name: nauty +Version: %(tr r . <<< %{nautybasever}) +Release: 1%{?dist} +Summary: Graph canonical labeling and automorphism group computation + +License: ASL 2.0 +URL: http://pallini.di.uniroma1.it/ +Source0: http://pallini.di.uniroma1.it/%{name}%{nautytarver}.tar.gz + +# Debian patch to fix the gt_numorbits declaration +Patch0: %{name}-fix-gt_numorbits.patch +# Debian patch to add explicit extern declarations where needed +Patch1: %{name}-fix-include-extern.patch +# Debian patch to use zlib instead of invoking zcat through a pipe +Patch2: %{name}-zlib-blisstog.patch +# Debian patch to improve usage and help information +Patch3: %{name}-help2man.patch +# Debian patch to add libtool support for building a shared library +Patch4: %{name}-autotoolization.patch +# Debian patch to canonicalize header file usage +Patch5: %{name}-includes.patch +# Debian patch to prefix "nauty-" to the names of the generic tools +Patch6: %{name}-tool-prefix.patch +# Detect availability of the popcnt instruction at runtime +Patch7: %{name}-popcnt.patch + +BuildRequires: gcc +BuildRequires: gmp-devel +BuildRequires: help2man +BuildRequires: libtool +BuildRequires: zlib-devel + +# The shortg program invokes sort. +Requires: coreutils +Requires: lib%{name}%{?_isa} = %{version}-%{release} + +%description +Nauty and Traces are programs for computing automorphism groups of +graphs and digraphs. (At present, Traces does not accept digraphs.) +They can also produce a canonical label. They are written in a portable +subset of C, and run on a considerable number of different systems. + +There is a small suite of programs called gtools included in the +package. For example, geng can generate non-isomorphic graphs very +quickly. There are also generators for bipartite graphs, digraphs, and +multigraphs, and programs for manipulating files of graphs in a compact +format. + +%package -n libnauty +Summary: Library for graph automorphism + +%description -n libnauty +Nauty (No AUTomorphisms, Yes?) is a set of procedures for computing +automorphism groups of graphs and digraphs. This package contains a +library of nauty procedures. + +%package -n libnauty-devel +Summary: Development files for libnauty +Requires: lib%{name}%{?_isa} = %{version}-%{release} + +%description -n libnauty-devel +This package contains files needed to develop programs that use libnauty. + +%prep +%setup -q -n %{name}%{nautytarver} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 + +# Remove the pregenerated makefile +rm -f makefile + +# Inject the version number +sed -i 's/@INJECTVER@/%{version}/' configure.ac + +# Regenerate the configure script with libtool support +autoreconf -fi + +%build +export CFLAGS="%{optflags} -fwrapv" +%configure --disable-static \ +%ifarch %ix86 x86_64 + --enable-runtime-popcnt \ +%endif + --enable-tls +make %{?_smp_mflags} + +%install +make install DESTDIR=%{buildroot} + +# We do not want the libtool archives +rm %{buildroot}%{_libdir}/*.la + +%check +make check + +%post -n libnauty -p /sbin/ldconfig + +%postun -n libnauty -p /sbin/ldconfig + +%files +%doc README nug26.pdf +%{_bindir}/dreadnaut +%{_bindir}/nauty-* +%{_mandir}/man1/dreadnaut.1* +%{_mandir}/man1/nauty-*.1* + +%files -n libnauty +%doc changes24-26.txt formats.txt +%license COPYRIGHT +%{_libdir}/libnauty*.so.* + +%files -n libnauty-devel +%doc schreier.txt +%{_includedir}/nauty/ +%{_libdir}/libnauty*.so +%{_libdir}/pkgconfig/%{name}.pc + +%changelog +* Thu Apr 21 2016 Jerry James - 2.6.5-1 +- New upstream version + +* Fri Apr 15 2016 Jerry James - 2.6.4-1 +- Initial RPM diff --git a/sources b/sources index e69de29..f996f5c 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +91b03a7b069962e94fc9aac8831ce8d2 nauty26r5.tar.gz