Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Replace various --with-gmp=$SAGE_LOCAL flags in spkg-installs with a
Browse files Browse the repository at this point in the history
$SAGE_CONFIGURE_GMP variable that is defined in sage-env-config and
set at configure time.
  • Loading branch information
embray authored and dimpase committed Apr 18, 2019
1 parent 8a16493 commit 299e367
Show file tree
Hide file tree
Showing 22 changed files with 43 additions and 29 deletions.
2 changes: 1 addition & 1 deletion build/pkgs/4ti2/spkg-install
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cd src/
CFLAGS="-I $SAGE_LOCAL/include -L$SAGE_LOCAL/lib $CFLAGS"
export CFLAGS
sdh_configure --with-gmp=$SAGE_LOCAL --with-glpk=$SAGE_LOCAL \
sdh_configure $SAGE_CONFIGURE_GMP --with-glpk=$SAGE_LOCAL \
--enable-shared=yes --enable-static=no
sdh_make
sdh_make_install
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" --with-flint="$SAGE_LOCAL" \
--with-gmp="$SAGE_LOCAL" --with-mpfr="$SAGE_LOCAL" || \
./configure --disable-static --prefix="$SAGE_LOCAL" $SAGE_CONFIGURE_GMP \
--with-flint="$SAGE_LOCAL" --with-mpfr="$SAGE_LOCAL" || \
sdh_die "Error configuring arb."

sdh_make verbose
Expand Down
6 changes: 5 additions & 1 deletion build/pkgs/barvinok/spkg-install
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
cd src

sdh_configure --with-gmp-prefix=${SAGE_LOCAL} \
if [ -n "$SAGE_GMP_PREFIX" ];
GMP_CONFIGURE="--with-gmp-prefix=$SAGE_GMP_PREFIX"
fi

sdh_configure $GMP_CONFIGURE \
--with-ntl-prefix=${SAGE_LOCAL} \
--with-isl=system \
--with-polylib=system \
Expand Down
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 \
--with-gmp="$SAGE_LOCAL" --with-mpfr="$SAGE_LOCAL" \
$SAGE_CONFIGURE_GMP --with-mpfr="$SAGE_LOCAL" \
--with-flint="$SAGE_LOCAL" || \
sdh_die "Failed to configure deformation"
sdh_make
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/ecl/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ echo ""
# Use newer version of config.guess and config.sub (see Trac #19732)
cp "$SAGE_ROOT"/config/config.* src

sdh_configure --with-gmp-prefix=$SAGE_LOCAL --disable-threads \
sdh_configure $SAGE_CONFIGURE_GMP --disable-threads \
--enable-unicode=yes $ECL_CONFIGURE

# Before running make we touch build/TAGS so its building process is never triggered
Expand Down
7 changes: 5 additions & 2 deletions build/pkgs/ecm/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ else
fi
echo " --prefix=\"$SAGE_LOCAL\""
echo " --libdir=\"$SAGE_LOCAL/lib\""
echo " --with-gmp=\"$SAGE_LOCAL\""
if [ -n "$SAGE_GMP_CONFIGURE" ]; then
echo " --with-gmp=\"$SAGE_LOCAL\""
fi

for opt in $ECM_CONFIGURE; do
echo " $opt"
done
Expand All @@ -221,7 +224,7 @@ if [ -z "$ECM_CONFIGURE" ]; then
fi
echo

sdh_configure --with-gmp="$SAGE_LOCAL" $ECM_CONFIGURE
sdh_configure $SAGE_CONFIGURE_GMP $ECM_CONFIGURE

###############################################################################
# Now build ECM:
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/flint/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ echo "Configuring FLINT."
./configure \
--disable-static \
--prefix="$SAGE_LOCAL" \
--with-gmp="$SAGE_LOCAL" \
$SAGE_CONFIGURE_GMP \
--with-mpfr="$SAGE_LOCAL" \
--with-ntl="$SAGE_LOCAL" \
$FLINT_CONFIGURE || sdh_die "Error: Failed to configure FLINT."
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/gap/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ else
export CFLAGS="-O2 -g $CFLAGS"
fi

sdh_configure --with-gmp="$SAGE_LOCAL"
sdh_configure $SAGE_CONFIGURE_GMP
sdh_make -j1

