Building gmp-mpfr-sys fails on Arch because of "long long reliability test"

I'm using the crate rug, which uses gmp-mpfr-sys. When doing cargo check with my project, I get the error

  checking build system type... zen3-pc-linux-gnu
  checking host system type... zen3-pc-linux-gnu
  checking for a BSD-compatible install... /usr/bin/install -c
  checking whether build environment is sane... yes
  checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
  checking for gawk... gawk
  checking whether make sets $(MAKE)... yes
  checking whether make supports nested variables... yes
  checking whether to enable maintainer-specific portions of Makefiles... no
  checking ABI=64
  checking compiler gcc -O2 -pedantic -fomit-frame-pointer -m64 ... no, long long reliability test 1
  checking whether cc is gcc... yes
  checking compiler cc -O2 -pedantic -fomit-frame-pointer -m64 ... no, long long reliability test 1
  checking ABI=x32
  checking compiler gcc -O2 -pedantic -fomit-frame-pointer -mx32 ... no
  checking whether cc is gcc... yes
  checking compiler cc -O2 -pedantic -fomit-frame-pointer -mx32 ... no
  checking ABI=32
  checking compiler gcc -m32 -O2 -pedantic -fomit-frame-pointer ... no, long long reliability test 1
  checking compiler gcc -O2 -pedantic -fomit-frame-pointer ... no, long long reliability test 1
  checking compiler icc -no-gcc ... no
  checking whether cc is gcc... yes
  checking compiler cc -m32 -O2 -pedantic -fomit-frame-pointer ... no, long long reliability test 1
  checking compiler cc -O2 -pedantic -fomit-frame-pointer ... no, long long reliability test 1

while building gmp-mpfr-sys. A pure C project that uses gmp compiles successfully.

How do I fix this? gcc and clang are installed.

Relevant seems Fix building with GCC 15 by c2h5oh · Pull Request #9643 · SoftFever/OrcaSlicer · GitHub Does that mean that I just have to wait for an updated gcc?

A workaround is:

[dependencies.gmp-mpfr-sys]
version = "1.6"
default-features = false
features = ["use-system-libs"]

[dependencies.rug]
version = "1.27"
default-features = false
features = ["integer", "std"]

Is that project dynamically linking to a system copy of the gmp library or is it building it from scratch?

The issue in your Rust code appears to be while building the C gmp library from scratch.

2 Likes

Probably yes. So it would not be a Rust problem.

I'm having the same issue and the fix worked. However, how can we know when it is "safe" to use the newest version? Do we look on releases of gmp?

Another workaround is to use clang. I was able to compile it using CC=clang cargo build

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.