./configure fails to find gmp.h

37 views
Skip to first unread message

dracodrago1330

unread,
Jul 29, 2024, 8:24:47 PM7/29/24
to flint-devel
hello,

recently, i've been trying to build flint from source. this issue is present with both flint 3.1.2 and flint 3.1.3. after running the bootstrap script, ./configure fails to detect gmp.h:

...
checking for gmp.h... no
configure: error: Could not find gmp.h

this error originates from line 165 of acinclude.m4. config.log has:

configure:5763: checking for gmp.h
configure:5763: gcc -c   -I/usr/local/include conftest.c >&5
configure:5763: $? = 0
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "FLINT"
| #define PACKAGE_TARNAME "flint"
| #define PACKAGE_VERSION "3.1.3"
| #define PACKAGE_STRING "FLINT 3.1.3"
| #define PACKAGE_BUGREPORT "https://github.com/flintlib/flint/issues/"
| #define PACKAGE_URL "https://flintlib.org/"
| #ifndef __cplusplus
| #define inline
| #endif
| /* end confdefs.h.  */
| #include <stddef.h>
| #ifdef HAVE_STDIO_H
| # include <stdio.h>
| #endif
| #ifdef HAVE_STDLIB_H
| # include <stdlib.h>
| #endif
| #ifdef HAVE_STRING_H
| # include <string.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| #include <gmp.h>
configure:5763: result: no
configure:5768: error: Could not find gmp.h

both gmp.h and gmpxx.h are present in /usr/local/include and the error persists even when specifying --with-gmp=/usr/local or building gmp into its own install directory and using that for --with-gmp. can anyone provide any insight into this error, or should i file a bug report?

Edgar Costa

unread,
Jul 30, 2024, 7:39:26 AM7/30/24
to flint...@googlegroups.com
Are you sure the file "/usr/local/include/gmp.h" exists?
The compiler is trying to compile a file that, for all practical purposes, is equivalent to the single line "#include <gmp.h>"

--

---
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.
To view this discussion on the web, visit https://groups.google.com/d/msgid/flint-devel/6e4c04b4-8a0d-466e-b218-cd9b270b96bcn%40googlegroups.com.

dracodrago1330

unread,
Jul 30, 2024, 3:23:26 PM7/30/24
to flint-devel
here's the result of ls -lh /usr/local/include:

total 280K
-rw-r--r-- 1 root root  83K Jul 29 17:43 gmp.h
-rw-r--r-- 1 root root 127K Jul 29 17:43 gmpxx.h
-rw-r--r-- 1 root root 6.5K Jul 29 13:35 mpf2mpfr.h
-rw-r--r-- 1 root root  57K Jul 29 13:35 mpfr.h

this is a standard and quite fresh debian install, so i can't see any issues with the system being present.

Edgar Costa

unread,
Jul 30, 2024, 3:30:22 PM7/30/24
to flint...@googlegroups.com
can you do: ls -ld /usr/local/include?


> this is a standard and quite fresh debian install, so i can't see any issues with the system being present.

I'm not sure about that. You could have just installed gmp via apt.
"/usr/local" is intended for software and files that are installed locally by the system administrator, as opposed to software that is part of the operating system's standard distribution, e.g., gmp.

Grégory Vanuxem

unread,
Jul 30, 2024, 3:50:02 PM7/30/24
to flint...@googlegroups.com
Hello,

Are you using gcc-14 from Debian unstable? If so can you test that
gcc-13 is installed with:

dpkg -l gcc-*

If not, 'sudo apt install gcc-13' and after issuing in your terminal
'export CC=gcc-13' do a configure?

Greg
> --
>
> ---
> 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.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/flint-devel/CA%2BiQ7x4SCJRjSxBBdGYY_Vo_E5Jpew%3Dj7rjZYAS1BZXo2YgqHA%40mail.gmail.com.

dracodrago1330

unread,
Jul 30, 2024, 5:27:03 PM7/30/24
to flint-devel
edgar, sorry that i didn't mention it, but i built gmp and mpfr from source. i believe they installed successfully. i was able to compile another program that has #include <gmp.h>.
here is the result of ls -ld /usr/local/include:

drwxr-xr-x 1 root root 56 Jul 29 17:43 /usr/local/include

greg, i was unable to find any package labeled as "gcc-13". i've tried configuring with gcc 12.2.0 and clang 14.0.6, both installed from apt.

Edgar Costa

unread,
Jul 30, 2024, 5:46:54 PM7/30/24
to flint...@googlegroups.com
I think you will need to send us the whole config.log.

./configure is simply doing something as simple as:

echo "#include <gmp.h>\n int main(){}" | gcc -o /dev/null -x c -

dracodrago1330

unread,
Aug 2, 2024, 9:52:06 AM8/2/24
to flint-devel
i don't know what happened, but it now runs without error... the only thing that changed between then and now was several reboots, but otherwise i didn't touch gmp or flint!
i guess the problem is fixed???
Reply all
Reply to author
Forward
0 new messages