# GAP's "make install" is work in progress; we use bits and pieces of it
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" \
--with-gmp="$SAGE_LOCAL" --with-mpfr="$SAGE_LOCAL" --with-mpc="$SAGE_LOCAL" \
$SAGE_CONFIGURE_GMP --with-mpfr="$SAGE_LOCAL" --with-mpc="$SAGE_LOCAL" \
--with-system-zlib \
--disable-multilib \
--disable-nls \
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/gdb/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export LDFLAGS="${LDFLAGS} -L${SAGE_LOCAL}/lib -ltinfo"
sdh_configure \
--with-mpc="$SAGE_LOCAL" \
--with-mpfr="$SAGE_LOCAL" \
--with-gmp="$SAGE_LOCAL"
$SAGE_CONFIGURE_GMP
sdh_make
sdh_make_install
2 changes: 1 addition & 1 deletion build/pkgs/givaro/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ if [ "$SAGE_FAT_BINARY" = yes ]; then
GIVARO_CONFIGURE="--disable-sse --disable-sse2 --disable-sse3 --disable-ssse3 --disable-sse41 --disable-sse42 --disable-fma --disable-fma4 --disable-avx --disable-avx2 $GIVARO_CONFIGURE"
fi

sdh_configure --with-gmp="$SAGE_LOCAL" --enable-shared $GIVARO_CONFIGURE
sdh_configure $SAGE_CONFIGURE_GMP --enable-shared $GIVARO_CONFIGURE
sdh_make
sdh_make_install
2 changes: 1 addition & 1 deletion build/pkgs/glpk/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cp "$SAGE_ROOT"/config/config.* .
# Note: The following doesn't work with spaces in `$SAGE_LOCAL`, but we don't
# support that anyway, since many upstream packages don't.
# On the other hand, the only packages GLPK uses that Sage provides are
# GMP/MPIR and zlib, so we should just use `--with-gmp="$SAGE_LOCAL"` and
# GMP/MPIR and zlib, so we should just use `$SAGE_CONFIGURE_GMP` and
# `--with-zlib="$SAGE_LOCAL"` below (which is safe), and omit the fol-
# lowing two lines. (TODO)
#
Expand Down
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 \
--with-gmp=$SAGE_LOCAL --with-ntl=$SAGE_LOCAL \
$SAGE_CONFIGURE_GMP --with-ntl=$SAGE_LOCAL \
--with-cddlib=$SAGE_LOCAL --with-4ti2=$SAGE_LOCAL \
--with-lidia=$SAGE_LOCAL
sdh_make
Expand Down
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 --with-gmp="$SAGE_LOCAL" --with-mpfr="$SAGE_LOCAL" $EXTRA
sdh_configure $SAGE_CONFIGURE_GMP --with-mpfr="$SAGE_LOCAL" $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" --with-gmp="$SAGE_LOCAL"
sdh_configure --with-mpfr="$SAGE_LOCAL" $SAGE_CONFIGURE_GMP
sdh_make
sdh_make_install

Expand Down
10 changes: 6 additions & 4 deletions build/pkgs/mpfr/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ mpfr_configure()
###########################################################################
echo "Checking what CC and CFLAGS MPFR would use if they were empty..."
if (unset CC CFLAGS CPPFLAGS CXXFLAGS &&
./configure --with-gmp="$SAGE_LOCAL" $SAGE_CONF_OPTS $MPFR_CONFIGURE) &>/dev/null;
./configure $SAGE_CONFIGURE_GMP $SAGE_CONF_OPTS $MPFR_CONFIGURE) &>/dev/null;
then
mpfr_config_file=config.status
if mpfr_get_upstream_selected_cflags "$mpfr_config_file"; then
Expand Down Expand Up @@ -131,16 +131,18 @@ mpfr_configure()
fi
echo " --prefix=\"$SAGE_LOCAL\""
echo " --libdir=\"$SAGE_LOCAL/lib\""
echo " --with-gmp=\"$SAGE_LOCAL\""
if [ -n "$SAGE_CONFIGURE_GMP" ]; then
echo " --with-gmp=\"$SAGE_LOCAL\""
fi

for opt in $SAGE_CONF_OPTS $MPFR_CONFIGURE; do
echo " $opt"
done
if [ -z "$MPFR_CONFIGURE" ]; then
echo "You can set MPFR_CONFIGURE to pass additional parameters."
fi

