Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flint configure fails when using system GMP in certain cases #28409

Closed
embray opened this issue Aug 26, 2019 · 4 comments
Closed

Flint configure fails when using system GMP in certain cases #28409

embray opened this issue Aug 26, 2019 · 4 comments

Comments

@embray
Copy link
Contributor

embray commented Aug 26, 2019

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

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

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...

CC: @dimpase @slel @wbhart @zerline

Component: build: configure

Keywords: flint

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/28409

@embray embray added this to the sage-8.9 milestone Aug 26, 2019
@embray
Copy link
Contributor Author

embray commented Dec 30, 2019

comment:2

Ticket retargeted after milestone closed

@embray embray modified the milestones: sage-8.9, sage-9.1 Dec 30, 2019
@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 20, 2020

comment:3

Possible dup: #27708

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 20, 2020

comment:4

Proposing to close this one as a duplicate

@mkoeppe mkoeppe removed this from the sage-9.1 milestone Mar 20, 2020
@dimpase
Copy link
Member

dimpase commented Mar 20, 2020

Reviewer: Dima Pasechnik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants