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

Commit

Permalink
configure.ac (--enable-wheels): New
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Oct 3, 2022
1 parent 67ff945 commit a683934
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pypi-wheels:
rm -f venv/var/lib/sage/installed/$$a-*; \
done
for a in $(PYPI_WHEEL_PACKAGES); do \
$(MAKE) SAGE_EDITABLE=no $$a; \
$(MAKE) SAGE_EDITABLE=no SAGE_WHEELS=yes $$a; \
done
@echo "Built wheels are in venv/var/lib/sage/wheels/"

Expand All @@ -112,7 +112,7 @@ wheels:
rm -f venv/var/lib/sage/installed/$$a-*; \
done
for a in $(WHEEL_PACKAGES); do \
$(MAKE) SAGE_EDITABLE=no $$a; \
$(MAKE) SAGE_EDITABLE=no SAGE_WHEELS=yes $$a; \
done
@echo "Built wheels are in venv/var/lib/sage/wheels/"

Expand Down
4 changes: 4 additions & 0 deletions build/bin/sage-build-env
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ if [ "x$SAGE_BUILD_ENV_SOURCED" = "x" ]; then
if [ "x$SAGE_EDITABLE" = "x" ]; then
export SAGE_EDITABLE="$CONFIGURED_SAGE_EDITABLE"
fi
# Likewise for SAGE_WHEELS
if [ "x$SAGE_WHEELS" = "x" ]; then
export SAGE_WHEELS="$CONFIGURED_SAGE_WHEELS"
fi

# This is usually blank if the system GMP is used, or $SAGE_LOCAL otherwise
if [ -n "$SAGE_GMP_PREFIX" ]; then
Expand Down
1 change: 1 addition & 0 deletions build/bin/sage-build-env-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ export SAGE_SUITESPARSE_PREFIX="@SAGE_SUITESPARSE_PREFIX@"
export SAGE_CONFIGURE_FFLAS_FFPACK="@SAGE_CONFIGURE_FFLAS_FFPACK@"

export CONFIGURED_SAGE_EDITABLE="@SAGE_EDITABLE@"
export CONFIGURED_SAGE_WHEELS="@SAGE_WHEELS@"
21 changes: 17 additions & 4 deletions build/pkgs/sagelib/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,30 @@ if [ "$SAGE_EDITABLE" = yes ]; then
# under the old distribution name "sage" (before #30912, which switched to setuptools
# and renamed the distribution to "sagemath-standard"). There is no clean way to uninstall
# them, so we just use rm.
(cd "$SITEPACKAGESDIR" && rm -rf sage sage_setup sage-[1-9]*.egg-info sage-[1-9]*.dist-info)
(cd "$SITEPACKAGESDIR" && rm -rf sage sage-[1-9]*.egg-info sage-[1-9]*.dist-info)
time sdh_pip_editable_install .

if [ "$SAGE_WHEELS" = yes ]; then
# Additionally build a wheel (for use in other venvs)
cd $SAGE_PKGS/sagelib/src && time sdh_setup_bdist_wheel && sdh_store_wheel .
fi
else
# Make sure that an installed old version of sagelib in which sage is an ordinary package
# does not shadow the namespace package sage during the build.
(cd "$SITEPACKAGESDIR" && rm -f sage/__init__.py)
# Likewise, we should remove the egg-link that may have been installed previously.
(cd "$SITEPACKAGESDIR" && rm -f sagemath-standard.egg-link)
# Use --no-build-isolation to avoid rebuilds because of dependencies:
# Compiling sage/interfaces/sagespawn.pyx because it depends on /private/var/folders/38/wnh4gf1552g_crsjnv2vmmww0000gp/T/pip-build-env-609n5985/overlay/lib/python3.10/site-packages/Cython/Includes/posix/unistd.pxd
time sdh_pip_install --no-build-isolation .

if [ "$SAGE_WHEELS" = yes ]; then
# Use --no-build-isolation to avoid rebuilds because of dependencies:
# Compiling sage/interfaces/sagespawn.pyx because it depends on /private/var/folders/38/wnh4gf1552g_crsjnv2vmmww0000gp/T/pip-build-env-609n5985/overlay/lib/python3.10/site-packages/Cython/Includes/posix/unistd.pxd
time sdh_pip_install --no-build-isolation .
else
# We no longer use the install-cleaner for installation directory cleaning.
# So uninstall first.
time sdh_pip_uninstall sagemath-standard
time python3 -u setup.py --no-user-cfg build install || exit 1
fi
fi

# Trac #33103: The temp.* directories are large after a full build.
Expand Down
6 changes: 6 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ AC_ARG_ENABLE([editable],
[AC_SUBST([SAGE_EDITABLE], [$enableval])],
[AC_SUBST([SAGE_EDITABLE], [yes])])

AC_ARG_ENABLE([wheels],
[AS_HELP_STRING([--enable-wheels],
[build and update wheels for the Sage library])],
[AC_SUBST([SAGE_WHEELS], [$enableval])],
[])

# Check whether we are on a supported platform
AC_CANONICAL_BUILD()
AC_CANONICAL_HOST()
Expand Down

0 comments on commit a683934

Please sign in to comment.