I'm trying to install v3.1.2 of flint
into my account on the MPCDF HPC cluster.
I managed to install GMP 6.3.0, MPFR 4.2.1 in my home directory with ./configure --prefix=$HOME/software/<packagename>
for the two packages.
From the flint
directory,I followed the online docs and manage to get till the ./configure
step using:
>>> cd flint/
>>> ./bootstrap.sh
>>> ./configure --prefix=$HOME/software/flint/ --with-gmp-include=$HOME/software/gmp-6.3.0/include/ --with-gmp-lib=$HOME/software/gmp-6.3.0/lib/ --with-mpfr-include=$HOME/software/mpfr-4.2.1/include/ --with-mpfr-lib=$HOME/software/mpfr-4.2.1/lib/
However, when I move to the make
step, I get this output:
/usr/bin/mkdir -p build/generic_files
CC generic_files/inlines.c
CC generic_files/profiler.c
CC generic_files/sprintf.c
CC generic_files/fscanf.c
CC generic_files/memory_manager.c
In file included from ./src/thread_pool.h:15:0,
from src/generic_files/memory_manager.c:18:
./src/flint.h:154:28: error: unknown type name ‘_Thread_local’
# define FLINT_TLS_PREFIX _Thread_local
^
src/generic_files/memory_manager.c:340:1: note: in expansion of macro ‘FLINT_TLS_PREFIX’
FLINT_TLS_PREFIX size_t flint_num_cleanup_functions = 0;
^
src/generic_files/memory_manager.c:340:25: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘flint_num_cleanup_functions’
FLINT_TLS_PREFIX size_t flint_num_cleanup_functions = 0;
^
In file included from ./src/thread_pool.h:15:0,
from src/generic_files/memory_manager.c:18:
./src/flint.h:154:28: error: unknown type name ‘_Thread_local’
# define FLINT_TLS_PREFIX _Thread_local
^
src/generic_files/memory_manager.c:342:1: note: in expansion of macro ‘FLINT_TLS_PREFIX’
FLINT_TLS_PREFIX flint_cleanup_function_t * flint_cleanup_functions = NULL;
^
src/generic_files/memory_manager.c:342:43: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
FLINT_TLS_PREFIX flint_cleanup_function_t * flint_cleanup_functions = NULL;
^
src/generic_files/memory_manager.c: In function ‘flint_register_cleanup_function’:
src/generic_files/memory_manager.c:358:5: error: ‘flint_cleanup_functions’ undeclared (first use in this function)
flint_cleanup_functions = flint_realloc(flint_cleanup_functions,
^
src/generic_files/memory_manager.c:358:5: note: each undeclared identifier is reported only once for each function it appears in
src/generic_files/memory_manager.c:359:10: error: ‘flint_num_cleanup_functions’ undeclared (first use in this function)
(flint_num_cleanup_functions + 1) * sizeof(flint_cleanup_function_t));
^
src/generic_files/memory_manager.c: In function ‘_flint_cleanup’:
src/generic_files/memory_manager.c:380:21: error: ‘flint_num_cleanup_functions’ undeclared (first use in this function)
for (i = 0; i < flint_num_cleanup_functions; i++)
^
src/generic_files/memory_manager.c:381:9: error: ‘flint_cleanup_functions’ undeclared (first use in this function)
flint_cleanup_functions[i]();
^
src/generic_files/memory_manager.c: At top level:
cc1: warning: unrecognized command line option "-Wno-stringop-overread" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-stringop-overflow" [enabled by default]
Makefile:615: recipe for target 'build/generic_files/memory_manager.lo' failed
make: *** [build/generic_files/memory_manager.lo] Error 1
Can someone help me figure out where the problem is?
Your compiler is complaining about C's _Thread_local
keyword. This was new in C11, now 13 years old and obsoleted by C17, which itself is soon to give way to a new revision of the language. The format of the diagnostics and the fact that you tagged Linux suggest that you are using GCC to compile this code, but if so then it must be a fairly old version that defaults to C99.
However, as long as your GCC is not absurdly old, you should be able to instruct it to compile in C11 mode by adding the option -std=gnu11
to your CFLAGS
. I would recommend doing that at configure
time ...
CFLAGS='-std=gnu11' ./configure [...]
... but if you don't wnat to re-configure
then you can probably add the flag when you run make
, instead:
make CFLAGS='-std=gnu11'