Skip to content

Commit

Permalink
Trac #27822: Update configure with checks for mpfr, mpc, and ntl
Browse files Browse the repository at this point in the history
This ticket bundles together #27258, #27259, and #27265 in such a way
that the configure tarball is updated to contain the configure changes
from each of those tickets.

Once all three have been merged (or at the same time) this ticket can
also be merged to bump the configure version.

'''Updated configure''':
http://users.ox.ac.uk/~coml0531/sage/configure-321.tar.gz

URL: https://trac.sagemath.org/27822
Reported by: embray
Ticket author(s): Erik Bray
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager committed May 24, 2019
2 parents 7be0ec6 + cb88c8d commit b1fa411
Show file tree
Hide file tree
Showing 18 changed files with 145 additions and 20 deletions.
4 changes: 2 additions & 2 deletions build/pkgs/arb/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ cd src
# be removed in arb >= 2.8 when it is released
export EXTRA_SHARED_FLAGS=$LDFLAGS

./configure --disable-static --prefix="$SAGE_LOCAL" $SAGE_CONFIGURE_GMP \
--with-flint="$SAGE_LOCAL" --with-mpfr="$SAGE_LOCAL" || \
./configure --disable-static --prefix="$SAGE_LOCAL" --with-flint="$SAGE_LOCAL" \
$SAGE_CONFIGURE_GMP $SAGE_CONFIGURE_MPFR || \
sdh_die "Error configuring arb."

sdh_make verbose
Expand Down
5 changes: 4 additions & 1 deletion build/pkgs/barvinok/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ cd src
if [ -n "$SAGE_GMP_PREFIX" ]; then
GMP_CONFIGURE="--with-gmp-prefix=$SAGE_GMP_PREFIX"
fi
if [ -n "$SAGE_NTL_PREFIX" ]; then
NTL_CONFIGURE="--with-ntl-prefix=$SAGE_NTL_PREFIX"
fi

sdh_configure $GMP_CONFIGURE \
--with-ntl-prefix=${SAGE_LOCAL} \
$NTL_CONFIGURE \
--with-isl=system \
--with-polylib=system \
--enable-shared-barvinok
Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=c91befc71803600bcfcfa5637b8330f65dcf594c
md5=eee7fd54b6aa2131981ab46442fe09a0
cksum=2162906054
sha1=912a146042cdb1839b33e3bf2262440d60d122b2
md5=74659209f427e09f86deab7e40c3da8f
cksum=1443936693
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
320
321
2 changes: 1 addition & 1 deletion build/pkgs/deformation/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cd src
# Note: Not actually an autoconf-generated configure; doesn't support
# all standard flags, so we can't use sdh_configure
./configure --prefix="$SAGE_LOCAL" --disable-static \
$SAGE_CONFIGURE_GMP --with-mpfr="$SAGE_LOCAL" \
$SAGE_CONFIGURE_GMP $SAGE_CONFIGURE_MPFR \
--with-flint="$SAGE_LOCAL" || \
sdh_die "Failed to configure deformation"
sdh_make
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/eclib/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ rm -rf "$SAGE_LOCAL"/include/eclib/
cd src/


sdh_configure --with-ntl="$SAGE_LOCAL" \
sdh_configure $SAGE_CONFIGURE_NTL \
--with-pari="$SAGE_LOCAL" \
--with-flint="$SAGE_LOCAL" \
--with-boost="no" \
Expand Down
4 changes: 2 additions & 2 deletions build/pkgs/flint/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ echo "Configuring FLINT."
--disable-static \
--prefix="$SAGE_LOCAL" \
$SAGE_CONFIGURE_GMP \
--with-mpfr="$SAGE_LOCAL" \
--with-ntl="$SAGE_LOCAL" \
$SAGE_CONFIGURE_MPFR \
--with-ntl="$SAGE_NTL_PREFIX" \
$FLINT_CONFIGURE || sdh_die "Error: Failed to configure FLINT."

sdh_make verbose
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/gcc/build-gcc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fi
../src/configure \
--prefix="$SAGE_LOCAL" \
--with-local-prefix="$SAGE_LOCAL" \
$SAGE_CONFIGURE_GMP --with-mpfr="$SAGE_LOCAL" --with-mpc="$SAGE_LOCAL" \
$SAGE_CONFIGURE_GMP $SAGE_CONFIGURE_MPFR $SAGE_CONFIGURE_MPC \
--with-system-zlib \
--disable-multilib \
--disable-nls \
Expand Down
4 changes: 2 additions & 2 deletions build/pkgs/gdb/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ cd src
export LDFLAGS="${LDFLAGS} -L${SAGE_LOCAL}/lib -ltinfo"

