Index: Singular/extra.cc
===================================================================
--- Singular/extra.cc	(revision a002227d0e50ac4235491c102686c6381abd1aab)
+++ Singular/extra.cc	(revision f0ccd06ea21f447e8111eb524c71bdd69bf50d4e)
@@ -141,5 +141,4 @@
 #endif
 
-
 // Define to enable many more system commands
 //#undef MAKE_DISTRIBUTION
@@ -148,4 +147,5 @@
 #endif
 
+#include <polys/flintconv.h>
 #include <polys/clapconv.h>
 #include <kernel/GBEngine/kstdfac.h>
@@ -168,4 +168,5 @@
 #include "pcv.h"
 #endif
+
 
 #ifdef __CYGWIN__
@@ -934,4 +935,29 @@
     }
     else
+  #endif
+  /* =================== LLL via Flint ==============================*/
+  #ifdef HAVE_FLINT
+  #ifdef FLINT_VER_2_4_5
+    if (strcmp(sys_cmd, "LLL_Flint") == 0)
+    {
+      if (h!=NULL)
+      {
+        res->rtyp=h->Typ();
+        if (h->Typ()==BIGINTMAT_CMD)
+        {
+          res->data=(char *)singflint_LLL((bigintmat*)h->Data());
+          return FALSE;
+        }
+        else if (h->Typ()==INTMAT_CMD)
+        {
+          res->data=(char *)singflint_LLL((intvec*)h->Data());
+          return FALSE;
+        }
+        else return TRUE;
+      }
+      else return TRUE;
+    }
+    else
+  #endif
   #endif
   /*==================== shift-test for freeGB  =================*/
Index: libpolys/configure.ac
===================================================================
--- libpolys/configure.ac	(revision a002227d0e50ac4235491c102686c6381abd1aab)
+++ libpolys/configure.ac	(revision f0ccd06ea21f447e8111eb524c71bdd69bf50d4e)
@@ -37,5 +37,5 @@
 LB_CHECK_GMP(3.1.1,,AC_MSG_ERROR([Unable to find GMP on your machine: please use --with-gmp=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)]))
 LB_CHECK_NTL(5.0,,AC_MSG_WARN([Unable to find NTL (which is strongly recommended) on your machine: please use --with-ntl=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)]))
-## LB_CHECK_FLINT(2.3,,AC_MSG_WARN([Unable to find FLINT (which is strongly recommended) on your machine: please use --with-flint=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)]))
+LB_CHECK_FLINT(2.3,,AC_MSG_WARN([Unable to find FLINT (which is strongly recommended) on your machine: please use --with-flint=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)]))
 
 
Index: libpolys/polys/Makefile.am
===================================================================
--- libpolys/polys/Makefile.am	(revision a002227d0e50ac4235491c102686c6381abd1aab)
+++ libpolys/polys/Makefile.am	(revision f0ccd06ea21f447e8111eb524c71bdd69bf50d4e)
@@ -35,5 +35,5 @@
         ${USE_P_PROCS_STATIC_CC} ${USE_P_PROCS_DYNAMIC_CC} mod_raw.cc \
         ext_fields/algext.cc ext_fields/transext.cc \
-	clapsing.cc clapconv.cc \
+	clapsing.cc clapconv.cc  flintconv.cc\
 	nc/old.gring.cc PolyEnumerator.cc
 
@@ -44,5 +44,5 @@
 	templates/p_Procs.h templates/p_MemAdd.h templates/p_MemCmp.h \
 	kbuckets.h sbuckets.h simpleideals.h weight.h matpol.h \
-	sparsmat.h clapsing.h clapconv.h coeffrings.h \
+	sparsmat.h clapsing.h clapconv.h coeffrings.h flintconv.h\
 	ext_fields/algext.h ext_fields/transext.h mod_raw.h  
 