sdh_configure --with-gmp="$SAGE_LOCAL" \
$SAGE_CONF_OPTS $MPFR_CONFIGURE
sdh_configure $SAGE_CONFIGURE_GMP $SAGE_CONF_OPTS $MPFR_CONFIGURE
}

mpfr_build()
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/mpfrcx/spkg-install
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cd src

sdh_configure --with-gmp="$SAGE_LOCAL" --with-mpfr="$SAGE_LOCAL" \
sdh_configure $SAGE_CONFIGURE_GMP --with-mpfr="$SAGE_LOCAL" \
--with-mpc="$SAGE_LOCAL" --disable-static --enable-shared
sdh_make
sdh_make_install
3 changes: 2 additions & 1 deletion build/pkgs/pari/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ export CFLAGS
# anyway, it doesn't hurt either. -- jdemeyer
#
# Note that "--graphic=none" is (usually) added to PARI_CONFIGURE:
#--with-gmp-include="/usr/include/x86_64-linux-gnu" \
bash ./Configure --prefix="$SAGE_LOCAL" \
--with-readline="$SAGE_LOCAL" --with-gmp="$SAGE_LOCAL" \
--with-readline="$SAGE_LOCAL" $SAGE_CONFIGURE_GMP \
--with-runtime-perl="/usr/bin/env perl" \
--kernel=gmp $PARI_CONFIGURE || \
sdh_die "Error configuring PARI with readline and GMP kernel failed."
Expand Down
6 changes: 2 additions & 4 deletions build/pkgs/ppl/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@ export CXXFLAGS="$CXXFLAGS -I$SAGE_LOCAL/include"
cd src

# Enable only what's needed for Sage
GMP_PATHS=( "--with-gmp-include=$SAGE_LOCAL/include"
"--with-gmp-lib=$SAGE_LOCAL/lib" )
PPL_CONFIGURE="--enable-coefficients=mpz --disable-fpmath $PPL_CONFIGURE"

# First try configuring both the C and C++ interfaces.
# If that fails (for example, because of a broken version of m4),
# try to configure again with only the C++ interface, which is
# sufficient for Sage. See #11391 and #12672.
if ! (sdh_configure --enable-interfaces=c,c++ "${GMP_PATHS[@]}" \
if ! (sdh_configure --enable-interfaces=c,c++ $SAGE_CONFIGURE_GMP \
$PPL_CONFIGURE); then
echo >&2 "Error configuring PPL with both C and C++ interfaces, trying"
echo >&2 "again with only the C++ interface."
sdh_configure --enable-interfaces=c++ "${GMP_PATHS[@]}" $PPL_CONFIGURE
sdh_configure --enable-interfaces=c++ $SAGE_CONFIGURE_GMP $PPL_CONFIGURE
fi

# Workaround to disable PPL's "watchdog timer", preventing it from clobbering
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/singular/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ config()
# may be ignored.
sdh_configure --exec-prefix="$SAGE_LOCAL" \
--bindir="$SAGE_LOCAL/bin" \
--with-gmp="$SAGE_LOCAL" \
$SAGE_CONFIGURE_GMP \
--with-ntl="$SAGE_LOCAL" \
--with-flint="$SAGE_LOCAL" \
--enable-gfanlib \
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/topcom/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cd src
./configure \
--prefix="$SAGE_LOCAL" \
--libdir="$SAGE_LOCAL/lib" \
--with-gmp="$SAGE_LOCAL" \
$SAGE_CONFIGURE_GMP \
--with-cdd="$SAGE_LOCAL"
if [ $? -ne 0 ]; then
echo "Error configuring TOPCOM."
Expand Down
6 changes: 6 additions & 0 deletions src/bin/sage-env-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ export SAGE_PYTHON_VERSION=@SAGE_PYTHON_VERSION@
if [ "$SAGE_PYTHON_VERSION" = 3 ]; then
export SAGE_PYTHON3=yes
fi

# This is usually blank if the system GMP is used, or $SAGE_LOCAL otherwise
export SAGE_GMP_PREFIX="@SAGE_GMP_PREFIX@"
if [ -n "$SAGE_GMP_PREFIX" ]; then
export SAGE_CONFIGURE_GMP="--with-gmp=$SAGE_GMP_PREFIX"
fi

0 comments on commit 299e367

Please sign in to comment.