sdh_configure \
--with-mpc="$SAGE_LOCAL" \
--with-mpfr="$SAGE_LOCAL" \
$SAGE_CONFIGURE_MPC \
$SAGE_CONFIGURE_MPFR \
$SAGE_CONFIGURE_GMP
sdh_make
sdh_make_install
2 changes: 1 addition & 1 deletion build/pkgs/latte_int/spkg-install
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cd src

sdh_configure --enable-shared=yes --enable-static=false \
$SAGE_CONFIGURE_GMP --with-ntl=$SAGE_LOCAL \
$SAGE_CONFIGURE_GMP $SAGE_CONFIGURE_NTL \
--with-cddlib=$SAGE_LOCAL --with-4ti2=$SAGE_LOCAL \
--with-lidia=$SAGE_LOCAL
sdh_make
Expand Down
21 changes: 21 additions & 0 deletions build/pkgs/mpc/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
SAGE_SPKG_CONFIGURE([mpc], [
AC_REQUIRE([SAGE_SPKG_CONFIGURE_MPFR])
AC_MSG_CHECKING([installing mpfr? ])
if test x$sage_spkg_install_mpfr = xyes; then
AC_MSG_RESULT([yes; install mpc as well])
sage_spkg_install_mpc=yes
else
AC_MSG_RESULT([no])
AC_CHECK_HEADER(mpc.h, [], [sage_spkg_install_mpc=yes])
dnl mpc_cmp_abs appeared in MPC 1.1.0
AC_SEARCH_LIBS([mpc_cmp_abs], [mpc], [break], [sage_spkg_install_mpc=yes])
fi
], [], [], [
if test x$sage_spkg_install_mpc = xyes; then
AC_SUBST(SAGE_MPC_PREFIX, ['$SAGE_LOCAL'])
AC_MSG_RESULT([using Sage's mpc SPKG])
else
AC_SUBST(SAGE_MPC_PREFIX, [''])
AC_MSG_RESULT([using mpc library from the system])
fi
])
2 changes: 1 addition & 1 deletion build/pkgs/mpc/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [ $UNAME = "CYGWIN" ]; then
fi

# Building
sdh_configure $SAGE_CONFIGURE_GMP --with-mpfr="$SAGE_LOCAL" $EXTRA
sdh_configure $SAGE_CONFIGURE_GMP $SAGE_CONFIGURE_MPFR $EXTRA
sdh_make

# Cleaning
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/mpfi/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cd src
# Use newer version of config.guess and config.sub (see Trac #19716)
cp "$SAGE_ROOT"/config/config.* .

sdh_configure --with-mpfr="$SAGE_LOCAL" $SAGE_CONFIGURE_GMP
sdh_configure $SAGE_CONFIGURE_MPFR $SAGE_CONFIGURE_GMP
sdh_make
sdh_make_install

Expand Down
21 changes: 21 additions & 0 deletions build/pkgs/mpfr/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
SAGE_SPKG_CONFIGURE([mpfr], [
AC_REQUIRE([SAGE_SPKG_CONFIGURE_GMP])
AC_MSG_CHECKING([installing gmp/mpir? ])
if test x$sage_spkg_install_mpir = xyes -o x$sage_spkg_install_gmp = xyes; then
AC_MSG_RESULT([yes; install mpfr as well])
sage_spkg_install_mpfr=yes
else
AC_MSG_RESULT([no])
AC_CHECK_HEADER(mpfr.h, [], [sage_spkg_install_mpfr=yes])
dnl mpfr_free_pool appeared in r11922 (Dec 2017) on MPFR svn
AC_SEARCH_LIBS([mpfr_free_pool], [mpfr], [break], [sage_spkg_install_mpfr=yes])
fi
], [], [], [
if test x$sage_spkg_install_mpfr = xyes; then
AC_SUBST(SAGE_MPFR_PREFIX, ['$SAGE_LOCAL'])
AC_MSG_RESULT([using Sage's mpfr SPKG])
else
AC_SUBST(SAGE_MPFR_PREFIX, [''])
AC_MSG_RESULT([using mpfr library from the system])
fi
])
4 changes: 2 additions & 2 deletions build/pkgs/mpfrcx/spkg-install
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cd src

sdh_configure $SAGE_CONFIGURE_GMP --with-mpfr="$SAGE_LOCAL" \
--with-mpc="$SAGE_LOCAL" --disable-static --enable-shared
sdh_configure $SAGE_CONFIGURE_GMP $SAGE_CONFIGURE_MPFR \
$SAGE_CONFIGURE_MPC --disable-static --enable-shared
sdh_make
sdh_make_install
52 changes: 52 additions & 0 deletions build/pkgs/ntl/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
SAGE_SPKG_CONFIGURE([ntl], [
AC_REQUIRE([SAGE_SPKG_CONFIGURE_GMP])
AC_MSG_CHECKING([installing gmp/mpir? ])
if test x$sage_spkg_install_mpir = xyes -o x$sage_spkg_install_gmp = xyes; then
AC_MSG_RESULT([yes; install ntl as well])
sage_spkg_install_ntl=yes
else
AC_MSG_RESULT([no])
fi
m4_pushdef(SAGE_NTL_VERSION_MAJOR, [10])
m4_pushdef(SAGE_NTL_VERSION_MINOR, [3])
if test x$sage_spkg_install_ntl != xyes; then
AC_CHECK_HEADER([NTL/ZZ.h], [], [sage_spkg_install_ntl=yes])
AC_MSG_CHECKING([whether we can link a program using NTL])
NTL_SAVED_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -lntl"
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[#include <NTL/ZZ.h>]],
[[NTL::ZZ a;]]
)], [LIBS="$LIBS -lntl"]
[AC_MSG_RESULT([yes])], [
AC_MSG_RESULT([no]); sage_spkg_install_ntl=yes
])
LDFLAGS=$NTL_SAVED_LDFLAGS
AC_MSG_CHECKING([NTL version >= ]SAGE_NTL_VERSION_MAJOR[.]SAGE_NTL_VERSION_MINOR)
AC_RUN_IFELSE([
AC_LANG_PROGRAM(
[[#include <NTL/version.h>
#include <stdio.h>
]], [[
printf("%s\n", NTL_VERSION);
if (NTL_MAJOR_VERSION >]] SAGE_NTL_VERSION_MAJOR[[) return 0;
else if (NTL_MAJOR_VERSION ==]] SAGE_NTL_VERSION_MAJOR[[ &&
NTL_MINOR_VERSION >=]] SAGE_NTL_VERSION_MINOR[[) return 0;
else return 1;
]])], [], [sage_spkg_install_ntl=yes])
fi
m4_popdef([SAGE_NTL_VERSION_MAJOR])
m4_popdef([SAGE_NTL_VERSION_MINOR])
], [], [], [
if test x$sage_spkg_install_ntl = xyes; then
AC_SUBST(SAGE_NTL_PREFIX, ['$SAGE_LOCAL'])
AC_MSG_RESULT([using Sage's ntl SPKG])
else
AC_SUBST(SAGE_NTL_PREFIX, [''])
AC_MSG_RESULT([using ntl library from the system])
fi
])

2 changes: 1 addition & 1 deletion build/pkgs/singular/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ config()
sdh_configure --exec-prefix="$SAGE_LOCAL" \
--bindir="$SAGE_LOCAL/bin" \
$SAGE_CONFIGURE_GMP \
--with-ntl="$SAGE_LOCAL" \
$SAGE_CONFIGURE_NTL \
--with-flint="$SAGE_LOCAL" \
--enable-gfanlib \
--enable-Singular \
Expand Down
28 changes: 28 additions & 0 deletions src/bin/sage-env-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,31 @@ if [ -n "$SAGE_GMP_PREFIX" ]; then
# --with-gmp without an argument is actually a bug)
export SAGE_CONFIGURE_GMP="--with-gmp=$SAGE_GMP_PREFIX"
fi

# The MPFR case is very close to the GMP case above
# This is usually blank if the system MPFR is used, or $SAGE_LOCAL otherwise
export SAGE_MPFR_PREFIX="@SAGE_MPFR_PREFIX@"
if [ -n "$SAGE_MPFR_PREFIX" ]; then
# Some packages that depend on MPFR accept a --with-mpfr=<prefix> flag to
# their ./configure scripts. Thus we deal with this just as with GMP above.
export SAGE_CONFIGURE_MPFR="--with-mpfr=$SAGE_MPFR_PREFIX"
fi

# The MPC case is very close to the MPFR case above
# This is usually blank if the system MPC is used, or $SAGE_LOCAL otherwise
export SAGE_MPC_PREFIX="@SAGE_MPC_PREFIX@"
if [ -n "$SAGE_MPC_PREFIX" ]; then
# Some packages that depend on MPC accept a --with-mpc=<prefix> flag to
# their ./configure scripts. Thus we deal with this just as with GMP above.
export SAGE_CONFIGURE_MPC="--with-mpc=$SAGE_MPC_PREFIX"
fi

# This is usually blank if the system NTL is used, or $SAGE_LOCAL otherwise
export SAGE_NTL_PREFIX="@SAGE_NTL_PREFIX@"
if [ -n "$SAGE_NTL_PREFIX" ]; then
# Many packages that depend on NTL accept a --with-ntl=<prefix> flag to
# their ./configure scripts. When using the system's NTL this is not
# generally necessary, but when using the NTL package installed in
# SAGE_LOCAL it is useful to pass it.
export SAGE_CONFIGURE_NTL="--with-ntl=$SAGE_NTL_PREFIX"
fi

0 comments on commit b1fa411

Please sign in to comment.