Skip to content

Commit

Permalink
Add CHECK_NMZ_PACKAGE autoconf macro for checking libnormaliz macros
Browse files Browse the repository at this point in the history
Use it for the e-antic check
  • Loading branch information
d-torrance committed Sep 9, 2024
1 parent 954e44c commit da17252
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions M2/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,19 @@ else AC_MSG_RESULT([no, will build])
BUILD_csdp=yes
fi

AC_DEFUN([CHECK_NMZ_PACKAGE],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([
#include <libnormaliz/nmz_config.h>
], [
#ifdef $1
return 0;
#else
return 1;
#endif
])],
[LIBS="$LIBS $2"])])

AS_IF([test $BUILD_normaliz = no],
[AC_MSG_CHECKING(whether the package normaliz is installed)
AS_IF([command -v normaliz > /dev/null],
Expand All @@ -1031,18 +1044,7 @@ AS_IF([test $BUILD_normaliz = no],
AC_LANG(C++)
SAVELIBS=$LIBS
LIBS="$LIBS -lnormaliz -lnauty -lgmp"
dnl check if libnormaliz built w/ eantic
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([
#include <libnormaliz/nmz_config.h>
], [
#ifdef ENFNORMALIZ
return 0;
#else
return 1;
#endif
])],
[LIBS="$LIBS -leantic -leanticxx"])
CHECK_NMZ_PACKAGE([ENFNORMALIZ], [-leantic -leanticxx])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([
#include <libnormaliz/cone.h>
Expand Down

0 comments on commit da17252

Please sign in to comment.