Index: libpolys/polys/flintconv.cc
===================================================================
--- libpolys/polys/flintconv.cc	(revision f0ccd06ea21f447e8111eb524c71bdd69bf50d4e)
+++ libpolys/polys/flintconv.cc	(revision f0ccd06ea21f447e8111eb524c71bdd69bf50d4e)
@@ -0,0 +1,123 @@
+// emacs edit mode for this file is -*- C++ -*-
+/****************************************
+*  Computer Algebra System SINGULAR     *
+****************************************/
+/*
+* ABSTRACT: convert data between Singular and Flint
+*/
+
+
+
+
+
+#include <misc/auxiliary.h>
+#include "flintconv.h"
+#include <coeffs/coeffs.h>
+#include <polys/monomials/p_polys.h>
+
+#include <omalloc/omalloc.h>
+#include <coeffs/longrat.h>
+#include <coeffs/modulop.h>
+#include <polys/sbuckets.h>
+#include <polys/clapconv.h>
+
+#include "simpleideals.h"
+
+#ifdef HAVE_FLINT
+#ifdef FLINT_VER_2_4_5
+int convFlintISingI (fmpz_t f)
+{
+  int res;
+  res = fmpz_get_si(f);
+  return res;
+}
+
+void convSingIFlintI(fmpz_t f, int p)
+{
+  fmpz_set_si(f,p);
+  return;
+}
+
+void convFlintNSingN (mpz_t z, fmpz_t f)
+{
+  fmpz_get_mpz(z,f);
+}
+
+void convSingNFlintN(fmpz_t f, mpz_t z)
+{
+  fmpz_set_mpz(f,z);
+}
+
+
+bigintmat* singflint_LLL(bigintmat*  m)
+{
+  int r=m->rows();
+  int c=m->cols();
+  bigintmat* res=new bigintmat(r,c,m->basecoeffs());
+  fmpz_mat_t M;
+  fmpz_mat_init(M, r, c);
+  fmpz_t dummy;
+  mpz_t n;
+  int i,j;
+  for(i=r;i>0;i--)
+  {
+    for(j=c;j>0;j--)
+    {
+      n_MPZ(n, BIMATELEM(*m, i, j),m->basecoeffs());
+      convSingNFlintN(dummy,n);
+      fmpz_set(fmpz_mat_entry(M, i-1, j-1), dummy);
+    }
+  }
+  fmpz_lll_t fl;
+  fmpz_lll_context_init_default(fl);
+  //printf("\nBefore LLL (in Flint)\n");fmpz_mat_print(M);
+  fmpz_lll(M, NULL, fl);
+  //printf("\nAfter LLL (in Flint)\n");fmpz_mat_print(M);printf("\n\n");
+  for(i=r;i>0;i--)
+  {
+    for(j=c;j>0;j--)
+    {
+      //printf("\nThis is here:\n");fmpz_print(fmpz_mat_entry(M, i-1, j-1));
+      convFlintNSingN(n, fmpz_mat_entry(M, i-1, j-1));
+      BIMATELEM(*res,i,j)=n_InitMPZ(n,m->basecoeffs());
+      //printf("\nThis is res[%i] = %i\n", i+j, *res[i+j]);
+    }
+  }
+  return res;
+}
+
+intvec* singflint_LLL(intvec*  m)
+{
+  int r=m->rows();
+  int c=m->cols();
+  intvec* res = new intvec(r,c,(int)0);
+  fmpz_mat_t M;
+  fmpz_mat_init(M, r, c);
+  fmpz_t dummy;
+  int i,j;
+  for(i=r;i>0;i--)
+  {
+    for(j=c;j>0;j--)
+    {
+      convSingIFlintI(dummy,IMATELEM(*m,i,j));
+      fmpz_set(fmpz_mat_entry(M, i-1, j-1), dummy);
+    }
+  }
+  fmpz_lll_t fl;
+  fmpz_lll_context_init_default(fl);
+  //printf("\nBefore LLL (in Flint)\n");fmpz_mat_print(M);
+  fmpz_lll(M, NULL, fl);
+  //printf("\nAfter LLL (in Flint)\n");fmpz_mat_print(M);printf("\n\n");
+  for(i=r;i>0;i--)
+  {
+    for(j=c;j>0;j--)
+    {
+      //printf("\nThis is here:\n");fmpz_print(fmpz_mat_entry(M, i-1, j-1));
+      IMATELEM(*res,i,j)=convFlintISingI(fmpz_mat_entry(M, i-1, j-1));
+      //printf("\nThis is res[%i] = %i\n", i+j, *res[i+j]);
+    }
+  }
+  return res;
+}
+#endif
+#endif
Index: libpolys/polys/flintconv.h
===================================================================
--- libpolys/polys/flintconv.h	(revision f0ccd06ea21f447e8111eb524c71bdd69bf50d4e)
+++ libpolys/polys/flintconv.h	(revision f0ccd06ea21f447e8111eb524c71bdd69bf50d4e)
@@ -0,0 +1,34 @@
+// emacs edit mode for this file is -*- C++ -*-
+/****************************************
+*  Computer Algebra System SINGULAR     *
+****************************************/
+/*
+* ABSTRACT: convert data between Singular and Flint
+*/
+
+
+#include <polys/monomials/ring.h>
+//#include <factory/factory.h>
+#ifdef HAVE_FLINT
+
+#include <flint/fmpz_poly.h>
+#include <flint/fmpz_lll.h>
+#include <flint/fmpz_poly_mat.h>
+
+#endif
+#include <polys/matpol.h>
+#include <coeffs/bigintmat.h>
+
+//  Have to define this when the new version of Flint is released
+//#define FLINT_VER_2_4_5
+
+#ifdef HAVE_FLINT
+#ifdef FLINT_VER_2_4_5
+int convFlintISingI (fmpz_t f);
+void convSingIFlintI(fmpz_t f, int p);
+void convFlintNSingN (mpz_t z, fmpz_t f);
+void convSingNFlintN(fmpz_t f, mpz_t z);
+bigintmat*  singflint_LLL(bigintmat* A);
+intvec* singflint_LLL(intvec* A);
+#endif
+#endif
