Opened 3 years ago

Closed 3 years ago

#27567 closed enhancement (fixed)

Add --with-system-<spkg> options to configure

Reported by: embray Owned by:
Priority: major Milestone: sage-8.8
Component: build: configure Keywords:
Cc: dimpase, jdemeyer, jhpalmieri Merged in:
Authors: Erik Bray Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: b6aa97f (Commits, GitHub, GitLab) Commit: b6aa97f710e21d282146e4e84c65935afba49f86
Dependencies: Stopgaps:

Status badges

Description

As discussed in other tickets, such as #27373 and #26899, it would sometimes be useful to be able to explicitly specify, at configure-time, whether or not a system package can be used to fulfill some SPKG dependency.

With the work being done for #27330, it is currently the case that if an SPKG has a spkg-configure.m4, and the checks performed for the system package succeed, then the system package will always be used whether you want to or not.

This is a problem because even of the configure-time checks succeed, there could be previously unknown or unanticipated problems with using a particular version of the system package or some package+platform combination.

Therefore it is useful (if unfortunate) to be able to force use of the SPKG and disable checking for the system package. In principle we would want to react to the broken package+platform combination as well, either by fixing it somehow or blacklisting that particular combination at configure-time. However, by providing this option, we at least don't have to react immediately to such problems if/when they arise (e.g. #26899).

This ticket adds a --with-system-<spkg> flag to configure; e.g. --with-system-zlib. By default this is enabled (the current behavior), but by passing --with-system-zlib=no or --without-system-zlib then the SPKG will be installed without checking the system for the dependency.

This also adds the option to pass --with-system-zlib=force meaning that if the dependency cannot be found on the system then configure will abort with an error message.

This would effectively replace #21538.

Change History (8)

comment:1 Changed 3 years ago by embray

  • Authors set to Erik Bray
  • Branch set to u/embray/build/system-package-configure-flag
  • Cc dimpase jdemeyer jhpalmieri added
  • Commit set to afe116ad0ba2c62a5b8a0572b8c3faeb2df98828
  • Status changed from new to needs_review

This would provide at least a partial workaround to #26899. Knowing (as we do now) that using the system zlib is problematic on some OSX's (in this case due to a bug in python). With this feature we can at least tell users to run make configure; ./configure --without-system-zlib as a workaround.

I think this might also be useful for resolving #27373, though I don't believe it's strictly necessary for that either.

I'm certainly open to revisions on the concept, but I do believe that such a flag, however it's named, is useful.


New commits:

afe116aTrac #27567: Add --with-system-<spkg> options to configure

comment:2 Changed 3 years ago by git

  • Commit changed from afe116ad0ba2c62a5b8a0572b8c3faeb2df98828 to b6aa97f710e21d282146e4e84c65935afba49f86

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

b6aa97fTrac #27567: Add --with-system-<spkg> options to configure

comment:3 follow-up: Changed 3 years ago by dimpase

for uniformity with mpir/gmp etc, I'd name it --with-zlib= which takes values system/install, and the default is system.

comment:4 in reply to: ↑ 3 Changed 3 years ago by embray

Replying to dimpase:

for uniformity with mpir/gmp etc, I'd name it --with-zlib= which takes values system/install, and the default is system.

We might need to modify some other macros (e.g. AX_CHECK_ZLIB) which already provides a --with-zlib option.

comment:5 Changed 3 years ago by embray

This is the relevant portion of what ./configure --help currently looks like with this branch:

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-python=2         build and use Python 2 (default)
  --with-python=3         build and use Python 3
  --with-mp=mpir          use MPIR as multiprecision library (default)
  --with-mp=gmp           use GMP as multiprecision library
  --with-blas=openblas    use OpenBLAS as BLAS library (default)
  --with-blas=atlas       use ATLAS as BLAS library
  --with-system-gcc       detect and use an existing system gcc (default
                          is yes)
  --with-system-gcc=force require use of an existing system gcc
  --with-system-zeromq    detect and use an existing system zeromq (default
                          is yes)
  --with-system-zeromq=force
                          require use of an existing system zeromq
  --with-zmq=<prefix>     ZMQ prefix directory
  --with-system-git       detect and use an existing system git (default
                          is yes)
  --with-system-git=force require use of an existing system git
  --with-system-libffi    detect and use an existing system libffi (default
                          is yes)
  --with-system-libffi=force
                          require use of an existing system libffi
  --with-system-gf2x      detect and use an existing system gf2x (default
                          is yes)
  --with-system-gf2x=force
                          require use of an existing system gf2x
  --with-system-yasm      detect and use an existing system yasm (default
                          is yes)
  --with-system-yasm=force
                          require use of an existing system yasm
  --with-system-xz        detect and use an existing system xz (default
                          is yes)
  --with-system-xz=force  require use of an existing system xz
  --with-lzma=DIR         root directory path of lzma installation [defaults to
                          /usr/local or /usr if not found in /usr/local]
  --without-lzma          to disable lzma usage completely
  --with-system-bzip2     detect and use an existing system bzip2 (default
                          is yes)
  --with-system-bzip2=force
                          require use of an existing system bzip2
  --with-system-gfortran  detect and use an existing system gfortran (default
                          is yes)
  --with-system-gfortran=force
                          require use of an existing system gfortran
  --with-system-zlib      detect and use an existing system zlib (default
                          is yes)
  --with-system-zlib=force
                          require use of an existing system zlib
  --with-zlib=DIR         root directory path of zlib installation [defaults to
                          /usr/local or /usr if not found in /usr/local]
  --without-zlib          to disable zlib usage completely
  --with-system-curl      detect and use an existing system curl (default
                          is yes)
  --with-system-curl=force
                          require use of an existing system curl
  --with-system-patch     detect and use an existing system patch (default
                          is yes)
  --with-system-patch=force
                          require use of an existing system patch

Last edited 3 years ago by embray (previous) (diff)

comment:6 Changed 3 years ago by dimpase

ah OK, it's fine then.

comment:7 Changed 3 years ago by dimpase

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

looks good to me.

comment:8 Changed 3 years ago by vbraun

  • Branch changed from u/embray/build/system-package-configure-flag to b6aa97f710e21d282146e4e84c65935afba49f86
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.