On older Linux systems with glibc versions earlier than 2.34, building the sequential FORM executable with --enable-static-link against FLINT fails at the final link step with undefined pthread symbols because -pthread is missing from the linker flags.
Steps to reproduce:
docker run -it --rm ubuntu:20.04
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends automake ca-certificates curl g++ git make
curl -OL https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.gz
tar xf gmp-6.3.0.tar.gz
pushd gmp-6.3.0
./configure
make -j $(nproc)
make install
ldconfig
popd
curl -OL https://ftp.gnu.org/gnu/mpfr/mpfr-4.2.2.tar.gz
tar xf mpfr-4.2.2.tar.gz
pushd mpfr-4.2.2
./configure
make -j $(nproc)
make install
ldconfig
popd
curl -OL https://github.com/flintlib/flint/releases/download/v3.5.0/flint-3.5.0.tar.gz
tar xf flint-3.5.0.tar.gz
pushd flint-3.5.0
./configure --enable-static
make -j $(nproc)
make install
ldconfig
popd
git clone https://github.com/form-dev/form
pushd form
autoreconf -i
./configure --enable-static-link
make -j $(nproc)
g++ -std=gnu++11 -Wall -Wextra -O3 -static -o form form-argument.o form-checkpoint.o form-comexpr.o form-compcomm.o form-compiler.o form-compress.o form-comtool.o form-diagrams.o form-diawrap.o form-dict.o form-dollar.o form-execute.o form-extcmd.o form-factor.o form-features.o form-findpat.o form-function.o form-grcc.o form-if.o form-index.o form-lus.o form-message.o form-minos.o form-model.o form-module.o form-mytime.o form-names.o form-normal.o form-notation.o form-opera.o form-optimize.o form-pattern.o form-poly.o form-polyfact.o form-polygcd.o form-polywrap.o form-pre.o form-proces.o form-ratio.o form-reken.o form-reshuf.o form-sch.o form-setfile.o form-smart.o form-sort.o form-spectator.o form-startup.o form-store.o form-symmetr.o form-tables.o form-token.o form-tools.o form-transform.o form-wildcard.o form-unixfile.o form-flintinterface.o form-flintwrap.o form-evaluate.o form-float.o -lflint -lm -lm -lmpfr -lgmp
/usr/bin/ld: /usr/local/lib/libflint.a(fmpz_mod_poly_merged.o): in function `_fmpz_mod_poly_powers_mod_preinv_worker':
/flint-3.5.0/src/fmpz_mod_poly/powers_mod_bsgs_threaded.c:48: undefined reference to `pthread_mutex_lock'
/usr/bin/ld: /flint-3.5.0/src/fmpz_mod_poly/powers_mod_bsgs_threaded.c:53: undefined reference to `pthread_mutex_unlock'
... many more undefined references to pthread_* omitted ...
collect2: error: ld returned 1 exit status
On older Linux systems with glibc versions earlier than 2.34, building the sequential FORM executable with
--enable-static-linkagainst FLINT fails at the final link step with undefined pthread symbols because-pthreadis missing from the linker flags.Steps to reproduce: