Opened 3 years ago

Closed 2 years ago

#28409 closed defect (duplicate)

Flint configure fails when using system GMP in certain cases

Reported by: embray Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: build: configure Keywords: flint
Cc: dimpase, slelievre, wbhart, zerline Merged in:
Authors: Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


The hand-written configure script for flint has a clause like this:

if [ -d "${GMP_DIR}/lib" ]; then
elif [ -d "${GMP_DIR}/lib64" ]; then
elif [ -d "${GMP_DIR}/.libs" ]; then
   echo "Invalid GMP directory"
   exit 1

By default, if --with-gmp is not given, it just arbitrarily defaults to GMP_DIR=/usr/local. This means that if none of the directories /usr/local/lib, /usr/local/lib64, or /usr/local/.libs exist (note: this has nothing directly to do with detecting GMP), the script will exit with an error code.

It does something similar with MPFR and NTL.

I don't have a strong opinion on how to deal with this. We could either patch it out. Or we could point it to a directory that does exist (e.g. $SAGE_LOCAL/lib, even if GMP is not actually installed there). Or write some more sophisticated detection code for GMP, though I feel that such efforts are often overkill: The way autoconf works w.r.t. system packages is if the headers and libraries are in the default paths searched by the compiler/linker then it shouldn't be necessary to provide additional flags.

In other words, flint's configure, without an explicit --with-gmp, shouldn't and needn't do anything to try to provide an otherwise bogus path for GMP...

Change History (6)

comment:1 Changed 3 years ago by slelievre

  • Cc slelievre wbhart added

comment:2 Changed 2 years ago by embray

  • Milestone changed from sage-8.9 to sage-9.1

Ticket retargeted after milestone closed

comment:3 Changed 2 years ago by mkoeppe

Possible dup: #27708

comment:4 Changed 2 years ago by mkoeppe

  • Milestone changed from sage-9.1 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

Proposing to close this one as a duplicate

comment:5 Changed 2 years ago by dimpase

  • Reviewers set to Dima Pasechnik
  • Status changed from needs_review to positive_review

comment:6 Changed 2 years ago by chapoton

  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.