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

Commit

Permalink
Merge tag '9.1.beta9' into t/29415/tox_ini__add_environment_local_conda
Browse files Browse the repository at this point in the history
SageMath version 9.1.beta9, Release Date: 2020-03-29
  • Loading branch information
Matthias Koeppe committed Mar 29, 2020
2 parents 9939051 + 6a45805 commit cbcd657
Show file tree
Hide file tree
Showing 129 changed files with 3,190 additions and 1,593 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@
/config.log
/config.status
/configure
/conftest*

/m4/sage_spkg_configures.m4

# no longer generated, but may still be in user worktrees
/src/lib/pkgconfig

###################
# Temporary Files #
###################
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ sageruntime: base-toolchain
+build/bin/sage-logger \
"cd build/make && ./install '$@'" logs/install.log

# CONFIG_FILES lists all files that appear in AC_CONFIG_FILES in configure.ac;
# except for build/make/Makefile-auto, which is unused by the build system
CONFIG_FILES = build/make/Makefile src/Makefile src/bin/sage-env-config build/bin/sage-build-env-config build/pkgs/sage_conf/src/sage_conf.py build/pkgs/sage_conf/src/setup.cfg

# If configure was run before, rerun it with the old arguments.
# Otherwise, run configure with argument $PREREQ_OPTIONS.
build/make/Makefile: configure build/make/deps build/make/Makefile.in build/pkgs/*/*
build/make/Makefile: configure build/make/deps build/pkgs/*/* $(CONFIG_FILES:%=%.in)
rm -f config.log
mkdir -p logs/pkgs
ln -s logs/pkgs/config.log config.log
Expand Down Expand Up @@ -77,6 +81,8 @@ dist: build/make/Makefile
ssl: all
./sage -i pyopenssl

