Install FLINT

1,402 views
Skip to first unread message

Malay Sarkar

unread,
Jun 8, 2014, 3:01:43 AM6/8/14
to flint...@googlegroups.com
Hi,
  I have installed FLINT in my Ubuntu machine by the following comment from terminal
sudo apt-get install libflint-dev.

But when I run code by gcc test.c -lgmp  -lflint -lmpfr, I am getting error

test.c:4:19: fatal error: F_mpz.h: No such file or directory
 #include <F_mpz.h>
                   ^
compilation terminated.



My code:

#include<stdio.h>
#include<math.h>
#include<gmp.h>
#include <F_mpz.h>
#include<F_mpz_poly.h>
int main(){
mpz_t a,b;
mpz_init(a);

}

Bill Hart

unread,
Jun 8, 2014, 8:59:13 AM6/8/14
to flint-devel
That is a very old version of flint. It is better to build the latest version yourself from source.

Below I will assume your home directory is /home/malay. If not, you will have to change that path below. You may also like to use make -j instead of just make if you have multiple cores.


tar -xvf mpir-2.7.0-alpha4.tar.bz2
tar -xvf mpfr-3.1.2.tar.bz2
tar -xvf flint-2.4.3.tar.gz

cd mpir-2.7.0
./configure --enable-gmpcompat
make
cd ..

cd mpfr-3.1.2
./configure --with-gmp-build=/home/malay/mpir-2.7.0
make
cd ..

cd flint-2.4.3
./configure --with-mpir=/home/malay/mpir-2.7.0 --with-mpfr=/home/malay/mpfr-3.1.2
make
cd ..

Anyway, to answer your original question, you are missing 

   -I/home/malay/mpir-2.7.0 -I/home/malay/flint-2.4.3 

when running gcc above. It can't find flint.h, fmpz_poly.h or fmpz_mod_poly.h because you didn't tell it where to look. That's what the -I does. (that's I for include by the way, not the letter l). 

You will also need to tell it where to find the libraries by passing 

   -L/home/malay/mpir-2.7.0/.libs -L/home/malay/mpfr-3.1.2/src/.libs -L/home/malay/flint-2.4.3 

to gcc.

You should also have 

#include "flint.h"
#include "fmpz_poly.h" 
#include "fmpz_mod_poly.h"
 
i.e. using double quotes, not angle brackets, since they are not standard library headers.

Bill.




--

---
You received this message because you are subscribed to the Google Groups "flint-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flint-devel...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Malay Sarkar

unread,
Jun 25, 2014, 2:55:49 AM6/25/14
to flint...@googlegroups.com, goodwi...@googlemail.com
Thanks a lot. 

Jack Gold

unread,
Sep 24, 2017, 3:38:11 PM9/24/17
to flint-devel
Everything worked perfectly up to when I have to make flint and I get stuck on the following: I have been stuck for 4 days any help will be super appreciated as after this I need Singular4 as well:

make[1]: Entering directory '/home/rootme/Singular4_git/Singular4/flint/flint-2.4.3'
make[2]: Entering directory '/home/rootme/Singular4_git/Singular4/flint/flint-2.4.3/ulong_extras'
    CC   ../build/ulong_extras/compute_primes.lo
/home/rootme/Singular4_git/Singular4/flint/flint-2.4.3/flint.h: Assembler messages:
/home/rootme/Singular4_git/Singular4/flint/flint-2.4.3/flint.h:236: Error: incorrect register `%rdi' used with `l' suffix
../Makefile.subdirs:60: recipe for target '../build/ulong_extras/compute_primes.lo' failed
make[2]: *** [../build/ulong_extras/compute_primes.lo] Error 1
make[2]: Leaving directory '/home/rootme/Singular4_git/Singular4/flint/flint-2.4.3/ulong_extras'
Makefile:134: recipe for target 'libflint.so' failed
make[1]: *** [libflint.so] Error 2
make[1]: Leaving directory '/home/rootme/Singular4_git/Singular4/flint/flint-2.4.3'
Makefile:161: recipe for target 'library' failed
make: *** [library] Error 2

THANX GUYS

Bill Hart

unread,
Sep 24, 2017, 3:47:56 PM9/24/17
to flint-devel
The latest version of Flint is 2.5.2 (see flintlib.org). I would build that with MPIR 3.0.0 and MPFR 3.1.6 if you have Ubuntu.

We test Flint with Ubuntu all the time. There are no known build issues. Either you have a really old Ubuntu that is broken, or you are doing something incorrect.

If you can't get the latest Flint to build, please tell us exactly what you typed.


To unsubscribe from this group and stop receiving emails from it, send an email to flint-devel+unsubscribe@googlegroups.com.

Adam Majewski

unread,
Sep 27, 2017, 1:39:59 PM9/27/17
to flint-devel

Bill Hart

unread,
Sep 27, 2017, 2:07:34 PM9/27/17
to flint-devel
Thanks, this looks like a good resource to point people to.

--
Reply all
Reply to author
Forward
0 new messages