Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
build/pkgs/4ti2/spkg-configure.m4: New
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jun 23, 2021
1 parent 0f13173 commit 1c1c1c8
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions build/pkgs/4ti2/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
SAGE_SPKG_CONFIGURE([4ti2], [
SAGE_SPKG_DEPCHECK([gmp mpir glpk zlib], [
dnl Debian installs these programs with an executable prefix "4ti2-"
dnl but polymake and our own code do not handle this yet (Singular does).
m4_foreach([prog], [hilbert,markov,graver,zsolve,qsolve,rays,ppi,circuits,groebner],
AC_CHECK_PROGS([FOURTITWO_]m4_toupper(prog), prog)
AS_VAR_IF([FOURTITWO_]m4_toupper(prog), [""], [sage_spkg_install_4ti2=yes])
)
dnl Adapted from https://github.com/latte-int/latte/blob/master/m4/4ti2-check.m4
AC_MSG_CHECKING(for library 4ti2gmp)
BACKUP_CXXFLAGS=${CXXFLAGS}
BACKUP_LIBS=${LIBS}
FORTYTWO_CXXFLAGS="-D__STDC_LIMIT_MACROS -D_4ti2_GMP_"
FORTYTWO_LIBS="-l4ti2gmp -lzsolve"
CXXFLAGS="${BACKUP_CXXFLAGS} ${FORTYTWO_CXXFLAGS} ${GMP_CFLAGS}"
LIBS="${BACKUP_LIBS} ${FORTYTWO_LIBS} ${GMP_LIBS}"
AC_TRY_LINK([
#include "4ti2/4ti2.h"
],
[ _4ti2_rays_create_state(_4ti2_PREC_INT_ARB);
], [
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
sage_spkg_install_4ti2=yes
])
CXXFLAGS=${BACKUP_CXXFLAGS}
LIBS=${BACKUP_LIBS}
])
])

0 comments on commit 1c1c1c8

Please sign in to comment.