# Deleting src/lib is to get rid of src/lib/pkgconfig
# that was forgotten to clean in #29082.
misc-clean:
@echo "Deleting build artifacts generated by autoconf, automake, make ..."
rm -rf logs
Expand All @@ -85,7 +91,7 @@ misc-clean:
rm -f aclocal.m4 config.log confcache
rm -rf autom4te.cache
rm -f build/make/Makefile build/make/Makefile-auto
rm -f src/lib/pkgconfig/*
rm -rf src/lib

bdist-clean: clean
$(MAKE) misc-clean
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SageMath version 9.1.beta8, Release Date: 2020-03-18
SageMath version 9.1.beta9, Release Date: 2020-03-29
2 changes: 2 additions & 0 deletions build/bin/sage-build-env-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,5 @@ export SAGE_PARI_CFG="@SAGE_PARI_CFG@"

export SAGE_GLPK_PREFIX="@SAGE_GLPK_PREFIX@"
export SAGE_FREETYPE_PREFIX="@SAGE_FREETYPE_PREFIX@"

export SAGE_CONFIGURE_FFLAS_FFPACK="@SAGE_CONFIGURE_FFLAS_FFPACK@"
6 changes: 4 additions & 2 deletions build/bin/sage-pip-install
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ fi
# Note: We need to take care to specify the full path to Sage's Python here
# to emphasize that this command hould use it, and not the system Python;
# see https://trac.sagemath.org/ticket/18438
# But now we delegate this to sage-python23.
PYTHON=sage-python23

# The PIP variable is only used to determine the name of the lock file.
if [ "$SAGE_PYTHON3" = yes ]; then
PYTHON="$SAGE_LOCAL/bin/python3"
PIP=pip3
else
PYTHON="$SAGE_LOCAL/bin/python2"
PIP=pip2
fi

Expand Down
File renamed without changes.
25 changes: 17 additions & 8 deletions build/bin/sage-system-python
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,21 @@ if [ -z "$SAGE_ORIG_PATH" ]; then
SAGE_ORIG_PATH="$PATH"
fi

PYTHON="$(PATH="$SAGE_ORIG_PATH" command -v python)"

# fallback for systems where only the python3 command is available
# see https://trac.sagemath.org/ticket/26953
if [ -z "$PYTHON" ]; then
PYTHON="$(PATH="$SAGE_ORIG_PATH" command -v python3)"
fi
# In particular, it is invoked by "bootstrap -d" for sage-download-file,
# i.e., before a configure run, and by "sage-spkg", also for sage-download-file.
# So it needs to find a python that has the urllib module.
# For example, on Debian buster, the python3-minimal package does NOT provide it.
#
# See https://trac.sagemath.org/ticket/29090

exec "$PYTHON" "$@"
PYTHONS="python3 python3.8 python3.7 python2.7 python python3.6 python2"
for PY in $PYTHONS; do
PYTHON="$(PATH="$SAGE_ORIG_PATH" command -v $PY)"
if [[ -n "$PYTHON" ]]; then
if "$PYTHON" -c 'import urllib'; then
exec "$PYTHON" "$@"
fi
fi
done
echo >&2 "$0: error: none of $PYTHONS is a suitable Python with urllib"
exit 1
57 changes: 57 additions & 0 deletions build/bin/sage-venv
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env python3
# (Actually, we invoke this script with a specific python3 determined by configure.)

# Adapted from examples in https://docs.python.org/3/library/venv.html

import venv
import os
import argparse

parser = argparse.ArgumentParser(prog=__name__,
description='Creates a virtual Python '
'environment in a target directory.')
parser.add_argument('env_dir', metavar='ENV_DIR',
help='A directory in which to create the'
'virtual environment.')

parser.add_argument('--system-site-packages', default=False,
action='store_true', dest='system_site',
help='Give the virtual environment access to the '
'system site-packages dir.')

parser.add_argument('--clear', default=False, action='store_true',
dest='clear', help='Delete the contents of the '
'virtual environment '
'directory if it already '
'exists, before virtual '
'environment creation.')
parser.add_argument('--upgrade', default=False, action='store_true',
dest='upgrade', help='Upgrade the virtual '
'environment directory to '
'use this version of '
'Python, assuming Python '
'has been upgraded '
'in-place.')

options = parser.parse_args()
if options.upgrade and options.clear:
raise ValueError('you cannot supply --upgrade and --clear together.')

if os.name == 'nt':
# default for Windows
use_symlinks = False
else:
# default for posix
# On macOS, definitely need symlinks=True (which matches what we test in build/pkgs/spkg-configure.m4)
# or it may fail with 'dyld: Library not loaded: @executable_path/../Python3' on macOS.
use_symlinks = True

b = venv.EnvBuilder(system_site_packages=options.system_site,
clear=options.clear,
upgrade=options.upgrade,
symlinks=use_symlinks)
c = b.ensure_directories(options.env_dir)
b.setup_python(c)
b.create_configuration(c)
# We do not call setup_scripts, which would install the venv 'activate'/'deactivate' scripts.

File renamed without changes.
File renamed without changes.
File renamed without changes.
50 changes: 36 additions & 14 deletions build/make/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,22 @@ PYTHON = python@SAGE_PYTHON_VERSION@
MP_LIBRARY = @SAGE_MP_LIBRARY@
BLAS = @SAGE_BLAS@

# Because some .pc files are generated at configure time we can't write their
# names explicitly the Makefile, so we use the wildcard function here at make
# runtime
PCFILES = $(subst $(SAGE_SRC),$(SAGE_LOCAL),$(wildcard $(SAGE_SRC)/lib/pkgconfig/*.pc))
# pkgconfig files generated/installed at build time
PCFILES = @SAGE_SYSTEM_FACADE_PC_FILES@

LN = ln
SED = sed

# Generate/install sage-specific .pc files.
# see build/pkgs/gsl/spkg-configure.m4
$(SAGE_PKGCONFIG)/gsl.pc:
-rm -f $@
@SAGE_GSL_PC_COMMAND@

# see build/pkgs/openblas/spkg-configure.m4
$(SAGE_PKGCONFIG)/blas.pc $(SAGE_PKGCONFIG)/cblas.pc $(SAGE_PKGCONFIG)/lapack.pc:
-rm -f $@
@SAGE_OPENBLAS_PC_COMMAND@

# Files to track installation of packages
BUILT_PACKAGES = @SAGE_BUILT_PACKAGES@
Expand Down Expand Up @@ -201,6 +213,7 @@ $(1)-clean:
sage-spkg-uninstall $(if $(filter $(1),$(TOOLCHAIN_DEPS)),--keep-files) \
$(1) '$(SAGE_LOCAL)'

.PHONY: $(1) $(1)-clean
endef

$(foreach pkgname, $(NORMAL_PACKAGES),\
Expand All @@ -219,21 +232,22 @@ endif
# two rules in the form:
#
# <pkgname>: <dependencies>
# $(AM_V_at)sage-logger -p 'sage --pip install <pkgname>' '$(SAGE_LOGS)/<pkgname>.log'
# $(AM_V_at)sage-logger -p 'sage --pip install ...' '$(SAGE_LOGS)/<pkgname>.log'
#
# <pkgname>-clean:
# -sage --pip uninstall -y <pkgname>
# -sage --pip uninstall -y ...

# Positional arguments:
# $(1): package name
# $(2): package dependencies
define PIP_PACKAGE_templ
$(1): $(2)
$(AM_V_at)sage-logger -p 'sage --pip install $(1)' '$$(SAGE_LOGS)/$(1).log'
$(AM_V_at)sage-logger -p 'sage --pip install -r "$$(SAGE_ROOT)/build/pkgs/$(1)/requirements.txt"' '$$(SAGE_LOGS)/$(1).log'

$(1)-clean:
-sage --pip uninstall -y $(1)
-sage --pip uninstall -y -r '$$(SAGE_ROOT)/build/pkgs/$(1)/requirements.txt'

.PHONY: $(1) $(1)-clean
endef

$(foreach pkgname,$(PIP_PACKAGES),\
Expand All @@ -247,41 +261,49 @@ endif

# ============================= script packages ==============================
# Generate build rules for 'script' packages; this template is used to generate
# two rules in the form:
# three rules in the form:
#
# <pkgname>: <dependencies>
# $(INST)/<pkgname>-<pkgvers>: <dependencies>
# $(AM_V_at)cd '$SAGE_ROOT' && \\
# source '$SAGE_ROOT/src/bin/sage-env' && \\
# sage-logger -p '$SAGE_ROOT/build/pkgs/<pkgname>/spkg-install' '$(SAGE_LOGS)/<pkgname>.log'
#
# <pkgname>: $(INST)/<pkgname>-<pkgvers>
#
# <pkgname>-clean:
# -$(AM_V_at)cd '$SAGE_ROOT' && \\
# source '$SAGE_ROOT/src/bin/sage-env' && \\
# '$SAGE_ROOT/build/pkgs/$PKG_NAME/spkg-uninstall'

# Positional arguments:
# $(1): package name
# $(2): package dependencies
# $(2): package version
# $(3): package dependencies
define SCRIPT_PACKAGE_templ
$(1): $(2)
$$(INST)/$(1)-$(2): $(3)
$(AM_V_at)cd '$$(SAGE_ROOT)' && \
source '$$(SAGE_ROOT)/src/bin/sage-env' && source '$$(SAGE_ROOT)/build/bin/sage-build-env-config' && \
sage-logger -p '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-install' '$$(SAGE_LOGS)/$(1).log'
touch "$$@"

$(1): $$(INST)/$(1)-$(2)

$(1)-clean:
-$(AM_V_at)cd '$$(SAGE_ROOT)' && \
source '$$(SAGE_ROOT)/src/bin/sage-env' && source '$$(SAGE_ROOT)/build/bin/sage-build-env-config' && \
'$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-uninstall'
-rm -f "$$(INST)/$(1)-$(2)"

.PHONY: $(1) $(1)-clean
endef

$(foreach pkgname,$(SCRIPT_PACKAGES),\
$(eval $(call SCRIPT_PACKAGE_templ,$(pkgname),$(call pkg_deps,$(pkgname)))))
$(eval $(call SCRIPT_PACKAGE_templ,$(pkgname),$(vers_$(pkgname)),$(call pkg_deps,$(pkgname)))))

ifdef DEBUG_RULES
$(info # Rules for script packages)
$(foreach pkgname,$(SCRIPT_PACKAGES),\
$(info $(call SCRIPT_PACKAGE_templ,$(pkgname),$(call pkg_deps,$(pkgname)))))
$(info $(call SCRIPT_PACKAGE_templ,$(pkgname),$(vers_$(pkgname)),$(call pkg_deps,$(pkgname)))))
endif


Expand Down
26 changes: 19 additions & 7 deletions build/make/deps
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,24 @@ STARTED = $(SAGE_LOCAL)/etc/sage-started.txt
sagelib \
doc doc-html doc-html-jsmath doc-html-mathjax doc-pdf \
doc-clean doc-src-clean doc-output-clean \
clean sagelib-clean build-clean _clean-broken-gcc
clean sagelib-clean build-clean python3_venv _clean-broken-gcc

ifneq ($(PYTHON_FOR_VENV),)
# Special rule for making the Python virtualenv from the system Python (Python
# 3 only). $(PYTHON) is set in Makefile to python3_venv.
# Thus $(inst_python3_venv) will be the dependency of every Python package.
#
# TODO: If we reconfigure to build our own Python after having used the system
# Python, files installed to create the virtualenv should be *removed*. That
# could either be done here by the makefile, or in an spkg-preinst for python3
ifeq ($(PYTHON),python3)
PYTHON = python3_venv
endif
inst_python3_venv = $(SAGE_LOCAL)/pyvenv.cfg

$(inst_python3_venv):
$(PYTHON_FOR_VENV) $(SAGE_ROOT)/build/bin/sage-venv "$(SAGE_LOCAL)"
endif

# Build everything and start Sage.
# Note that we put the "doc" target first in the rule below because
Expand Down Expand Up @@ -104,7 +121,7 @@ build-start: all-build
# sage-starts runs sage-location, which should be run after installing
# any package.
$(STARTED): $(STANDARD_PACKAGE_INSTS)
$(AM_V_at)"$(SAGE_LOCAL)/bin/sage-starts"
$(AM_V_at)"$(SAGE_ROOT)/build/bin/sage-starts"


###############################################################################
Expand Down Expand Up @@ -193,11 +210,6 @@ sagelib: sagelib-build-deps
$(SAGE_LOCAL)/bin/%: $(SAGE_SRC)/bin/%
$(AM_V_at)cp $< $@

# Install sage-specific generated .pc files
$(SAGE_PKGCONFIG)/%.pc: $(SAGE_SRC)/lib/pkgconfig/%.pc
@mkdir -p "$(@D)"
$(AM_V_at)cp -P $< $@

###############################################################################
# Building the documentation
###############################################################################
Expand Down
1 change: 1 addition & 0 deletions build/pkgs/beautifulsoup4/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
beautifulsoup4
2 changes: 1 addition & 1 deletion build/pkgs/beautifulsoup4/type
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pip
optional
1 change: 1 addition & 0 deletions build/pkgs/biopython/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
biopython
2 changes: 1 addition & 1 deletion build/pkgs/biopython/type
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pip
optional
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=16999eea7613ed2ed183a5b2c3eefc6265685017
md5=ece66d1eaec2065f7a0e0aad65d71b90
cksum=906044305
sha1=61c67b0467fed4e9c3330e74b24eed140d628a3a
md5=e7e0d1af7ee75e2c10532ec8a3a2ddba
cksum=2321075386
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
52ba9a76be0b56be044a441ee2448a4f4d93c6c3
437bbd8e43c5889b8135f4786fed5f4b32cbb46a
3 changes: 3 additions & 0 deletions build/pkgs/curl/distros/slackware.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
curl
cyrus-sasl
# giac build needs libldap
openldap-client
libssh2
3 changes: 2 additions & 1 deletion build/pkgs/cygwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ binutils
make
m4
# a system python is needed for downloading the sage packages, https://trac.sagemath.org/ticket/29090
python3
# as of #27824, we use python3 for venv as well
python37-urllib python37-devel python37
perl
perl-ExtUtils-MakeMaker
tar
Expand Down
7 changes: 4 additions & 3 deletions build/pkgs/e_antic/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
tarball=e-antic-VERSION.tar.gz
sha1=2a443ab9babf5373a434acd90923a793cd950f10
md5=c4ffc38b285cd6e81c555e48dbbb529e
cksum=1444226844
sha1=582c0c3118410f6d8efe23f8fd679e2c602f09a3
md5=25e1df644ba85db544209cc1d2056464
cksum=1577490486
upstream_url=https://www.labri.fr/perso/vdelecro/e-antic/e-antic-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/e_antic/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.3
0.1.5
2 changes: 2 additions & 0 deletions build/pkgs/eclib/distros/debian.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
libec-dev
# provides the mwrank executable:
eclib-tools
16 changes: 16 additions & 0 deletions build/pkgs/fflas_ffpack/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SAGE_SPKG_CONFIGURE([fflas_ffpack], [
dnl A check for a system package is not implemented yet.
sage_spkg_install_fflas_ffpack=yes
dnl https://github.com/linbox-team/fflas-ffpack/blob/master/macros/instr_set.m4
dnl discovers these flags from the processor but fails to check whether
dnl compiler (and assembler) actually support these instruction sets.
AX_CHECK_COMPILE_FLAG([-mavx512f -mavx512vl -mavx512dq], [], [
AS_VAR_APPEND([SAGE_CONFIGURE_FFLAS_FFPACK], [" --disable-avx512f --disable-avx512vl --disable-avx512dq"])
])
m4_foreach([ISFLAG], [fma, fma4], [
AX_CHECK_COMPILE_FLAG([-m]ISFLAG, [], [AS_VAR_APPEND]([SAGE_CONFIGURE_FFLAS_FFPACK], [" --disable-]ISFLAG[ "]))
])
AC_SUBST([SAGE_CONFIGURE_FFLAS_FFPACK])
])
Loading

0 comments on commit cbcd657

Please sign in to comment.