diff --git a/.github/workflows/ci-cygwin-standard.yml b/.github/workflows/ci-cygwin-standard.yml index c16ff25a8a1..75e493f733e 100644 --- a/.github/workflows/ci-cygwin-standard.yml +++ b/.github/workflows/ci-cygwin-standard.yml @@ -205,7 +205,7 @@ jobs: path: C:\\tools\\cygwin\\tmp - name: Extract sage-local artifact run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null local' - name: configure run: | C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' @@ -233,7 +233,7 @@ jobs: # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. # We remove the local/lib64 link, which will be recreated by the next stage. run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar local' if: always() - uses: actions/upload-artifact@v2 # upload-artifact@v2 does not support whitespace in file names. @@ -285,7 +285,7 @@ jobs: path: C:\\tools\\cygwin\\tmp - name: Extract sage-local artifact run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null local' - name: configure run: | C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' @@ -313,7 +313,7 @@ jobs: # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. # We remove the local/lib64 link, which will be recreated by the next stage. run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar local' if: always() - uses: actions/upload-artifact@v2 with: @@ -363,7 +363,7 @@ jobs: path: C:\\tools\\cygwin\\tmp - name: Extract sage-local artifact run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null local' - name: configure run: | C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' @@ -391,7 +391,7 @@ jobs: # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. # We remove the local/lib64 link, which will be recreated by the next stage. run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar local' if: always() - uses: actions/upload-artifact@v2 with: @@ -441,7 +441,7 @@ jobs: path: C:\\tools\\cygwin\\tmp - name: Extract sage-local artifact run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null local' - name: configure run: | C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' @@ -469,7 +469,7 @@ jobs: # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. # We remove the local/lib64 link, which will be recreated by the next stage. run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar local' if: always() - uses: actions/upload-artifact@v2 with: @@ -519,7 +519,7 @@ jobs: path: C:\\tools\\cygwin\\tmp - name: Extract sage-local artifact run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null local' - name: configure run: | C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' @@ -547,7 +547,7 @@ jobs: # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. # We remove the local/lib64 link, which will be recreated by the next stage. run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar local' if: always() - uses: actions/upload-artifact@v2 with: @@ -599,7 +599,7 @@ jobs: path: C:\\tools\\cygwin\\tmp - name: Extract sage-local artifact run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null local' - name: configure run: | C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' @@ -627,7 +627,7 @@ jobs: # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. # We remove the local/lib64 link, which will be recreated by the next stage. run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar local' if: always() - uses: actions/upload-artifact@v2 with: @@ -679,7 +679,7 @@ jobs: path: C:\\tools\\cygwin\\tmp - name: Extract sage-local artifact run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null local' - name: configure run: | C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' @@ -707,7 +707,7 @@ jobs: # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. # We remove the local/lib64 link, which will be recreated by the next stage. run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar local' if: always() - uses: actions/upload-artifact@v2 with: @@ -757,7 +757,7 @@ jobs: path: C:\\tools\\cygwin\\tmp - name: Extract sage-local artifact run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null local' - name: configure run: | C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' @@ -785,7 +785,7 @@ jobs: # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. # We remove the local/lib64 link, which will be recreated by the next stage. run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar local' if: always() - uses: actions/upload-artifact@v2 with: @@ -835,7 +835,7 @@ jobs: path: C:\\tools\\cygwin\\tmp - name: Extract sage-local artifact run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null local' - name: configure run: | C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' @@ -863,7 +863,7 @@ jobs: # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. # We remove the local/lib64 link, which will be recreated by the next stage. run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar local' if: always() - uses: actions/upload-artifact@v2 with: @@ -941,7 +941,7 @@ jobs: # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. # We remove the local/lib64 link, which will be recreated by the next stage. run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' + C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --listed-incremental=/tmp/sage-local.snar local' if: always() - uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/tox-experimental.yml b/.github/workflows/tox-experimental.yml index 94807184564..bd1ba49ef1a 100644 --- a/.github/workflows/tox-experimental.yml +++ b/.github/workflows/tox-experimental.yml @@ -36,7 +36,7 @@ jobs: fail-fast: false max-parallel: 6 matrix: - tox_system_factor: [ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-eoan, ubuntu-focal, debian-jessie, debian-stretch, debian-buster, debian-bullseye, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, centos-7, centos-8, gentoo, archlinux-latest, slackware-14.2, conda-forge, ubuntu-bionic-i386, ubuntu-eoan-i386, debian-buster-i386, centos-7-i386] + tox_system_factor: [ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-eoan, ubuntu-focal, ubuntu-groovy, ubuntu-hirsute, debian-jessie, debian-stretch, debian-buster, debian-bullseye, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, linuxmint-20.1, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, fedora-32, fedora-33, fedora-34, centos-7, centos-8, gentoo, archlinux-latest, slackware-14.2, conda-forge, ubuntu-bionic-i386, ubuntu-focal-i386, debian-buster-i386, centos-7-i386] tox_packages_factor: [maximal] targets_pattern: [0-g, h-o, p, q-z] env: diff --git a/.github/workflows/tox-optional.yml b/.github/workflows/tox-optional.yml index be8d05c773d..9d3f79a7530 100644 --- a/.github/workflows/tox-optional.yml +++ b/.github/workflows/tox-optional.yml @@ -36,7 +36,7 @@ jobs: fail-fast: false max-parallel: 6 matrix: - tox_system_factor: [ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-eoan, ubuntu-focal, debian-jessie, debian-stretch, debian-buster, debian-bullseye, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, centos-7, centos-8, gentoo, archlinux-latest, slackware-14.2, conda-forge, ubuntu-bionic-i386, ubuntu-eoan-i386, debian-buster-i386, centos-7-i386] + tox_system_factor: [ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-eoan, ubuntu-focal, ubuntu-groovy, ubuntu-hirsute, debian-jessie, debian-stretch, debian-buster, debian-bullseye, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, linuxmint-20.1, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, fedora-32, fedora-33, fedora-34, centos-7, centos-8, gentoo, archlinux-latest, slackware-14.2, conda-forge, ubuntu-bionic-i386, ubuntu-focal-i386, debian-buster-i386, centos-7-i386] tox_packages_factor: [maximal] targets_pattern: [0-g, h-o, p, q-z] env: diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 952d3457cf7..d113f4e175d 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -36,7 +36,7 @@ jobs: fail-fast: false max-parallel: 20 matrix: - tox_system_factor: [ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-eoan, ubuntu-focal, ubuntu-groovy, debian-jessie, debian-stretch, debian-buster, debian-bullseye, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, fedora-32, fedora-33, centos-7, centos-8, gentoo, gentoo-python3.7, archlinux-latest, slackware-14.2, conda-forge, ubuntu-bionic-i386, ubuntu-focal-i386, debian-buster-i386, centos-7-i386] + tox_system_factor: [ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-eoan, ubuntu-focal, ubuntu-groovy, ubuntu-hirsute, debian-jessie, debian-stretch, debian-buster, debian-bullseye, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, linuxmint-20.1, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, fedora-32, fedora-33, fedora-34, centos-7, centos-8, gentoo, gentoo-python3.7, archlinux-latest, slackware-14.2, conda-forge, ubuntu-bionic-i386, ubuntu-focal-i386, debian-buster-i386, centos-7-i386] tox_packages_factor: [minimal, standard] env: TOX_ENV: docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} diff --git a/.gitignore b/.gitignore index c30bf660a9b..8d639d60891 100644 --- a/.gitignore +++ b/.gitignore @@ -135,6 +135,7 @@ src/*.egg-info/ /src/build /src/Makefile /src/bin/sage-env-config +/src/bin/sage-src-env-config # Virtual environments src/.env diff --git a/.zenodo.json b/.zenodo.json index ed92e9673c5..6f25a995a0e 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,10 +1,10 @@ { "description": "Mirror of the Sage https://sagemath.org/ source tree", "license": "other-open", - "title": "sagemath/sage: 9.3.beta3", - "version": "9.3.beta3", + "title": "sagemath/sage: 9.3.beta4", + "version": "9.3.beta4", "upload_type": "software", - "publication_date": "2020-12-06", + "publication_date": "2020-12-14", "creators": [ { "affiliation": "SageMath.org", @@ -15,7 +15,7 @@ "related_identifiers": [ { "scheme": "url", - "identifier": "https://github.com/sagemath/sage/tree/9.3.beta3", + "identifier": "https://github.com/sagemath/sage/tree/9.3.beta4", "relation": "isSupplementTo" }, { diff --git a/VERSION.txt b/VERSION.txt index ae7bf5faa08..c68a1e21bd0 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -SageMath version 9.3.beta3, Release Date: 2020-12-06 +SageMath version 9.3.beta4, Release Date: 2020-12-14 diff --git a/bootstrap b/bootstrap index 83535a112a1..35c2e420620 100755 --- a/bootstrap +++ b/bootstrap @@ -80,14 +80,11 @@ install_config_rpath() { bootstrap () { rm -f m4/sage_spkg_configures.m4 spkg_configures="" - for filename in $(find build/pkgs -type f -name type); do - pkgtype="$(cat $filename)" - pkgname="$(echo $filename | cut -d/ -f3)" - case "$pkgtype" in - optional|experimental) + for pkgname in $(./sage --package list :optional: :experimental: | sort); do # Trac #29629: Temporary solution for Sage 9.1: Do not provide # --enable-SPKG options for installing pip packages - if [ ! -f "$(dirname $filename)/requirements.txt" ]; then + if [ ! -f build/pkgs/$pkgname/requirements.txt ]; then + pkgtype="$(cat build/pkgs/$pkgname/type)" # Trac #29124: Do not provide --enable-_recommended and similar case "$pkgname" in _*) ;; @@ -95,12 +92,9 @@ bootstrap () { SAGE_SPKG_ENABLE([$pkgname], [$pkgtype])" ;; esac fi - ;; - esac done - for filename in $(find build/pkgs -type f -name spkg-configure.m4 | sort); do - pkgname="$(echo $filename | cut -d/ -f3)" - echo "m4_sinclude([$filename])" >> m4/sage_spkg_configures.m4 + for pkgname in $(./sage --package list --has-file spkg-configure.m4 | sort); do + echo "m4_sinclude([build/pkgs/$pkgname/spkg-configure.m4])" >> m4/sage_spkg_configures.m4 spkg_configures="$spkg_configures SAGE_SPKG_CONFIGURE_$(echo ${pkgname} | tr '[a-z]' '[A-Z]')" done diff --git a/build/bin/sage-build-env b/build/bin/sage-build-env new file mode 100644 index 00000000000..3d4c4c49047 --- /dev/null +++ b/build/bin/sage-build-env @@ -0,0 +1,92 @@ +# -*- shell-script -*- + +########################################################################### +# +# Determine environment variables according to configuration. +# +# NOTES: +# - You must *source* this script instead of executing. +# - Use "return" instead of "exit" to signal a failure. Since this +# file is sourced, an "exit" here will actually exit src/bin/sage, +# which is probably not intended. +# - All environment variables set here should be *exported*, otherwise +# they won't be available in child programs. +# +# If you want to set all environment variables for your shell like +# they are during the build of Sage packages, type +# +# sage --buildsh +# +########################################################################## + +# Optimization flags. +# +# The compiler flags are set in order of priority by +# 1) environment variables +# 2) flags set at configuration time +if [ "x$CFLAGS" == "x" ]; then + export ORIGINAL_CFLAGS="$CONFIGURED_CFLAGS" +else + export ORIGINAL_CFLAGS="$CFLAGS" +fi +if [ "x$CXXFLAGS" == "x" ]; then + export ORIGINAL_CXXFLAGS="$CONFIGURED_CXXFLAGS" +else + export ORIGINAL_CXXFLAGS="$CXXFLAGS" +fi +if [ "x$FCFLAGS" == "x" ]; then + export ORIGINAL_FCFLAGS="$CONFIGURED_FCFLAGS" +else + export ORIGINAL_FCFLAGS="$FCFLAGS" +fi +if [ "x$F77FLAGS" == "x" ]; then + export ORIGINAL_F77FLAGS="$CONFIGURED_F77FLAGS" +else + export ORIGINAL_F77FLAGS="$F77FLAGS" +fi + +# We optimize according to $SAGE_DEBUG. +if [ "x$ORIGINAL_CFLAGS" == "x" ]; then + # Evaluate SAGE_DEBUG: + if [ "x$SAGE_DEBUG" == "xyes" ]; then + export CFLAGS="-Og -g" + export CFLAGS_O3="-Og -g" + elif [ "x$SAGE_DEBUG" == "xno" ]; then + export CFLAGS="-O2" + export CFLAGS_O3="-O3" + else + export CFLAGS="-O2 -g" + export CFLAGS_O3="-O3 -g" + fi +else + # Respect user environment variable. + export CFLAGS="$ORIGINAL_CFLAGS" + export CFLAGS_O3="$ORIGINAL_CFLAGS" +fi + +# Copy to CXXFLAGS if this is not set. +if [ "x$ORIGINAL_CXXFLAGS" == "x" ]; then + export CXXFLAGS="$CFLAGS" + export CXXFLAGS_O3="$CFLAGS_O3" +else + export CXXFLAGS="$ORIGINAL_CXXFLAGS" + export CXXFLAGS_O3="$ORIGINAL_CXXFLAGS" +fi + +# Copy CFLAGS to FCFLAGS if this is not set. +if [ "x$ORIGINAL_FCFLAGS" == "x" ]; then + export FCFLAGS="$CFLAGS" + export FCFLAGS_O3="$CFLAGS_O3" +else + export FCFLAGS="$ORIGINAL_FCFLAGS" + export FCFLAGS_O3="$ORIGINAL_FCFLAGS" +fi + +# Copy FCFLAGS to F77FLAGS if this is not set. +if [ "x$ORIGINAL_F77FLAGS" == "x" ]; then + export F77FLAGS="$FCFLAGS" + export F77FLAGS_O3="$FCFLAGS_O3" +else + export F77FLAGS="$ORIGINAL_F77FLAGS" + export F77FLAGS_O3="$ORIGINAL_F77FLAGS" +fi diff --git a/build/bin/sage-build-env-config.in b/build/bin/sage-build-env-config.in index 01ba892dfd6..29ad8f10961 100644 --- a/build/bin/sage-build-env-config.in +++ b/build/bin/sage-build-env-config.in @@ -22,6 +22,21 @@ # The configured CXX without special flags added that enable C++11 support export SAGE_CXX_WITHOUT_STD="@SAGE_CXX_WITHOUT_STD@" +# Export SAGE_FAT_BINARY if this was enabled during configure. +export SAGE_FAT_BINARY="@SAGE_FAT_BINARY@" + +# Export SAGE_DEBUG if this was enabled during configure, +# but be respectful of the current settings. +if [ "x$SAGE_DEBUG" == "x" ]; then + export SAGE_DEBUG="@SAGE_DEBUG@" +fi + +# The configured compilation flags. +export CONFIGURED_CFLAGS="@CFLAGS@" +export CONFIGURED_CXXFLAGS="@CXXFLAGS@" +export CONFIGURED_FCFLAGS="@FCFLAGS@" +export CONFIGURED_F77FLAGS="@F77FLAGS@" + # This is usually blank if the system GMP is used, or $SAGE_LOCAL otherwise export SAGE_GMP_PREFIX="@SAGE_GMP_PREFIX@" export SAGE_GMP_INCLUDE="@SAGE_GMP_INCLUDE@" @@ -41,7 +56,7 @@ fi export SAGE_MPFR_PREFIX="@SAGE_MPFR_PREFIX@" if [ -n "$SAGE_MPFR_PREFIX" ]; then # Some packages that depend on MPFR accept a --with-mpfr= flag to - # their ./configure scripts. Thus we deal with this just as with GMP above. + # their ./configure scripts. Thus we deal with this just as with GMP above. export SAGE_CONFIGURE_MPFR="--with-mpfr=$SAGE_MPFR_PREFIX" fi @@ -50,7 +65,7 @@ fi export SAGE_MPC_PREFIX="@SAGE_MPC_PREFIX@" if [ -n "$SAGE_MPC_PREFIX" ]; then # Some packages that depend on MPC accept a --with-mpc= flag to - # their ./configure scripts. Thus we deal with this just as with GMP above. + # their ./configure scripts. Thus we deal with this just as with GMP above. export SAGE_CONFIGURE_MPC="--with-mpc=$SAGE_MPC_PREFIX" fi diff --git a/build/bin/sage-dist-helpers b/build/bin/sage-dist-helpers index 70815c16da1..b100bb8ef75 100644 --- a/build/bin/sage-dist-helpers +++ b/build/bin/sage-dist-helpers @@ -200,6 +200,14 @@ sdh_make_install() { sdh_die "Error installing $PKG_NAME" } +sdh_setup_bdist_wheel() { + mkdir -p dist + rm -f dist/*.whl + BDIST_DIR="$(mktemp -d)" + sage-python23 setup.py --no-user-cfg \ + bdist_wheel --bdist-dir "$BDIST_DIR" \ + "$@" || sdh_die "Error building a wheel for $PKG_NAME" +} sdh_pip_install() { echo "Installing $PKG_NAME" diff --git a/build/bin/sage-print-system-package-command b/build/bin/sage-print-system-package-command index 9e16ed86433..dd5d45cfbb7 100755 --- a/build/bin/sage-print-system-package-command +++ b/build/bin/sage-print-system-package-command @@ -98,6 +98,9 @@ case $system:$command in [ "$YES" = yes ] && options="$options --yes" [ -n "$system_packages" ] && echo "${PROMPT}${SUDO}xbps-install $options $system_packages" ;; + opensuse*:install) + [ -n "$system_packages" ] && echo "${PROMPT}${SUDO}zypper install $system_packages" + ;; *conda*:install) [ "$YES" = yes ] && options="$options --yes" [ -n "$system_packages" ] && echo "${PROMPT}conda install $system_packages" diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index c497a29ca38..35851f6aee2 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -171,12 +171,19 @@ fi . sage-env-config . sage-env - if [ $? -ne 0 ]; then error_msg "Error setting environment variables by sourcing sage-env" exit 1 fi +. sage-build-env-config +. sage-build-env + +if [ $? -ne 0 ]; then + error_msg "Error setting environment variables by sourcing sage-build-env" + exit 1 +fi + if [ -z "$SAGE_BUILD_DIR" ]; then export SAGE_BUILD_DIR="$SAGE_LOCAL/var/tmp/sage/build" fi diff --git a/build/bin/write-dockerfile.sh b/build/bin/write-dockerfile.sh index e028a79305f..8b84e05bc03 100755 --- a/build/bin/write-dockerfile.sh +++ b/build/bin/write-dockerfile.sh @@ -107,6 +107,14 @@ EOF EXISTS="xbps-query" INSTALL="xbps-install --yes" ;; + opensuse*) + cat </dependencies files @@ -436,12 +479,7 @@ pkg_deps = \ # $(2): package version # $(3): package dependencies -ifeq "$(origin SAGE_CHECK)" "undefined" -SAGE_CHECK := no -endif - define NORMAL_PACKAGE_templ ########################################## -SAGE_CHECK_$(1) := $(SAGE_CHECK) $(1)-build-deps: $(3) @@ -473,38 +511,6 @@ $(foreach pkgname, $(NORMAL_PACKAGES),\ $(call pkg_deps,$(pkgname))))) endif -# Parsing the SAGE_CHECK_PACKAGES variable: -# - if this contains "!pkg", set SAGE_CHECK_pkg=no. -# - if this contains "?pkg", set SAGE_CHECK_pkg=warn. -# - if this contains "pkg", set SAGE_CHECK_pkg=yes. -# -# We check this now and export SAGE_CHECK_pkg for -# dependencies and the Makefile rules. -# -# Since Python's self-tests seem to fail on all platforms, we disable -# its test suite by default. -# However, if SAGE_CHECK=warn, we do not do that. -SAGE_CHECK_PACKAGES_DEFAULT_yes := !python3 -SAGE_CHECK_PACKAGES_DEFAULT_warn := -SAGE_CHECK_PACKAGES_DEFAULT_no := -comma := , -ifeq "$(origin SAGE_CHECK_PACKAGES)" "undefined" -SAGE_CHECK_PACKAGES := $(SAGE_CHECK_PACKAGES_DEFAULT$(SAGE_CHECK)) -endif -SAGE_CHECK_PACKAGES_sep := $(subst $(comma), ,$(SAGE_CHECK_PACKAGES)) -SAGE_CHECK_PACKAGES_sep := $(subst :, ,$(SAGE_CHECK_PACKAGES_sep)) -define SET_SAGE_CHECK -$(eval SAGE_CHECK_$(1) := $(2)) -endef -$(foreach clause, $(SAGE_CHECK_PACKAGES_sep), \ - $(if $(findstring !,$(clause)), \ - $(eval $(call SET_SAGE_CHECK,$(subst !,,$(clause)),no)), \ - $(if $(findstring ?,$(clause)), \ - $(eval $(call SET_SAGE_CHECK,$(subst ?,,$(clause)),warn)), \ - $(eval $(call SET_SAGE_CHECK,$(clause),yes))))) -debug-check: - @echo $(foreach pkgname, $(NORMAL_PACKAGES), SAGE_CHECK_$(pkgname) = $(SAGE_CHECK_$(pkgname))) - # ================================ pip packages =============================== # Generate build rules for 'pip' packages; this template is used to generate # two rules in the form: @@ -550,6 +556,8 @@ endif # $(AM_V_at)cd '$SAGE_ROOT' && \\ # . '$SAGE_ROOT/src/bin/sage-env-config' && \\ # . '$SAGE_ROOT/src/bin/sage-env' && \\ +# . '$SAGE_ROOT/build/bin/sage-build-env-config' && \\ +# . '$SAGE_ROOT/build/bin/sage-build-env' && \\ # sage-logger -p '$SAGE_ROOT/build/pkgs//spkg-install' '$(SAGE_LOGS)/.log' # # : $(INST)/- @@ -558,6 +566,8 @@ endif # -$(AM_V_at)cd '$SAGE_ROOT' && \\ # . '$SAGE_ROOT/src/bin/sage-env-config' && \\ # . '$SAGE_ROOT/src/bin/sage-env' && \\ +# . '$SAGE_ROOT/build/bin/sage-build-env-config' && \\ +# . '$SAGE_ROOT/build/bin/sage-build-env' && \\ # '$SAGE_ROOT/build/pkgs/$PKG_NAME/spkg-uninstall' # Positional arguments: @@ -577,6 +587,7 @@ $(1)-no-deps: . '$$(SAGE_ROOT)/src/bin/sage-env-config' && \ . '$$(SAGE_ROOT)/src/bin/sage-env' && \ . '$$(SAGE_ROOT)/build/bin/sage-build-env-config' && \ + . '$$(SAGE_ROOT)/build/bin/sage-build-env' && \ sage-logger -p '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-install' '$$(SAGE_LOGS)/$(1)-$(2).log' touch "$$(INST)/$(1)-$(2)" @@ -585,6 +596,7 @@ $(1)-uninstall: . '$$(SAGE_ROOT)/src/bin/sage-env-config' && \ . '$$(SAGE_ROOT)/src/bin/sage-env' && \ . '$$(SAGE_ROOT)/build/bin/sage-build-env-config' && \ + . '$$(SAGE_ROOT)/build/bin/sage-build-env' && \ '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-uninstall' -rm -f "$$(INST)/$(1)-$(2)" diff --git a/build/pkgs/4ti2/distros/opensuse.txt b/build/pkgs/4ti2/distros/opensuse.txt new file mode 100644 index 00000000000..b8cd8817e37 --- /dev/null +++ b/build/pkgs/4ti2/distros/opensuse.txt @@ -0,0 +1,2 @@ +4ti2 +4ti2-devel diff --git a/build/pkgs/alabaster/distros/opensuse.txt b/build/pkgs/alabaster/distros/opensuse.txt new file mode 100644 index 00000000000..dcc39f9e849 --- /dev/null +++ b/build/pkgs/alabaster/distros/opensuse.txt @@ -0,0 +1 @@ +python3-alabaster diff --git a/build/pkgs/arb/checksums.ini b/build/pkgs/arb/checksums.ini index 3e0307d9140..518dc3adbc3 100644 --- a/build/pkgs/arb/checksums.ini +++ b/build/pkgs/arb/checksums.ini @@ -1,4 +1,5 @@ tarball=arb-VERSION.tar.gz -sha1=cdbb3d63034a39f22f850def9bd365f7073f620a -md5=17816f8aa027a5e7fb8b5e62b2b40ce4 -cksum=577630044 +sha1=e81e2a1dd7f97a4e6c44882ac7814d720eb14081 +md5=10361d31f4b5b6522afb3944424e8abc +cksum=306434042 +upstream_url=https://github.com/fredrik-johansson/arb/archive/VERSION.tar.gz diff --git a/build/pkgs/arb/distros/opensuse.txt b/build/pkgs/arb/distros/opensuse.txt new file mode 100644 index 00000000000..3319855150c --- /dev/null +++ b/build/pkgs/arb/distros/opensuse.txt @@ -0,0 +1 @@ +arb-devel diff --git a/build/pkgs/arb/package-version.txt b/build/pkgs/arb/package-version.txt index b735dbac958..a36e9b0906d 100644 --- a/build/pkgs/arb/package-version.txt +++ b/build/pkgs/arb/package-version.txt @@ -1 +1 @@ -2.16.0.p1 +2.18.1 diff --git a/build/pkgs/arb/patches/flint26comp.patch b/build/pkgs/arb/patches/flint26comp.patch deleted file mode 100644 index 98ff5e95b40..00000000000 --- a/build/pkgs/arb/patches/flint26comp.patch +++ /dev/null @@ -1,48 +0,0 @@ -From d3d9983231e0f034e86a1e75761627eb8213b704 Mon Sep 17 00:00:00 2001 -From: fredrik -Date: Wed, 29 Apr 2020 13:41:36 +0200 -Subject: [PATCH] handle flint incompatibilities - ---- - fmpr.h | 4 ++++ - fmpz_extras.h | 4 ++++ - 2 files changed, 8 insertions(+) - -diff --git a/fmpr.h b/fmpr.h -index 2204d72e..c6a8c342 100644 ---- a/fmpr.h -+++ b/fmpr.h -@@ -22,7 +22,11 @@ - #include "flint/flint.h" - #include "flint/fmpz.h" - #include "flint/fmpq.h" -+#if __FLINT_RELEASE < 20600 - #include "flint/config.h" -+#else -+#include "flint/flint-config.h" -+#endif - #include "fmpz_extras.h" - - #ifndef flint_abort -diff --git a/fmpz_extras.h b/fmpz_extras.h -index 4fd0538f..486e28c8 100644 ---- a/fmpz_extras.h -+++ b/fmpz_extras.h -@@ -43,6 +43,8 @@ fmpz_add_inline(fmpz_t z, const fmpz_t x, const fmpz_t y) - fmpz_add(z, x, y); - } - -+#if __FLINT_RELEASE < 20600 -+ - static __inline__ void - fmpz_add_si(fmpz_t z, const fmpz_t x, slong y) - { -@@ -61,6 +63,8 @@ fmpz_sub_si(fmpz_t z, const fmpz_t x, slong y) - fmpz_add_ui(z, x, -y); - } - -+#endif -+ - static __inline__ void - fmpz_add_si_inline(fmpz_t z, const fmpz_t x, slong y) - { diff --git a/build/pkgs/arb/patches/silence-stderr-exponent-too-large.patch b/build/pkgs/arb/patches/silence-stderr-exponent-too-large.patch deleted file mode 100644 index dbc608955c4..00000000000 --- a/build/pkgs/arb/patches/silence-stderr-exponent-too-large.patch +++ /dev/null @@ -1,37 +0,0 @@ -Do not write stuff to stderr when signalling errors - -See https://trac.sagemath.org/ticket/28817 - - -diff --git a/arf/get_mpfr.c b/arf/get_mpfr.c -index 34012af..9ccb87b 100644 ---- a/arf/get_mpfr.c -+++ b/arf/get_mpfr.c -@@ -30,7 +30,6 @@ arf_get_mpfr(mpfr_t x, const arf_t y, mpfr_rnd_t rnd) - } - else if (COEFF_IS_MPZ(*ARF_EXPREF(y))) - { -- flint_printf("exception: exponent too large to convert to mpfr"); - flint_abort(); - r = 0; /* dummy return because flint_abort() is not declared noreturn */ - } -diff --git a/fmpr/get_mpfr.c b/fmpr/get_mpfr.c -index 63b6682..e2dda3b 100644 ---- a/fmpr/get_mpfr.c -+++ b/fmpr/get_mpfr.c -@@ -25,7 +25,6 @@ fmpr_get_mpfr(mpfr_t x, const fmpr_t y, mpfr_rnd_t rnd) - } - else if (COEFF_IS_MPZ(*fmpr_expref(y))) - { -- flint_printf("exception: exponent too large to convert to mpfr"); - flint_abort(); - r = 0; /* dummy return because flint_abort() is not declared noreturn */ - } -@@ -42,7 +41,6 @@ fmpr_get_mpfr(mpfr_t x, const fmpr_t y, mpfr_rnd_t rnd) - - if (!mpfr_regular_p(x)) - { -- flint_printf("exception: exponent too large to convert to mpfr"); - flint_abort(); - } - } diff --git a/build/pkgs/arb/spkg-install.in b/build/pkgs/arb/spkg-install.in index 4aa200a2b91..9322f04c912 100644 --- a/build/pkgs/arb/spkg-install.in +++ b/build/pkgs/arb/spkg-install.in @@ -1,9 +1,5 @@ cd src -# The git head of arb now honors LDFLAGS; The following workaround can -# be removed in arb >= 2.8 when it is released -export EXTRA_SHARED_FLAGS=$LDFLAGS - # Trac #29607: We must always supply --with-gmp, --with-mpfr, # --with-flint because otherwise ARB's configure script uses # /usr/local, which is always wrong. diff --git a/build/pkgs/babel/distros/opensuse.txt b/build/pkgs/babel/distros/opensuse.txt new file mode 100644 index 00000000000..70bb05b1327 --- /dev/null +++ b/build/pkgs/babel/distros/opensuse.txt @@ -0,0 +1 @@ +python3-Babel diff --git a/build/pkgs/barvinok/distros/opensuse.txt b/build/pkgs/barvinok/distros/opensuse.txt new file mode 100644 index 00000000000..b3369e09db7 --- /dev/null +++ b/build/pkgs/barvinok/distros/opensuse.txt @@ -0,0 +1,2 @@ +barvinok +"pkgconfig(barvinok)" diff --git a/build/pkgs/benzene/distros/opensuse.txt b/build/pkgs/benzene/distros/opensuse.txt new file mode 100644 index 00000000000..57a8cd09221 --- /dev/null +++ b/build/pkgs/benzene/distros/opensuse.txt @@ -0,0 +1 @@ +benzene diff --git a/build/pkgs/bliss/distros/opensuse.txt b/build/pkgs/bliss/distros/opensuse.txt new file mode 100644 index 00000000000..681ebb3f402 --- /dev/null +++ b/build/pkgs/bliss/distros/opensuse.txt @@ -0,0 +1,2 @@ +bliss +bliss-devel diff --git a/build/pkgs/boost/distros/opensuse.txt b/build/pkgs/boost/distros/opensuse.txt new file mode 100644 index 00000000000..fee2552239a --- /dev/null +++ b/build/pkgs/boost/distros/opensuse.txt @@ -0,0 +1 @@ +boost-devel diff --git a/build/pkgs/boost_cropped/distros/opensuse.txt b/build/pkgs/boost_cropped/distros/opensuse.txt new file mode 100644 index 00000000000..fee2552239a --- /dev/null +++ b/build/pkgs/boost_cropped/distros/opensuse.txt @@ -0,0 +1 @@ +boost-devel diff --git a/build/pkgs/brial/distros/opensuse.txt b/build/pkgs/brial/distros/opensuse.txt new file mode 100644 index 00000000000..f28d17cd914 --- /dev/null +++ b/build/pkgs/brial/distros/opensuse.txt @@ -0,0 +1 @@ +brial-devel diff --git a/build/pkgs/buckygen/distros/opensuse.txt b/build/pkgs/buckygen/distros/opensuse.txt new file mode 100644 index 00000000000..f8899d37da8 --- /dev/null +++ b/build/pkgs/buckygen/distros/opensuse.txt @@ -0,0 +1 @@ +buckygen diff --git a/build/pkgs/bzip2/distros/opensuse.txt b/build/pkgs/bzip2/distros/opensuse.txt new file mode 100644 index 00000000000..ad77a92d4bb --- /dev/null +++ b/build/pkgs/bzip2/distros/opensuse.txt @@ -0,0 +1,3 @@ +# spkg-configure checks for both the program and the library +bzip2 +"pkgconfig(bzip2)" diff --git a/build/pkgs/ccache/distros/opensuse.txt b/build/pkgs/ccache/distros/opensuse.txt new file mode 100644 index 00000000000..812b9efc0c5 --- /dev/null +++ b/build/pkgs/ccache/distros/opensuse.txt @@ -0,0 +1 @@ +ccache diff --git a/build/pkgs/cddlib/distros/opensuse.txt b/build/pkgs/cddlib/distros/opensuse.txt index f9afcc0b330..ffb93647443 100644 --- a/build/pkgs/cddlib/distros/opensuse.txt +++ b/build/pkgs/cddlib/distros/opensuse.txt @@ -1 +1,2 @@ -cddlib +cddlib-tools +"pkgconfig(cddlib)" diff --git a/build/pkgs/certifi/distros/opensuse.txt b/build/pkgs/certifi/distros/opensuse.txt new file mode 100644 index 00000000000..f585a823bf3 --- /dev/null +++ b/build/pkgs/certifi/distros/opensuse.txt @@ -0,0 +1 @@ +python3-certifi diff --git a/build/pkgs/cffi/distros/opensuse.txt b/build/pkgs/cffi/distros/opensuse.txt new file mode 100644 index 00000000000..68ec4dda5ba --- /dev/null +++ b/build/pkgs/cffi/distros/opensuse.txt @@ -0,0 +1 @@ +python3-cffi diff --git a/build/pkgs/cliquer/distros/opensuse.txt b/build/pkgs/cliquer/distros/opensuse.txt new file mode 100644 index 00000000000..718f9f6b2cf --- /dev/null +++ b/build/pkgs/cliquer/distros/opensuse.txt @@ -0,0 +1,2 @@ +cliquer +cliquer-devel diff --git a/build/pkgs/cmake/distros/opensuse.txt b/build/pkgs/cmake/distros/opensuse.txt new file mode 100644 index 00000000000..a3ea3e4380f --- /dev/null +++ b/build/pkgs/cmake/distros/opensuse.txt @@ -0,0 +1 @@ +cmake diff --git a/build/pkgs/cmake/distros/void.txt b/build/pkgs/cmake/distros/void.txt new file mode 100644 index 00000000000..a3ea3e4380f --- /dev/null +++ b/build/pkgs/cmake/distros/void.txt @@ -0,0 +1 @@ +cmake diff --git a/build/pkgs/configure/checksums.ini b/build/pkgs/configure/checksums.ini index be455b1c02f..1415acd8ff5 100644 --- a/build/pkgs/configure/checksums.ini +++ b/build/pkgs/configure/checksums.ini @@ -1,4 +1,4 @@ tarball=configure-VERSION.tar.gz -sha1=9630148997eadc90f50a99bc8902d9759cd63d4d -md5=c73af26d82eac1af9725ca780e650ebb -cksum=78369567 +sha1=bd555cd949f9c99a9d99902c577e13345f5fbc01 +md5=a39377025f0bae6d2f026d48ae9b564b +cksum=3175310020 diff --git a/build/pkgs/configure/package-version.txt b/build/pkgs/configure/package-version.txt index 332f2751dc8..041b544f3ab 100644 --- a/build/pkgs/configure/package-version.txt +++ b/build/pkgs/configure/package-version.txt @@ -1 +1 @@ -3290413be62de2cc4b8568c058ffe33b05acca0b +2fc350e432bf89430424a9db1b5e0f4cc88b75e8 diff --git a/build/pkgs/coxeter3/distros/opensuse.txt b/build/pkgs/coxeter3/distros/opensuse.txt new file mode 100644 index 00000000000..5c93834daba --- /dev/null +++ b/build/pkgs/coxeter3/distros/opensuse.txt @@ -0,0 +1 @@ +coxeter diff --git a/build/pkgs/curl/distros/opensuse.txt b/build/pkgs/curl/distros/opensuse.txt new file mode 100644 index 00000000000..ffd4f36dc86 --- /dev/null +++ b/build/pkgs/curl/distros/opensuse.txt @@ -0,0 +1,2 @@ +curl +"pkgconfig(libcurl)" diff --git a/build/pkgs/cysignals/spkg-check.in b/build/pkgs/cysignals/spkg-check.in index be297af0cdd..75c31b896aa 100644 --- a/build/pkgs/cysignals/spkg-check.in +++ b/build/pkgs/cysignals/spkg-check.in @@ -1 +1,4 @@ +# #29473: Override -Wp,-D_FORTIFY_SOURCE from Fedora's python3. +export CPPFLAGS="$CPPFLAGS -Wp,-U_FORTIFY_SOURCE" + cd src && $MAKE check-install PYTHON=sage-python23 diff --git a/build/pkgs/decorator/distros/opensuse.txt b/build/pkgs/decorator/distros/opensuse.txt new file mode 100644 index 00000000000..46c478e1513 --- /dev/null +++ b/build/pkgs/decorator/distros/opensuse.txt @@ -0,0 +1 @@ +python3-decorator diff --git a/build/pkgs/docutils/distros/docutils.txt b/build/pkgs/docutils/distros/docutils.txt new file mode 100644 index 00000000000..a4bb792a5a4 --- /dev/null +++ b/build/pkgs/docutils/distros/docutils.txt @@ -0,0 +1 @@ +python3-docutils diff --git a/build/pkgs/e_antic/spkg-install.in b/build/pkgs/e_antic/spkg-install.in index c9aa58efa63..0c0f5d01a1f 100644 --- a/build/pkgs/e_antic/spkg-install.in +++ b/build/pkgs/e_antic/spkg-install.in @@ -3,10 +3,6 @@ # e-antic Sage install script # ############################################################################### -if [ "$SAGE_DEBUG" = "yes" ]; then - CFLAGS="-O0 -g $CFLAGS"; export CFLAGS -fi - cd src sdh_configure diff --git a/build/pkgs/ecl/spkg-install.in b/build/pkgs/ecl/spkg-install.in index 4e2d7aa2763..5e007ef3135 100644 --- a/build/pkgs/ecl/spkg-install.in +++ b/build/pkgs/ecl/spkg-install.in @@ -1,13 +1,5 @@ cd src -if [ "x$SAGE_DEBUG" = "xyes" ] ; then - CFLAGS="-g -O0 $CFLAGS" - CXXFLAGS="-g -O0 $CXXFLAGS" -else - CFLAGS="-g -O2 $CFLAGS" - CXXFLAGS="-g -O2 $CXXFLAGS" -fi - if [ "$UNAME" = "CYGWIN" ]; then # Some of ECL's sources rely on GNU-isms that are allowed by default on # most glibcs, but not in newlib; https://trac.sagemath.org/ticket/25057 diff --git a/build/pkgs/eclib/spkg-install.in b/build/pkgs/eclib/spkg-install.in index ba9a4c0b358..9ccc0420e34 100644 --- a/build/pkgs/eclib/spkg-install.in +++ b/build/pkgs/eclib/spkg-install.in @@ -1,15 +1,7 @@ -if [ "$SAGE_DEBUG" = yes ]; then - echo >&2 "Warning: Setting SAGE_DEBUG=yes completely disables optimization." - CFLAGS="$CFLAGS -g -O0" - CXXFLAGS="$CXXFLAGS -g -O0" -else - # Add debug symbols by default, enable optimization, but let the user - # still override these settings: - CFLAGS="-g -O3 $CFLAGS" - CXXFLAGS="-g -O3 $CXXFLAGS" -fi +CFLAGS="$CFLAGS_O3" +CXXFLAGS="$CXXFLAGS_O3" -export CFLAGS CPPFLAGS CXXFLAGS LDFLAGS +export CFLAGS CXXFLAGS echo "Deleting old versions of eclib libraries, which" diff --git a/build/pkgs/ecm/spkg-install.in b/build/pkgs/ecm/spkg-install.in index 610dd249822..e537735a038 100644 --- a/build/pkgs/ecm/spkg-install.in +++ b/build/pkgs/ecm/spkg-install.in @@ -52,6 +52,8 @@ if [ -n "$system_gmp_h" ]; then esac fi +CFLAGS="$CFLAGS_O3" + # libtool should add the proper flags, but doesn't use "-fPIC" # for the *static* library (which the Sage library links to unless @@ -62,6 +64,7 @@ if ! (echo $ECM_CONFIGURE | egrep -- "--enable-shared|--with-pic" >/dev/null) || then echo "Adding '-fPIC' to CFLAGS since we don't (also) build a shared library." CFLAGS="$CFLAGS -fPIC" # alternatively add '--with-pic' to 'configure' options + ORIGINAL_CFLAGS="$ORIGINAL_CFLAGS -fPIC" else # PIC usually slows down the execution, so don't use it for the *static* # library (unless '--with-pic' was given). libtool does the right thing @@ -79,7 +82,6 @@ fi if [ "$SAGE_DEBUG" = yes ]; then # Add debug symbols and disable optimization: echo >&2 "Warning: Setting SAGE_DEBUG=yes completely disables optimization." - CFLAGS="-g -O0 $CFLAGS" echo "You may in addition (or instead) pass '--enable-assert' and/or" echo "'--enable-memory-debug' to GMP-ECM's 'configure' by setting (and" echo "of course exporting) ECM_CONFIGURE accordingly." @@ -96,10 +98,8 @@ else echo >&2 "See http://trac.sagemath.org/sage_trac/ticket/5847#comment:35" \ "ff. for details." echo >&2 - CFLAGS="-O3 $CFLAGS" + CFLAGS="-O3 $ORIGINAL_CFLAGS" ;; - *) - CFLAGS="-g -O3 $CFLAGS" esac fi diff --git a/build/pkgs/fflas_ffpack/distros/opensuse.txt b/build/pkgs/fflas_ffpack/distros/opensuse.txt index 683f84a42ca..2dda5369b8d 100644 --- a/build/pkgs/fflas_ffpack/distros/opensuse.txt +++ b/build/pkgs/fflas_ffpack/distros/opensuse.txt @@ -1 +1 @@ -fflas-ffpack +"pkgconfig(fflas-ffpack)" diff --git a/build/pkgs/flint/distros/opensuse.txt b/build/pkgs/flint/distros/opensuse.txt new file mode 100644 index 00000000000..a176994f938 --- /dev/null +++ b/build/pkgs/flint/distros/opensuse.txt @@ -0,0 +1 @@ +flint-devel diff --git a/build/pkgs/flint/spkg-install.in b/build/pkgs/flint/spkg-install.in index c648fe3ca01..eacd7b6e491 100644 --- a/build/pkgs/flint/spkg-install.in +++ b/build/pkgs/flint/spkg-install.in @@ -5,7 +5,6 @@ ############################################################################### if [ "$SAGE_DEBUG" = "yes" ]; then echo "Building a debug version of FLINT." - CFLAGS="-O0 -g $CFLAGS"; export CFLAGS FLINT_TUNE=" $FLINT_TUNE"; export FLINT_TUNE FLINT_CONFIGURE="--enable-assert $FLINT_CONFIGURE" fi diff --git a/build/pkgs/fplll/distros/opensuse.txt b/build/pkgs/fplll/distros/opensuse.txt new file mode 100644 index 00000000000..7476462ad58 --- /dev/null +++ b/build/pkgs/fplll/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(fplll)" diff --git a/build/pkgs/fplll/spkg-install.in b/build/pkgs/fplll/spkg-install.in index 4e1fab1dd87..619a3e8d53c 100644 --- a/build/pkgs/fplll/spkg-install.in +++ b/build/pkgs/fplll/spkg-install.in @@ -17,10 +17,7 @@ if [ "$UNAME" = "CYGWIN" ]; then fi if [ "x$SAGE_DEBUG" = "xyes" ]; then - CXXFLAGS="$CXXFLAGS -O0" CONFIGUREFLAGS="$CONFIGUREFLAGS --enable-debug" -else - CXXFLAGS="$CXXFLAGS -O3" fi export CXXFLAGS="$CXXFLAGS" diff --git a/build/pkgs/freetype/distros/opensuse.txt b/build/pkgs/freetype/distros/opensuse.txt new file mode 100644 index 00000000000..33f8f6b7bdd --- /dev/null +++ b/build/pkgs/freetype/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(freetype2)" diff --git a/build/pkgs/freetype/distros/void.txt b/build/pkgs/freetype/distros/void.txt index 8ca004ddd3c..377935546a3 100644 --- a/build/pkgs/freetype/distros/void.txt +++ b/build/pkgs/freetype/distros/void.txt @@ -1,3 +1,3 @@ -freetype +freetype-devel harfbuzz glib diff --git a/build/pkgs/gambit/spkg-install.in b/build/pkgs/gambit/spkg-install.in index 9e2f7964129..61b6e43c0d4 100644 --- a/build/pkgs/gambit/spkg-install.in +++ b/build/pkgs/gambit/spkg-install.in @@ -11,9 +11,5 @@ cd src/python rm gambit/lib/libgambit.cpp # pip doesn't work (https://github.com/gambitproject/gambit/issues/207) -sage-python23 setup.py --no-user-cfg bdist_wheel -if [ $? -ne 0 ]; then - echo "Error installing Python API" - exit 1 -fi +sdh_setup_bdist_wheel sdh_store_and_pip_install_wheel . diff --git a/build/pkgs/gap/checksums.ini b/build/pkgs/gap/checksums.ini index 148ab832b76..76035c17031 100644 --- a/build/pkgs/gap/checksums.ini +++ b/build/pkgs/gap/checksums.ini @@ -1,4 +1,5 @@ tarball=gap-VERSION.tar.bz2 -sha1=ceeb3dfbc0c26031ad53b0256ed04ca9d532566d -md5=36a141e05bb55be5d6ead7ccda969c5e -cksum=3891403157 +sha1=0998ec7153ead8c6ccfc33e4c20156b7bb2ffb44 +md5=c5544dd73507c01760416ad04acff6f1 +cksum=290729880 +upstream_url=https://www.gap-system.org/pub/gap/gap-4.11/tar.bz2/gap-4.11.0.tar.bz2 diff --git a/build/pkgs/gap/package-version.txt b/build/pkgs/gap/package-version.txt index 5cd045ae73e..0367118566f 100644 --- a/build/pkgs/gap/package-version.txt +++ b/build/pkgs/gap/package-version.txt @@ -1 +1 @@ -4.10.2.p1 +4.11.0.p1 diff --git a/build/pkgs/gap/patches/0001-Don-t-set-SyAllocPool-0-for-Cygwin-but-do-use-MAP_NO.patch b/build/pkgs/gap/patches/0001-Don-t-set-SyAllocPool-0-for-Cygwin-but-do-use-MAP_NO.patch deleted file mode 100644 index 262f16f68ad..00000000000 --- a/build/pkgs/gap/patches/0001-Don-t-set-SyAllocPool-0-for-Cygwin-but-do-use-MAP_NO.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 78506f0a4fba05a238ec6e752c6d3cf2c8336bc8 Mon Sep 17 00:00:00 2001 -From: "Erik M. Bray" -Date: Tue, 26 Feb 2019 13:26:11 +0100 -Subject: [PATCH] Don't set SyAllocPool = 0 for Cygwin, but do use - MAP_NORESERVE for mmaps on Cygwin - -Using MAP_NORESERVE on Cygwin prevents the need to commit physical pages -for the entirety of mmap'd regions until they are actually used. ---- - src/sysmem.c | 16 +++++++++++----- - src/system.c | 4 ---- - 2 files changed, 11 insertions(+), 9 deletions(-) - -diff --git a/src/sysmem.c b/src/sysmem.c -index 68a397b2f..995765828 100644 ---- a/src/sysmem.c -+++ b/src/sysmem.c -@@ -282,6 +282,12 @@ int SyTryToIncreasePool(void) - #define MAP_ANONYMOUS MAP_ANON - #endif - -+#ifdef SYS_IS_CYGWIN32 -+#define GAP_MMAP_FLAGS MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE -+#else -+#define GAP_MMAP_FLAGS MAP_PRIVATE|MAP_ANONYMOUS -+#endif -+ - static void *SyMMapStart = NULL; /* Start of mmap'ed region for POOL */ - static void *SyMMapEnd; /* End of mmap'ed region for POOL */ - static void *SyMMapAdvised; /* We have already advised about non-usage -@@ -342,15 +348,15 @@ void *SyAnonMMap(size_t size) { - size = SyRoundUpToPagesize(size); - #ifdef SYS_IS_64_BIT - /* The following is at 16 Terabyte: */ -- result = mmap((void *) (16L*1024*1024*1024*1024), size, -- PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); -+ result = mmap((void *) (16L*1024*1024*1024*1024), size, -+ PROT_READ|PROT_WRITE, GAP_MMAP_FLAGS, -1, 0); - if (result == MAP_FAILED) { - result = mmap(NULL, size, PROT_READ|PROT_WRITE, -- MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); -+ GAP_MMAP_FLAGS, -1, 0); - } - #else - result = mmap(NULL, size, PROT_READ|PROT_WRITE, -- MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); -+ GAP_MMAP_FLAGS, -1, 0); - #endif - if (result == MAP_FAILED) - result = NULL; -@@ -371,7 +377,7 @@ int SyTryToIncreasePool(void) - size = (Int) SyMMapEnd - (Int) SyMMapStart; - newchunk = SyRoundUpToPagesize(size/2); - result = mmap(SyMMapEnd, newchunk, PROT_READ|PROT_WRITE, -- MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); -+ GAP_MMAP_FLAGS, -1, 0); - if (result == MAP_FAILED) return -1; - if (result != SyMMapEnd) { - munmap(result,newchunk); -diff --git a/src/system.c b/src/system.c -index 7423d76bc..6f4c03517 100644 ---- a/src/system.c -+++ b/src/system.c -@@ -1133,11 +1133,7 @@ void InitSystem ( - #else - SyStorMin = 64 * 1024L; - SyStorMax = 1024*1024L; /* This is in kB! */ --#ifdef SYS_IS_CYGWIN32 -- SyAllocPool = 0; /* works better on cygwin */ --#else - SyAllocPool = 1536L*1024*1024; /* Note this is in bytes! */ --#endif - #endif - SyStorOverrun = 0; - SyStorKill = 0; --- -2.15.1 - diff --git a/build/pkgs/gap/patches/3435.patch b/build/pkgs/gap/patches/3435.patch deleted file mode 100644 index bfb976a722a..00000000000 --- a/build/pkgs/gap/patches/3435.patch +++ /dev/null @@ -1,246 +0,0 @@ -Patch for https://trac.sagemath.org/ticket/27724 -Can be removed when updating to GAP >= 4.11 -From abd23b1360bc569fca9bbb36e2fc167d55c7a872 Mon Sep 17 00:00:00 2001 -From: "Erik M. Bray" -Date: Thu, 2 May 2019 16:03:15 +0200 -Subject: [PATCH 1/5] Initial fix for #3434: Add ENSURE_BAG helper which - ensures memory is really committed by the OS for a new bag. - -Call ENSURE_BAG on new bags created in integer.c if they might be -passed as an argument to a GMP function. ---- - src/gasman.h | 12 ++++++++++++ - src/integer.c | 9 +++++++++ - 2 files changed, 21 insertions(+) - -diff --git a/src/gasman.h b/src/gasman.h -index 62d637baa9..e8c3d9eca1 100644 ---- a/src/gasman.h -+++ b/src/gasman.h -@@ -553,6 +553,18 @@ EXPORT_INLINE UInt ResizeWordSizedBag(Bag bag, UInt size) - } - - -+#if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT) -+EXPORT_INLINE void ENSURE_BAG(Bag bag) -+{ -+ memset(PTR_BAG(bag), 0, SIZE_BAG(bag)); -+} -+#else -+EXPORT_INLINE void ENSURE_BAG(Bag bag) -+{ -+} -+#endif -+ -+ - /**************************************************************************** - ** - *F CollectBags(,) . . . . . . . . . . . . . . collect dead bags -diff --git a/src/integer.c b/src/integer.c -index c15acdb415..ed740684ca 100644 ---- a/src/integer.c -+++ b/src/integer.c -@@ -274,6 +274,7 @@ static void NEW_FAKEMPZ( fake_mpz_t fake, UInt size ) - } - else { - fake->obj = NewBag( T_INTPOS, size * sizeof(mp_limb_t) ); -+ ENSURE_BAG(fake->obj); - } - } - -@@ -1789,9 +1790,11 @@ Obj ModInt(Obj opL, Obj opR) - } - - mod = NewBag( TNUM_OBJ(opL), (SIZE_INT(opL)+1)*sizeof(mp_limb_t) ); -+ ENSURE_BAG(mod); - - quo = NewBag( T_INTPOS, - (SIZE_INT(opL)-SIZE_INT(opR)+1)*sizeof(mp_limb_t) ); -+ ENSURE_BAG(quo); - - /* and let gmp do the work */ - mpn_tdiv_qr( (mp_ptr)ADDR_INT(quo), (mp_ptr)ADDR_INT(mod), 0, -@@ -1888,6 +1891,8 @@ Obj QuoInt(Obj opL, Obj opR) - quo = NewBag( T_INTPOS, SIZE_OBJ(opL) ); - else - quo = NewBag( T_INTNEG, SIZE_OBJ(opL) ); -+ -+ ENSURE_BAG(quo); - - if ( k < 0 ) k = -k; - -@@ -1906,6 +1911,7 @@ Obj QuoInt(Obj opL, Obj opR) - - /* create a new bag for the remainder */ - rem = NewBag( TNUM_OBJ(opL), (SIZE_INT(opL)+1)*sizeof(mp_limb_t) ); -+ ENSURE_BAG(rem); - - /* allocate a bag for the quotient */ - if ( TNUM_OBJ(opL) == TNUM_OBJ(opR) ) -@@ -1914,6 +1920,7 @@ Obj QuoInt(Obj opL, Obj opR) - else - quo = NewBag( T_INTNEG, - (SIZE_INT(opL)-SIZE_INT(opR)+1)*sizeof(mp_limb_t) ); -+ ENSURE_BAG(quo); - - mpn_tdiv_qr( (mp_ptr)ADDR_INT(quo), (mp_ptr)ADDR_INT(rem), 0, - (mp_srcptr)CONST_ADDR_INT(opL), SIZE_INT(opL), -@@ -2035,9 +2042,11 @@ Obj RemInt(Obj opL, Obj opR) - return opL; - - rem = NewBag( TNUM_OBJ(opL), (SIZE_INT(opL)+1)*sizeof(mp_limb_t) ); -+ ENSURE_BAG(rem); - - quo = NewBag( T_INTPOS, - (SIZE_INT(opL)-SIZE_INT(opR)+1)*sizeof(mp_limb_t) ); -+ ENSURE_BAG(quo); - - /* and let gmp do the work */ - mpn_tdiv_qr( (mp_ptr)ADDR_INT(quo), (mp_ptr)ADDR_INT(rem), 0, - -From 95324a2b978444ccd783b16cf50625b390107d97 Mon Sep 17 00:00:00 2001 -From: "Erik M. Bray" -Date: Fri, 3 May 2019 14:19:57 +0200 -Subject: [PATCH 2/5] Just limit the scope of ENSURE_BAG to integer.c for now - since it's the only known use case. - ---- - src/gasman.h | 12 ------------ - src/integer.c | 10 +++++++++- - 2 files changed, 9 insertions(+), 13 deletions(-) - -diff --git a/src/gasman.h b/src/gasman.h -index e8c3d9eca1..62d637baa9 100644 ---- a/src/gasman.h -+++ b/src/gasman.h -@@ -553,18 +553,6 @@ EXPORT_INLINE UInt ResizeWordSizedBag(Bag bag, UInt size) - } - - --#if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT) --EXPORT_INLINE void ENSURE_BAG(Bag bag) --{ -- memset(PTR_BAG(bag), 0, SIZE_BAG(bag)); --} --#else --EXPORT_INLINE void ENSURE_BAG(Bag bag) --{ --} --#endif -- -- - /**************************************************************************** - ** - *F CollectBags(,) . . . . . . . . . . . . . . collect dead bags -diff --git a/src/integer.c b/src/integer.c -index ed740684ca..8120bd44c9 100644 ---- a/src/integer.c -+++ b/src/integer.c -@@ -141,7 +141,15 @@ static Obj ObjInt_UIntInv( UInt i ); - - GAP_STATIC_ASSERT( sizeof(mp_limb_t) == sizeof(UInt), "gmp limb size incompatible with GAP word size"); - -- -+ -+static inline void ENSURE_BAG(Bag bag) -+{ -+#if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT) -+ memset(PTR_BAG(bag), 0, SIZE_BAG(bag)); -+#endif -+} -+ -+ - /* for fallbacks to library */ - static Obj String; - static Obj OneAttr; - -From f29a42c60e81732aabda0d0ab11fffdd26da059d Mon Sep 17 00:00:00 2001 -From: "Erik M. Bray" -Date: Fri, 3 May 2019 14:32:36 +0200 -Subject: [PATCH 3/5] Add inline documentation for ENSURE_BAG and when/how it - should be used. - ---- - src/integer.c | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/src/integer.c b/src/integer.c -index 8120bd44c9..4c5cf683d8 100644 ---- a/src/integer.c -+++ b/src/integer.c -@@ -142,6 +142,23 @@ static Obj ObjInt_UIntInv( UInt i ); - GAP_STATIC_ASSERT( sizeof(mp_limb_t) == sizeof(UInt), "gmp limb size incompatible with GAP word size"); - - -+/* This ensures that all memory underlying a bag is actually committed -+** to physical memory and can be written to. -+** This is a workaround to a bug specific to Cygwin 64-bit and bad -+** interaction with GMP, so this is only needed specifically for new -+** bags created in this module to hold the outputs of GMP routines. -+** -+** Thus, any time NewBag is called, it is also necessary to call -+** ENSURE_BAG(bag) on the newly created bag if some GMP function will be -+** the first place that bag's data is written to. -+** -+** To give a counter-example, ENSURE_BAG is *not* needed in ObjInt_Int, -+** because it just creates a bag to hold a single mp_limb_t, and -+** immediately assigns it a value. -+** -+** The bug this works around is explained more in -+** https://github.com/gap-system/gap/issues/3434 -+*/ - static inline void ENSURE_BAG(Bag bag) - { - #if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT) - -From 1a6eb168f005ddd1fe6d5591be310112aa4de393 Mon Sep 17 00:00:00 2001 -From: "Erik M. Bray" -Date: Fri, 3 May 2019 14:36:19 +0200 -Subject: [PATCH 4/5] Disable the workaround if gmp.h comes from MPIR, in which - case __MPIR_VERSION should be defined. - ---- - src/integer.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/integer.c b/src/integer.c -index 4c5cf683d8..b31c5f3d65 100644 ---- a/src/integer.c -+++ b/src/integer.c -@@ -161,7 +161,8 @@ GAP_STATIC_ASSERT( sizeof(mp_limb_t) == sizeof(UInt), "gmp limb size incompatibl - */ - static inline void ENSURE_BAG(Bag bag) - { --#if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT) -+// Note: This workaround is only required with the original GMP and not with MPIR -+#if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT) && !defined(__MPIR_VERSION) - memset(PTR_BAG(bag), 0, SIZE_BAG(bag)); - #endif - } - -From 95a011a793a326f14a0b63d5f53044d9f8d330bb Mon Sep 17 00:00:00 2001 -From: "Erik M. Bray" -Date: Fri, 3 May 2019 12:33:03 +0000 -Subject: [PATCH 5/5] clang-format tweaks - ---- - src/integer.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/integer.c b/src/integer.c -index b31c5f3d65..b34d6c382b 100644 ---- a/src/integer.c -+++ b/src/integer.c -@@ -161,8 +161,10 @@ GAP_STATIC_ASSERT( sizeof(mp_limb_t) == sizeof(UInt), "gmp limb size incompatibl - */ - static inline void ENSURE_BAG(Bag bag) - { --// Note: This workaround is only required with the original GMP and not with MPIR --#if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT) && !defined(__MPIR_VERSION) -+// Note: This workaround is only required with the original GMP and not with -+// MPIR -+#if defined(SYS_IS_CYGWIN32) && defined(SYS_IS_64_BIT) && \ -+ !defined(__MPIR_VERSION) - memset(PTR_BAG(bag), 0, SIZE_BAG(bag)); - #endif - } diff --git a/build/pkgs/gap/patches/make_install.patch b/build/pkgs/gap/patches/make_install.patch deleted file mode 100644 index 3679164eb0a..00000000000 --- a/build/pkgs/gap/patches/make_install.patch +++ /dev/null @@ -1,119 +0,0 @@ -See https://github.com/gap-system/gap/pull/3294 - -commit c3a9f302c3a8f3bbd682e7517821aa3deaa03f13 -Author: Max Horn -Date: Fri Feb 22 22:05:57 2019 +0100 - - buildsys: make some minor progress on 'make install' - - Specifically, re-enable install-libgap and install-headers, improve them, and - add more install-FOO subtargets. - - However, we deliberately keep printing an error in install target, and all - other subtargets print warnings. - - This way, packagers who dig can potentially benefit from these subtargets; but - if they complain about them, we can point at the warnings, the fact that the - targets are undocumented, and the TODO comments in them. - - Also, people who want to help with `make install` support get at least some - hints about the issues need to be resolved. - -diff --git a/Makefile.rules b/Makefile.rules -index 16a05eb..c3a2b05 100644 ---- a/Makefile.rules -+++ b/Makefile.rules -@@ -260,7 +260,6 @@ QUIET_CC = @echo " C $< => $@"; - QUIET_CXX = @echo " CXX $< => $@"; - QUIET_LINK = @echo " LINK $@"; - QUIET_SED = @echo " SED $< => $@"; --QUIET_INSTALL = @echo " INSTALL $< => $@"; - QUIET = @ - LIBTOOL += --silent - endif -@@ -477,26 +476,68 @@ clean: - - LTINSTALL=$(LIBTOOL) --mode=install $(INSTALL) - --install: install-libgap install-headers -+install: - @echo "Error, 'make install' has not yet been implemented" - exit 1 --# $(QUIET_INSTALL)$(INSTALL) -d -m 0755 $(DESTDIR)$(bindir) --# $(QUIET_INSTALL)$(INSTALL) gap $(DESTDIR)$(bindir) --# $(QUIET_INSTALL)$(INSTALL) gac $(DESTDIR)$(bindir) --# --# install-headers: --# $(QUIET_INSTALL)$(INSTALL) -d -m 0755 $(DESTDIR)$(includedir)/gap --# $(QUIET_INSTALL)$(INSTALL) -d -m 0755 $(DESTDIR)$(includedir)/gap/hpc --# $(QUIET_INSTALL)$(INSTALL) -m 0644 $(srcdir)/src/*.h $(DESTDIR)$(includedir)/gap --# $(QUIET_INSTALL)$(INSTALL) -m 0644 $(srcdir)/src/hpc/*.h $(DESTDIR)$(includedir)/gap/hpc --# # TODO: take care of config.h --# --# install-libgap: libgap.la --# $(QUIET_INSTALL)$(INSTALL) -d -m 0755 $(DESTDIR)$(libdir) --# $(QUIET_INSTALL)$(LTINSTALL) libgap.la $(DESTDIR)$(libdir) -- - --.PHONY: install install-libgap -+install-bin: -+ @echo "Warning, 'make install-bin' is incomplete" -+ $(INSTALL) -d -m 0755 $(DESTDIR)$(bindir) -+ $(INSTALL) -m 0755 gap $(DESTDIR)$(bindir)/gap.real -+ echo "!/bin/sh\nexec \"$(bindir)/gap.real\" -l \"$(datarootdir)/gap\" \"$@\"" > gap-wrapper.sh -+ $(INSTALL) -m 0755 gap-wrapper.sh $(DESTDIR)$(bindir)/gap -+ # TODO: make gac installable; this requires adjusting path in it, and -+ # installing the libtool script generated by configure somewhere; and then -+ # putting that path to it into gac) -+ #$(INSTALL) gac $(DESTDIR)$(bindir) -+ -+install-gaproot: -+ @echo "Warning, 'make install-gaproot' is incomplete" -+ $(INSTALL) -d -m 0755 $(DESTDIR)$(datarootdir)/gap -+ # TODO: update paths and FLAGS in sysinfo.gap -+ $(INSTALL) -m 0644 $(srcdir)/sysinfo.gap $(DESTDIR)$(datarootdir)/gap -+ # the following lines should not use `cp -r`, which is not quite portable, -+ # and which also may not deal with file permissions correctly -+ cp -r $(srcdir)/doc $(DESTDIR)$(datarootdir)/gap/ # FIXME: don't use `cp -r` -+ cp -r $(srcdir)/grp $(DESTDIR)$(datarootdir)/gap/ # FIXME: don't use `cp -r` -+ cp -r $(srcdir)/lib $(DESTDIR)$(datarootdir)/gap/ # FIXME: don't use `cp -r` -+ cp -r $(srcdir)/tst $(DESTDIR)$(datarootdir)/gap/ # FIXME: don't use `cp -r` -+ # TODO: what about CITATION, CONTRIBUTING.md, COPYRIGHT, INSTALL.md, -+ # LICENSE, README* ? Copy them also here? Or into some other path? -+ # TODO: also copy bin/BuildPackage.sh, as it is very useful? -+ -+install-pkg: -+ @echo "Warning, 'make install-pkg' is incomplete" -+ # TODO: should we try to compiled packages? perhaps better not, leave it -+ # to the packagers, as they also need to consider build dependencies ?! If -+ # we do try it, then we may need to deal with adjusting paths and so on... -+ # we can't really install packages by any other means that copying their -+ # whole directory... One strategy to overcome this: in the future, we -+ # demand that packages which must be built using `make` also support -+ # `make install prefix=DIR DESTDIR=dir` -+ # and/or allow packages to have a `Install(prefix, destdir)` field in -+ # their `PackageInfo.g` which contains a function that takes care of -+ # installation (e.g. by running `make install`, or by any other means). -+ # This could also be used by the PackageManager package (or perhaps we -+ # should just use PackageManager ourselves, and/or recommend it to -+ # packagers). -+ -+install-headers: -+ @echo "Warning, 'make install-headers' is incomplete" -+ $(INSTALL) -d -m 0755 $(DESTDIR)$(includedir)/gap -+ $(INSTALL) -m 0644 $(srcdir)/src/*.h $(DESTDIR)$(includedir)/gap -+ # TODO: run the following only if HPC-GAP is enabled? -+ $(INSTALL) -d -m 0755 $(DESTDIR)$(includedir)/gap/hpc -+ $(INSTALL) -m 0644 $(srcdir)/src/hpc/*.h $(DESTDIR)$(includedir)/gap/hpc -+ # TODO: take care of config.h, this is difficult -+ -+install-libgap: libgap.la -+ @echo "Warning, 'make install-libgap' is incomplete" -+ $(INSTALL) -d -m 0755 $(DESTDIR)$(libdir) -+ $(LTINSTALL) libgap.la $(DESTDIR)$(libdir) -+ -+ -+.PHONY: install install-bin install-gaproot install-headers install-libgap - - ######################################################################## - # Building subprojects diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in index 45f6fed445e..b40ab02be15 100644 --- a/build/pkgs/gap/spkg-install.in +++ b/build/pkgs/gap/spkg-install.in @@ -12,9 +12,6 @@ DESTDIR_GAP_ROOT="$SAGE_DESTDIR$GAP_ROOT" # Note that -g3 allows you to use preprocessor macros in gdb which are widely used if [ "$SAGE_DEBUG" = yes ] ; then export CFLAGS="-O0 -g3 -DDEBUG_MASTERPOINTERS -DDEBUG_GLOBAL_BAGS -DDEBUG_FUNCTIONS_BAGS $CFLAGS" -else - # Default flags - export CFLAGS="-O2 -g $CFLAGS" fi sdh_configure $SAGE_CONFIGURE_GMP @@ -66,6 +63,7 @@ sdh_install \ pkg/fga \ pkg/irredsol-* \ pkg/laguna-* \ + pkg/PackageManager-* \ pkg/polenta-* \ pkg/polycyclic-* \ pkg/resclasses-* \ diff --git a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch b/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch index 4c320d845a4..e45fe7d9c6f 100644 --- a/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch +++ b/build/pkgs/gap_packages/patches/cohomolo-gcc10.patch @@ -1,7 +1,7 @@ -diff --git a/pkg/cohomolo-1.6.7/standalone/progs.d/crp1.c b/pkg/cohomolo-1.6.7/standalone/progs.d/crp1.c +diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c index 3bbdc45..7df699f 100644 ---- a/pkg/cohomolo-1.6.7/standalone/progs.d/crp1.c -+++ b/pkg/cohomolo-1.6.7/standalone/progs.d/crp1.c +--- a/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c ++++ b/pkg/cohomolo-1.6.8/standalone/progs.d/crp1.c @@ -8,9 +8,8 @@ extern short sp[],**mat[],*psp[],**imcos[],**cpco[],lorb[], short *cst,**cpst,***cdpst,**svptr,*cp,*rel; short *spst,**pspst,**pptr,**cpptr,npt,nb,nph,nph2,npg,npg2, @@ -47,10 +47,10 @@ index 3bbdc45..7df699f 100644 op=fopen(outft,"w"); /* Now we have read everything in, and the computation can start */ orno=0; -diff --git a/pkg/cohomolo-1.6.7/standalone/progs.d/nq+chfns.c b/pkg/cohomolo-1.6.7/standalone/progs.d/nq+chfns.c +diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c index a7396b2..658496f 100644 ---- a/pkg/cohomolo-1.6.7/standalone/progs.d/nq+chfns.c -+++ b/pkg/cohomolo-1.6.7/standalone/progs.d/nq+chfns.c +--- a/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c ++++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nq+chfns.c @@ -20,8 +20,6 @@ short mexp=MEXP,mcl=MCL,no,rel[RSP],wt[MEXP],exp,*rpf,*rpb, extern short prime,dim,*spv,**spm,mspace[],*vec[],**mat[],cp[],pinv[],opmats, mm,mv; @@ -91,10 +91,10 @@ index a7396b2..658496f 100644 ip=fopen(inf3,"r"); if (ip==0) { fprintf(stderr,"Cannot open %s\n",inf3); return(-1); } fscanf(ip,"%hd%hd%hd%hd%hd%hd",&prime,&exp,&i,&no,&j,&m); -diff --git a/pkg/cohomolo-1.6.7/standalone/progs.d/nqmfns.c b/pkg/cohomolo-1.6.7/standalone/progs.d/nqmfns.c +diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c index 0896551..6841bc8 100644 ---- a/pkg/cohomolo-1.6.7/standalone/progs.d/nqmfns.c -+++ b/pkg/cohomolo-1.6.7/standalone/progs.d/nqmfns.c +--- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c ++++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmfns.c @@ -9,7 +9,6 @@ extern short intexp,mexp,mng,wksp, spugen[],*tlintg[]; extern int ptrsp,rsp; @@ -128,10 +128,10 @@ index 0896551..6841bc8 100644 fclose(op); printf("All new generators eliminated. Multiplier is trivial.\n"); } -diff --git a/pkg/cohomolo-1.6.7/standalone/progs.d/nqmp.c b/pkg/cohomolo-1.6.7/standalone/progs.d/nqmp.c +diff --git a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c index 01cf914..0144883 100644 ---- a/pkg/cohomolo-1.6.7/standalone/progs.d/nqmp.c -+++ b/pkg/cohomolo-1.6.7/standalone/progs.d/nqmp.c +--- a/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c ++++ b/pkg/cohomolo-1.6.8/standalone/progs.d/nqmp.c @@ -9,7 +9,6 @@ extern short intexp,mng,mexp,wksp, spugen[],*intg[],*imintg[],*tlintg[]; extern int ptrsp,rsp; diff --git a/build/pkgs/gap_packages/patches/cohomolo.patch b/build/pkgs/gap_packages/patches/cohomolo.patch deleted file mode 100644 index 34d86235e23..00000000000 --- a/build/pkgs/gap_packages/patches/cohomolo.patch +++ /dev/null @@ -1,47 +0,0 @@ -diff --git a/pkg/cohomolo-1.6.7/Makefile.in b/pkg/cohomolo-1.6.7/Makefile.in -index 96a6c75..ed054b6 100644 ---- a/pkg/cohomolo-1.6.7/Makefile.in -+++ b/pkg/cohomolo-1.6.7/Makefile.in -@@ -2,8 +2,7 @@ - # all executables are put into the bin directory. - BIN = bin/@GAPARCH@ - --CC=gcc --CFLAGS = -O -+CFLAGS += -O - - all: - mkdir -p bin/@GAPARCH@; -diff --git a/pkg/cohomolo-1.6.7/standalone/progs.d/findpres/makefile b/pkg/cohomolo-1.6.7/standalone/progs.d/findpres/makefile -index be60c44..0e6e662 100644 ---- a/pkg/cohomolo-1.6.7/standalone/progs.d/findpres/makefile -+++ b/pkg/cohomolo-1.6.7/standalone/progs.d/findpres/makefile -@@ -1,5 +1,4 @@ --CC = gcc --CFLAGS= -O2 -+CFLAGS += -O2 - all: makegp gprun conrun grrun - .c.o: - ${CC} -c $(CFLAGS) $*.c -diff --git a/pkg/cohomolo-1.6.7/standalone/progs.d/makefile b/pkg/cohomolo-1.6.7/standalone/progs.d/makefile -index 799bcdb..b22d7aa 100644 ---- a/pkg/cohomolo-1.6.7/standalone/progs.d/makefile -+++ b/pkg/cohomolo-1.6.7/standalone/progs.d/makefile -@@ -1,5 +1,4 @@ --CC = gcc --CFLAGS= -O -fno-builtin -+CFLAGS += -O -fno-builtin - BIN= ../exec.d - gap: ${BIN}/gprun ${BIN}/egrun ${BIN}/sylrun ${BIN}/normrun ${BIN}/conrun\ - ${BIN}/pcrun ${BIN}/scrun ${BIN}/selgen ${BIN}/matcalc ${BIN}/nqmrun\ -diff --git a/pkg/cohomolo-1.6.7/standalone/progs.d/makefile.gap b/pkg/cohomolo-1.6.7/standalone/progs.d/makefile.gap -index 7258a2c..b8950a6 100644 ---- a/pkg/cohomolo-1.6.7/standalone/progs.d/makefile.gap -+++ b/pkg/cohomolo-1.6.7/standalone/progs.d/makefile.gap -@@ -1,5 +1,4 @@ --CC = gcc --CFLAGS= -O2 -+CFLAGS += -O2 - EXEC= ../exec.d - all: ${EXEC}/makegp ${EXEC}/gprun ${EXEC}/egrun ${EXEC}/sylrun ${EXEC}/normrun\ - ${EXEC}/sylnorm ${EXEC}/conrun ${EXEC}/pcrun ${EXEC}/scrun\ diff --git a/build/pkgs/gap_packages/patches/guava.patch b/build/pkgs/gap_packages/patches/guava.patch deleted file mode 100644 index 6f1f7c436b9..00000000000 --- a/build/pkgs/gap_packages/patches/guava.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/Makefile.in b/Makefile.in -index 23d4648..0859ac3 100644 ---- a/pkg/guava-3.14/Makefile.in -+++ b/pkg/guava-3.14/Makefile.in -@@ -1,7 +1,6 @@ - GAPPATH=@GAPPATH@ - GAPARCH=@GAPARCH@ --CC = gcc --CFLAGS = -O2 -+CFLAGS += -O2 - SRCDIR = ./src/leon - CJSRCDIR= ./src/ctjhai - BINDIR = bin/$(GAPARCH) -diff --git a/src/leon/Makefile b/src/leon/Makefile -index 75d89e7..923cd5f 100644 ---- a/pkg/guava-3.14/src/leon/Makefile -+++ b/pkg/guava-3.14/src/leon/Makefile -@@ -1,4 +1,4 @@ --COMPILE = gcc -+COMPILE = $(CC) - CFLAGS += -O2 - SRCDIR = ./src - COMPOPT = $(CPPFLAGS) $(CFLAGS) -c -diff --git a/src/leon/Makefile.in b/src/leon/Makefile.in -index 75d89e7..923cd5f 100644 ---- a/pkg/guava-3.14/src/leon/Makefile.in -+++ b/pkg/guava-3.14/src/leon/Makefile.in -@@ -1,4 +1,4 @@ --COMPILE = gcc -+COMPILE = $(CC) - CFLAGS += -O2 - SRCDIR = ./src - COMPOPT = $(CPPFLAGS) $(CFLAGS) -c diff --git a/build/pkgs/gap_packages/patches/guava_leon_includes.patch b/build/pkgs/gap_packages/patches/guava_leon_includes.patch index b1119024dae..cdcd19cc3e8 100644 --- a/build/pkgs/gap_packages/patches/guava_leon_includes.patch +++ b/build/pkgs/gap_packages/patches/guava_leon_includes.patch @@ -1,5 +1,5 @@ ---- a/pkg/guava-3.14/src/leon/src/generate.c Sat Feb 29 09:02:10 2020 ---- b/pkg/guava-3.14/src/leon/src/generate.c Thu Sep 24 13:58:36 2020 +--- a/pkg/guava-3.15/src/leon/src/generate.c Sat Feb 29 09:02:10 2020 +--- b/pkg/guava-3.15/src/leon/src/generate.c Thu Sep 24 13:58:36 2020 *************** *** 115,120 **** --- 115,122 ---- diff --git a/build/pkgs/gap_packages/spkg-install.in b/build/pkgs/gap_packages/spkg-install.in index 56c444e11f1..42870146f02 100644 --- a/build/pkgs/gap_packages/spkg-install.in +++ b/build/pkgs/gap_packages/spkg-install.in @@ -13,22 +13,21 @@ cd "$PKG_SRC_DIR" sdh_install \ aclib-* \ AutoDoc-* \ - corelg \ + corelg-* \ crime-* \ cryst \ crystcat \ design-* \ gbnp \ genss-* \ - Hap* \ - HAPcryst \ + hap-* \ + hapcryst-* \ hecke-* \ liealgdb-* \ liepring-* \ liering-* \ loops-* \ MapClass-* \ - PackageManager-* \ polymaking-* \ qpa-* \ quagroup-* \ diff --git a/build/pkgs/gc/distros/opensuse.txt b/build/pkgs/gc/distros/opensuse.txt new file mode 100644 index 00000000000..4620f6a8cb4 --- /dev/null +++ b/build/pkgs/gc/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(bdw-gc)" diff --git a/build/pkgs/gc/spkg-check.in b/build/pkgs/gc/spkg-check.in index 6d620bd7417..917c8eb7209 100644 --- a/build/pkgs/gc/spkg-check.in +++ b/build/pkgs/gc/spkg-check.in @@ -1,9 +1,3 @@ cd src -if [ "$SAGE_DEBUG" = "yes" ]; then - export CFLAGS="-O0 -g $CFLAGS" -else - export CFLAGS="-O2 -g $CFLAGS" -fi - $MAKE check diff --git a/build/pkgs/gc/spkg-install.in b/build/pkgs/gc/spkg-install.in index 78d60cc8309..e5d254c86fe 100644 --- a/build/pkgs/gc/spkg-install.in +++ b/build/pkgs/gc/spkg-install.in @@ -1,12 +1,5 @@ cd src -if [ "$SAGE_DEBUG" = "yes" ]; then - echo "Building a debug version of BoehmGC." - export CFLAGS="-O0 -g $CFLAGS" -else - export CFLAGS="-O2 -g $CFLAGS" -fi - GC_CONFIGURE="--enable-large-config" if [ "$UNAME" = "CYGWIN" ]; then diff --git a/build/pkgs/gcc/distros/opensuse.txt b/build/pkgs/gcc/distros/opensuse.txt new file mode 100644 index 00000000000..8f6b65d3d1b --- /dev/null +++ b/build/pkgs/gcc/distros/opensuse.txt @@ -0,0 +1 @@ +gcc-c++ diff --git a/build/pkgs/gdb/distros/opensuse.txt b/build/pkgs/gdb/distros/opensuse.txt new file mode 100644 index 00000000000..59ccb367d89 --- /dev/null +++ b/build/pkgs/gdb/distros/opensuse.txt @@ -0,0 +1 @@ +gdb diff --git a/build/pkgs/gf2x/distros/opensuse.txt b/build/pkgs/gf2x/distros/opensuse.txt new file mode 100644 index 00000000000..9a15ad0abe3 --- /dev/null +++ b/build/pkgs/gf2x/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(gf2x)" diff --git a/build/pkgs/gf2x/spkg-install.in b/build/pkgs/gf2x/spkg-install.in index 17a0ad7b6cb..057be0a5953 100644 --- a/build/pkgs/gf2x/spkg-install.in +++ b/build/pkgs/gf2x/spkg-install.in @@ -9,12 +9,9 @@ cp "$SAGE_ROOT"/config/config.* config if [ "$SAGE_DEBUG" = "yes" ]; then echo "Building a debug version of gf2x." - export CFLAGS="-O0 -g $CFLAGS" elif $CC --version 2>/dev/null |grep 'gcc.* 5[.][12]' >/dev/null; then echo "Using compiler flags to work around problems with GCC 5.1/5.2 (Trac #18580,#18978)" - export CFLAGS="-O2 -fno-forward-propagate -g $CFLAGS" -else - export CFLAGS="-O2 -g $CFLAGS" + export CFLAGS="-fno-forward-propagate $CFLAGS" fi if [ "$SAGE_FAT_BINARY" = "yes" ]; then diff --git a/build/pkgs/gfan/distros/opensuse.txt b/build/pkgs/gfan/distros/opensuse.txt new file mode 100644 index 00000000000..30698c7bd41 --- /dev/null +++ b/build/pkgs/gfan/distros/opensuse.txt @@ -0,0 +1 @@ +gfan diff --git a/build/pkgs/gfortran/distros/opensuse.txt b/build/pkgs/gfortran/distros/opensuse.txt new file mode 100644 index 00000000000..8f962328b1e --- /dev/null +++ b/build/pkgs/gfortran/distros/opensuse.txt @@ -0,0 +1 @@ +gcc-fortran diff --git a/build/pkgs/gfortran/distros/void.txt b/build/pkgs/gfortran/distros/void.txt new file mode 100644 index 00000000000..8f962328b1e --- /dev/null +++ b/build/pkgs/gfortran/distros/void.txt @@ -0,0 +1 @@ +gcc-fortran diff --git a/build/pkgs/gfortran/spkg-configure.m4 b/build/pkgs/gfortran/spkg-configure.m4 index dde19d22bfb..e867f39ff48 100644 --- a/build/pkgs/gfortran/spkg-configure.m4 +++ b/build/pkgs/gfortran/spkg-configure.m4 @@ -31,6 +31,16 @@ AC_DEFUN([SAGE_MUST_INSTALL_GFORTRAN], [ fi ]) +dnl This macro saves current FCFLAGS for later use. +AC_DEFUN([SAGE_SAVE_FCFLAGS], [ + sage_saved_fcflags="$FCFLAGS" +]) + +dnl This macro restores saved FCFLAGS. +AC_DEFUN([SAGE_RESTORE_FCFLAGS], [ + FCFLAGS="$sage_saved_fcflags" +]) + SAGE_SPKG_CONFIGURE([gfortran], [ AC_REQUIRE([SAGE_SPKG_CONFIGURE_GCC]) @@ -40,12 +50,19 @@ SAGE_SPKG_CONFIGURE([gfortran], [ # This helps verify the compiler works too, so if some idiot sets FC to # /usr/bin/ls, we will at least know it's not a working Fortran # compiler. + AC_REQUIRE([SAGE_SAVE_FCFLAGS]) AC_FC_FREEFORM([SAGE_HAVE_FC_FREEFORM=yes], [ AC_MSG_NOTICE([Your Fortran compiler does not accept free-format source code]) AC_MSG_NOTICE([which means the compiler is either seriously broken, or]) AC_MSG_NOTICE([is too old to build Sage.]) SAGE_HAVE_FC_FREEFORM=no]) + # AC_FC_FREEFORM may have added flags. + # However, it is up to the individual package how they invoke the + # Fortran compiler. + # We only check here, whether the compiler is suitable. + AC_REQUIRE([SAGE_RESTORE_FCFLAGS]) + AS_VAR_IF(SAGE_HAVE_FC_FREEFORM, [no], [ AS_VAR_SET(sage_spkg_install_gfortran, [yes]) ]) diff --git a/build/pkgs/giac/distros/opensuse.txt b/build/pkgs/giac/distros/opensuse.txt index d3451656a62..e603965872c 100644 --- a/build/pkgs/giac/distros/opensuse.txt +++ b/build/pkgs/giac/distros/opensuse.txt @@ -1 +1 @@ -giac +giac-devel diff --git a/build/pkgs/git/distros/opensuse.txt b/build/pkgs/git/distros/opensuse.txt new file mode 100644 index 00000000000..5664e303b5d --- /dev/null +++ b/build/pkgs/git/distros/opensuse.txt @@ -0,0 +1 @@ +git diff --git a/build/pkgs/givaro/distros/opensuse.txt b/build/pkgs/givaro/distros/opensuse.txt new file mode 100644 index 00000000000..2a8103e6f6b --- /dev/null +++ b/build/pkgs/givaro/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(givaro)" diff --git a/build/pkgs/glpk/distros/opensuse.txt b/build/pkgs/glpk/distros/opensuse.txt new file mode 100644 index 00000000000..57e761c0bbc --- /dev/null +++ b/build/pkgs/glpk/distros/opensuse.txt @@ -0,0 +1,2 @@ +glpk +glpk-devel diff --git a/build/pkgs/gmp/distros/opensuse.txt b/build/pkgs/gmp/distros/opensuse.txt new file mode 100644 index 00000000000..39af19656ec --- /dev/null +++ b/build/pkgs/gmp/distros/opensuse.txt @@ -0,0 +1 @@ +gmp-devel diff --git a/build/pkgs/gmp/spkg-install.in b/build/pkgs/gmp/spkg-install.in index 61096b76cab..fa53576f8c6 100644 --- a/build/pkgs/gmp/spkg-install.in +++ b/build/pkgs/gmp/spkg-install.in @@ -27,16 +27,6 @@ if [ -z "$CFLAG64" ]; then fi -if [ "$SAGE_DEBUG" = yes ]; then - # Disable optimization, add debug symbols: - required_cflags="$required_cflags -g -O0" - echo >&2 "Warning: Building GMP with SAGE_DEBUG=yes disables optimization." -else - # Add debug symbols by default - required_cflags="$required_cflags -g" -fi - - case "$UNAME" in SunOS) true;; # Auto-detect ABI diff --git a/build/pkgs/gp2c/distros/opensuse.txt b/build/pkgs/gp2c/distros/opensuse.txt new file mode 100644 index 00000000000..f4ab6d425f1 --- /dev/null +++ b/build/pkgs/gp2c/distros/opensuse.txt @@ -0,0 +1 @@ +gp2c diff --git a/build/pkgs/gsl/distros/opensuse.txt b/build/pkgs/gsl/distros/opensuse.txt new file mode 100644 index 00000000000..ccfee4f4e43 --- /dev/null +++ b/build/pkgs/gsl/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(gsl)" diff --git a/build/pkgs/gsl/spkg-install.in b/build/pkgs/gsl/spkg-install.in index a6cc2072dda..179b78963a1 100644 --- a/build/pkgs/gsl/spkg-install.in +++ b/build/pkgs/gsl/spkg-install.in @@ -1,11 +1,3 @@ -if [ "$SAGE_DEBUG" = "yes" ] ; then - CFLAGS="-g -O0 $CFLAGS" # No optimisation, aids debugging. -else - CFLAGS="-g -O2 $CFLAGS" # Normal optimisation. -fi - -export CFLAGS - cd src sdh_configure LIBS="`pkg-config --libs-only-l cblas` -lm" diff --git a/build/pkgs/iml/distros/opensuse.txt b/build/pkgs/iml/distros/opensuse.txt index c1773871ebc..56644ed0c93 100644 --- a/build/pkgs/iml/distros/opensuse.txt +++ b/build/pkgs/iml/distros/opensuse.txt @@ -1 +1 @@ -iml +iml-devel diff --git a/build/pkgs/iml/spkg-check.in b/build/pkgs/iml/spkg-check.in index 6d620bd7417..917c8eb7209 100644 --- a/build/pkgs/iml/spkg-check.in +++ b/build/pkgs/iml/spkg-check.in @@ -1,9 +1,3 @@ cd src -if [ "$SAGE_DEBUG" = "yes" ]; then - export CFLAGS="-O0 -g $CFLAGS" -else - export CFLAGS="-O2 -g $CFLAGS" -fi - $MAKE check diff --git a/build/pkgs/iml/spkg-install.in b/build/pkgs/iml/spkg-install.in index 8764fd17cf8..bb00b407a29 100644 --- a/build/pkgs/iml/spkg-install.in +++ b/build/pkgs/iml/spkg-install.in @@ -1,11 +1,6 @@ cd src -if [ "$SAGE_DEBUG" = "yes" ]; then - echo "Building a debug version of IML." - export CFLAGS="-O0 -g $CFLAGS" -else - export CFLAGS="-O3 -g $CFLAGS" -fi +export CFLAGS=$CFLAGS_O3 # When using GMP from a standard system location it shouldn't really # matter what we put here, but iml's configure script requires we diff --git a/build/pkgs/ipython/distros/opensuse.txt b/build/pkgs/ipython/distros/opensuse.txt new file mode 100644 index 00000000000..c32c6b449cf --- /dev/null +++ b/build/pkgs/ipython/distros/opensuse.txt @@ -0,0 +1 @@ +python3-ipython diff --git a/build/pkgs/isl/distros/opensuse.txt b/build/pkgs/isl/distros/opensuse.txt new file mode 100644 index 00000000000..721c2bb0dcb --- /dev/null +++ b/build/pkgs/isl/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(isl)" diff --git a/build/pkgs/jinja2/distros/opensuse.txt b/build/pkgs/jinja2/distros/opensuse.txt new file mode 100644 index 00000000000..5d90a223f55 --- /dev/null +++ b/build/pkgs/jinja2/distros/opensuse.txt @@ -0,0 +1 @@ +python3-Jinja2 diff --git a/build/pkgs/jmol/SPKG.rst b/build/pkgs/jmol/SPKG.rst index 8c021b6fe8e..9ff8f2fab1b 100644 --- a/build/pkgs/jmol/SPKG.rst +++ b/build/pkgs/jmol/SPKG.rst @@ -5,10 +5,10 @@ Jmol for Sage Description ----------- -This provides files necessary for Jmol(java) and JSmol (javascript) to -operate from the command line and the Notebook. It does not contain the -Notebook javascript library jmol_lib.js or changes to Notebook or Sage -code. +This provides files necessary for Jmol (java). + +This package does not install JSmol (javascript), which upstream bundles with Jmol. + License ------- diff --git a/build/pkgs/jmol/distros/opensuse.txt b/build/pkgs/jmol/distros/opensuse.txt new file mode 100644 index 00000000000..f07a1f4e035 --- /dev/null +++ b/build/pkgs/jmol/distros/opensuse.txt @@ -0,0 +1 @@ +jmol diff --git a/build/pkgs/jmol/spkg-install.in b/build/pkgs/jmol/spkg-install.in index a181ebb9536..7a97cc19a26 100644 --- a/build/pkgs/jmol/spkg-install.in +++ b/build/pkgs/jmol/spkg-install.in @@ -1,5 +1,4 @@ -# jsmol goes in a dedicated directory -sdh_install src/jsmol "${SAGE_SHARE}/" +# jsmol is installed using the separate package jupyter-jsmol rm -rf src/jsmol sdh_install -T src "${SAGE_SHARE}/jmol" diff --git a/build/pkgs/jsonschema/distros/opensuse.txt b/build/pkgs/jsonschema/distros/opensuse.txt new file mode 100644 index 00000000000..047e6cc5d1d --- /dev/null +++ b/build/pkgs/jsonschema/distros/opensuse.txt @@ -0,0 +1 @@ +python3-jsonschema diff --git a/build/pkgs/jupyter_client/distros/opensuse.txt b/build/pkgs/jupyter_client/distros/opensuse.txt new file mode 100644 index 00000000000..0159b2d7b90 --- /dev/null +++ b/build/pkgs/jupyter_client/distros/opensuse.txt @@ -0,0 +1 @@ +python3-jupyter-client diff --git a/build/pkgs/jupyter_core/distros/opensuse.txt b/build/pkgs/jupyter_core/distros/opensuse.txt new file mode 100644 index 00000000000..2f316f2ee07 --- /dev/null +++ b/build/pkgs/jupyter_core/distros/opensuse.txt @@ -0,0 +1 @@ +python3-jupyter-core diff --git a/build/pkgs/jupyter_jsmol/checksums.ini b/build/pkgs/jupyter_jsmol/checksums.ini new file mode 100644 index 00000000000..043ee67ce94 --- /dev/null +++ b/build/pkgs/jupyter_jsmol/checksums.ini @@ -0,0 +1,5 @@ +tarball=jupyter_jsmol-VERSION.tar.gz +sha1=5e21072395929a247a520b9e0b6d5fe56d70f5d5 +md5=0549b54006cbf405b26a5fb71b2e6f40 +cksum=285195380 +upstream_url=https://pypi.io/packages/source/j/jupyter-jsmol/jupyter_jsmol-VERSION.tar.gz diff --git a/build/pkgs/jupyter_jsmol/dependencies b/build/pkgs/jupyter_jsmol/dependencies new file mode 100644 index 00000000000..f582a4a3283 --- /dev/null +++ b/build/pkgs/jupyter_jsmol/dependencies @@ -0,0 +1 @@ +ipywidgets diff --git a/build/pkgs/jupyter_jsmol/install-requires.txt b/build/pkgs/jupyter_jsmol/install-requires.txt new file mode 100644 index 00000000000..9465bfb8e0c --- /dev/null +++ b/build/pkgs/jupyter_jsmol/install-requires.txt @@ -0,0 +1 @@ +jupyter-jsmol diff --git a/build/pkgs/jupyter_jsmol/package-version.txt b/build/pkgs/jupyter_jsmol/package-version.txt new file mode 100644 index 00000000000..abd410582de --- /dev/null +++ b/build/pkgs/jupyter_jsmol/package-version.txt @@ -0,0 +1 @@ +0.2.4 diff --git a/build/pkgs/jupyter_jsmol/spkg-install.in b/build/pkgs/jupyter_jsmol/spkg-install.in new file mode 100644 index 00000000000..231fd92a04b --- /dev/null +++ b/build/pkgs/jupyter_jsmol/spkg-install.in @@ -0,0 +1,3 @@ +cd src +sdh_setup_bdist_wheel build --skip-npm +sdh_store_and_pip_install_wheel . diff --git a/build/pkgs/zope_interface/type b/build/pkgs/jupyter_jsmol/type similarity index 100% rename from build/pkgs/zope_interface/type rename to build/pkgs/jupyter_jsmol/type diff --git a/build/pkgs/latte_int/distros/opensuse.txt b/build/pkgs/latte_int/distros/opensuse.txt new file mode 100644 index 00000000000..5c76e70ff28 --- /dev/null +++ b/build/pkgs/latte_int/distros/opensuse.txt @@ -0,0 +1 @@ +latte diff --git a/build/pkgs/latte_int/spkg-check.in b/build/pkgs/latte_int/spkg-check.in index 7bdcf72a10c..27cd9419538 100644 --- a/build/pkgs/latte_int/spkg-check.in +++ b/build/pkgs/latte_int/spkg-check.in @@ -1,10 +1,2 @@ -if [ "x$SAGE_DEBUG" = xyes ] ; then - CFLAGS="$CFLAGS -g -O0" # No optimisation, aids debugging. -else - CFLAGS="$CFLAGS -g -O2" # Normal optimisation. -fi - -export CFLAGS - cd src $MAKE check diff --git a/build/pkgs/lcalc/package-version.txt b/build/pkgs/lcalc/package-version.txt index e4d1ee2ab3c..fcbaf9fd8eb 100644 --- a/build/pkgs/lcalc/package-version.txt +++ b/build/pkgs/lcalc/package-version.txt @@ -1 +1 @@ -1.23.p19 +1.23.p20 diff --git a/build/pkgs/lcalc/patches/Lvalue.h.patch b/build/pkgs/lcalc/patches/Lvalue.h.patch new file mode 100644 index 00000000000..245eedaa2c3 --- /dev/null +++ b/build/pkgs/lcalc/patches/Lvalue.h.patch @@ -0,0 +1,11 @@ +--- a/include/Lvalue.h ++++ b/include/Lvalue.h +@@ -486,6 +486,8 @@ + delete [] DELTA; + return L_value*exp(z-.5*log(OMEGA)); + } ++ ++ return L_value*exp(-log(Q)*s)/z; /* as in a later version */ + } + + diff --git a/build/pkgs/lcalc/spkg-build.in b/build/pkgs/lcalc/spkg-build.in index b477bd0d153..a5c67c2cafa 100644 --- a/build/pkgs/lcalc/spkg-build.in +++ b/build/pkgs/lcalc/spkg-build.in @@ -1,23 +1,8 @@ -# If SAGE_DEBUG is set to 'yes', add debugging information. Since both -# the Sun and GNU compilers accept -g to give debugging information, -# there is no need to do anything specific to one compiler or the other. -if [ "x$SAGE_DEBUG" = xyes ]; then - echo "Code will be built with debugging information present. Unset 'SAGE_DEBUG'" - echo "or set it to 'no' if you don't want that." - - CFLAGS="$CFLAGS -O0 -g" - CXXFLAGS="$CXXFLAGS -O0 -g" -else - echo "No debugging information will be used during the build of this package." - echo "Set 'SAGE_DEBUG' to 'yes' if you want debugging information present (-g added)." -fi - # Using pari in a C++17 file with "using namespace std doesn't # work due to a conflict between std::rank and pari's rank CXXFLAGS=$(echo "${CXXFLAGS}" | sed "s/-std=c++17//g") # Export everything. Probably not necessary in most cases. -export CFLAGS export CXXFLAGS export DEFINES="" diff --git a/build/pkgs/libatomic_ops/distros/opensuse.txt b/build/pkgs/libatomic_ops/distros/opensuse.txt new file mode 100644 index 00000000000..6e7e1c4cecb --- /dev/null +++ b/build/pkgs/libatomic_ops/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(atomic_ops)" diff --git a/build/pkgs/libatomic_ops/spkg-check.in b/build/pkgs/libatomic_ops/spkg-check.in index 1e19e3eb37f..75794c7ee97 100644 --- a/build/pkgs/libatomic_ops/spkg-check.in +++ b/build/pkgs/libatomic_ops/spkg-check.in @@ -1,11 +1,5 @@ cd src -if [ "$SAGE_DEBUG" = "yes" ]; then - export CFLAGS="-O0 -g $CFLAGS" -else - export CFLAGS="-O2 -g $CFLAGS" -fi - if [ "$SAGE64" = "yes" ]; then export CFLAGS="-m64 $CFLAGS" fi diff --git a/build/pkgs/libatomic_ops/spkg-install.in b/build/pkgs/libatomic_ops/spkg-install.in index 4347ff3cd5a..8bcf5eec8d7 100644 --- a/build/pkgs/libatomic_ops/spkg-install.in +++ b/build/pkgs/libatomic_ops/spkg-install.in @@ -1,12 +1,5 @@ cd src -if [ "$SAGE_DEBUG" = "yes" ]; then - echo "Building a debug version of libatomic_ops." - export CFLAGS="-O0 -g $CFLAGS" -else - export CFLAGS="-O2 -g $CFLAGS" -fi - if [ "$SAGE64" = "yes" ]; then echo "Building a 64-bit version of libatomic_ops." export CFLAGS="-m64 $CFLAGS" diff --git a/build/pkgs/libbraiding/distros/opensuse.txt b/build/pkgs/libbraiding/distros/opensuse.txt new file mode 100644 index 00000000000..b7873e1b3c6 --- /dev/null +++ b/build/pkgs/libbraiding/distros/opensuse.txt @@ -0,0 +1 @@ +libbraiding-devel diff --git a/build/pkgs/libffi/distros/opensuse.txt b/build/pkgs/libffi/distros/opensuse.txt new file mode 100644 index 00000000000..1a6986d429e --- /dev/null +++ b/build/pkgs/libffi/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(libffi)" diff --git a/build/pkgs/libffi/distros/void.txt b/build/pkgs/libffi/distros/void.txt new file mode 100644 index 00000000000..31d794ff28d --- /dev/null +++ b/build/pkgs/libffi/distros/void.txt @@ -0,0 +1 @@ +libffi-devel diff --git a/build/pkgs/libgd/distros/opensuse.txt b/build/pkgs/libgd/distros/opensuse.txt index 3f310cfdeb0..48195aa6b44 100644 --- a/build/pkgs/libgd/distros/opensuse.txt +++ b/build/pkgs/libgd/distros/opensuse.txt @@ -1 +1,2 @@ gd +"pkgconfig(gdlib)" diff --git a/build/pkgs/libhomfly/distros/opensuse.txt b/build/pkgs/libhomfly/distros/opensuse.txt new file mode 100644 index 00000000000..48f7e49dc2a --- /dev/null +++ b/build/pkgs/libhomfly/distros/opensuse.txt @@ -0,0 +1 @@ +libhomfly-devel diff --git a/build/pkgs/libogg/distros/opensuse.txt b/build/pkgs/libogg/distros/opensuse.txt new file mode 100644 index 00000000000..886b7534f7b --- /dev/null +++ b/build/pkgs/libogg/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(ogg)" diff --git a/build/pkgs/libpng/distros/opensuse.txt b/build/pkgs/libpng/distros/opensuse.txt new file mode 100644 index 00000000000..3283fd2e697 --- /dev/null +++ b/build/pkgs/libpng/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(libpng16)" diff --git a/build/pkgs/libpng/distros/void.txt b/build/pkgs/libpng/distros/void.txt new file mode 100644 index 00000000000..90d810bb74f --- /dev/null +++ b/build/pkgs/libpng/distros/void.txt @@ -0,0 +1 @@ +libpng-devel diff --git a/build/pkgs/libsemigroups/checksums.ini b/build/pkgs/libsemigroups/checksums.ini index ba335c74d1f..a64622471b6 100644 --- a/build/pkgs/libsemigroups/checksums.ini +++ b/build/pkgs/libsemigroups/checksums.ini @@ -1,4 +1,5 @@ tarball=libsemigroups-VERSION.tar.gz -sha1=d1be401d098fc36b096f8b5a89a556892a471385 -md5=788856c7cf162474580e48094ff5de29 -cksum=2423299159 +sha1=084ca07ea1101f668274a26ac61d13eab0508f71 +md5=60069d1f82d2285867fd829624f9e60d +cksum=2338845637 +upstream_url=https://github.com/libsemigroups/libsemigroups/releases/download/v1.0.9/libsemigroups-1.0.9.tar.gz diff --git a/build/pkgs/libsemigroups/distros/opensuse.txt b/build/pkgs/libsemigroups/distros/opensuse.txt new file mode 100644 index 00000000000..aca27d4e0e3 --- /dev/null +++ b/build/pkgs/libsemigroups/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(libsemigroups)" diff --git a/build/pkgs/libsemigroups/package-version.txt b/build/pkgs/libsemigroups/package-version.txt index 2228cad41f3..66c4c2263e5 100644 --- a/build/pkgs/libsemigroups/package-version.txt +++ b/build/pkgs/libsemigroups/package-version.txt @@ -1 +1 @@ -0.6.7 +1.0.9 diff --git a/build/pkgs/libtheora/distros/opensuse.txt b/build/pkgs/libtheora/distros/opensuse.txt new file mode 100644 index 00000000000..19826d2aea6 --- /dev/null +++ b/build/pkgs/libtheora/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(theora)" diff --git a/build/pkgs/linbox/distros/opensuse.txt b/build/pkgs/linbox/distros/opensuse.txt new file mode 100644 index 00000000000..1a52a7c51d3 --- /dev/null +++ b/build/pkgs/linbox/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(linbox)" diff --git a/build/pkgs/lrslib/distros/opensuse.txt b/build/pkgs/lrslib/distros/opensuse.txt new file mode 100644 index 00000000000..1b3df082e57 --- /dev/null +++ b/build/pkgs/lrslib/distros/opensuse.txt @@ -0,0 +1,2 @@ +lrslib +lrslib-devel diff --git a/build/pkgs/m4ri/distros/opensuse.txt b/build/pkgs/m4ri/distros/opensuse.txt index b6b04790806..c2a7c2c8f93 100644 --- a/build/pkgs/m4ri/distros/opensuse.txt +++ b/build/pkgs/m4ri/distros/opensuse.txt @@ -1 +1 @@ -libm4ri +"pkgconfig(m4ri)" diff --git a/build/pkgs/m4ri/spkg-install.in b/build/pkgs/m4ri/spkg-install.in index 0ed379b4511..c3ae2270406 100644 --- a/build/pkgs/m4ri/spkg-install.in +++ b/build/pkgs/m4ri/spkg-install.in @@ -11,10 +11,8 @@ elif [ "$COMPILER" = "HP_on_HP-UX" ] ; then fi if [ "x$SAGE_DEBUG" = "xyes" ]; then - CFLAGS="$CFLAGS -O0" ENABLE_DEBUG="--enable-debug" else - CFLAGS="$CFLAGS -O2" ENABLE_DEBUG="" fi diff --git a/build/pkgs/m4rie/distros/opensuse.txt b/build/pkgs/m4rie/distros/opensuse.txt new file mode 100644 index 00000000000..4b8fbfa44df --- /dev/null +++ b/build/pkgs/m4rie/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(m4rie)" diff --git a/build/pkgs/m4rie/spkg-install.in b/build/pkgs/m4rie/spkg-install.in index 9a0449aaf46..925706f0581 100644 --- a/build/pkgs/m4rie/spkg-install.in +++ b/build/pkgs/m4rie/spkg-install.in @@ -18,10 +18,8 @@ fi CPPFLAGS="$INCLUDES" if [ "x$SAGE_DEBUG" = "xyes" ]; then - CFLAGS="-O0 $CFLAGS" ENABLE_DEBUG="--enable-debug" else - CFLAGS="-O2 $CFLAGS" ENABLE_DEBUG="" fi diff --git a/build/pkgs/markupsafe/distros/opensuse.txt b/build/pkgs/markupsafe/distros/opensuse.txt new file mode 100644 index 00000000000..483c7ee1e18 --- /dev/null +++ b/build/pkgs/markupsafe/distros/opensuse.txt @@ -0,0 +1 @@ +python3-MarkupSafe diff --git a/build/pkgs/mathjax/distros/opensuse.txt b/build/pkgs/mathjax/distros/opensuse.txt new file mode 100644 index 00000000000..37aaaac759c --- /dev/null +++ b/build/pkgs/mathjax/distros/opensuse.txt @@ -0,0 +1 @@ +mathjax diff --git a/build/pkgs/matplotlib/distros/opensuse.txt b/build/pkgs/matplotlib/distros/opensuse.txt new file mode 100644 index 00000000000..13743297213 --- /dev/null +++ b/build/pkgs/matplotlib/distros/opensuse.txt @@ -0,0 +1 @@ +python3-matplotlib diff --git a/build/pkgs/maxima/distros/opensuse.txt b/build/pkgs/maxima/distros/opensuse.txt new file mode 100644 index 00000000000..6a46ff89d05 --- /dev/null +++ b/build/pkgs/maxima/distros/opensuse.txt @@ -0,0 +1 @@ +maxima-exec-clisp diff --git a/build/pkgs/mcqd/distros/opensuse.txt b/build/pkgs/mcqd/distros/opensuse.txt new file mode 100644 index 00000000000..36c7102c81a --- /dev/null +++ b/build/pkgs/mcqd/distros/opensuse.txt @@ -0,0 +1 @@ +mcqd diff --git a/build/pkgs/mpc/distros/opensuse.txt b/build/pkgs/mpc/distros/opensuse.txt new file mode 100644 index 00000000000..9aa877bc336 --- /dev/null +++ b/build/pkgs/mpc/distros/opensuse.txt @@ -0,0 +1 @@ +mpc-devel diff --git a/build/pkgs/mpfi/distros/opensuse.txt b/build/pkgs/mpfi/distros/opensuse.txt new file mode 100644 index 00000000000..b3c032626fa --- /dev/null +++ b/build/pkgs/mpfi/distros/opensuse.txt @@ -0,0 +1 @@ +mpfi-devel diff --git a/build/pkgs/mpfr/distros/opensuse.txt b/build/pkgs/mpfr/distros/opensuse.txt new file mode 100644 index 00000000000..564517323f0 --- /dev/null +++ b/build/pkgs/mpfr/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(mpfr)" diff --git a/build/pkgs/mpfr/spkg-install.in b/build/pkgs/mpfr/spkg-install.in index ea918577af4..5e062603669 100644 --- a/build/pkgs/mpfr/spkg-install.in +++ b/build/pkgs/mpfr/spkg-install.in @@ -30,18 +30,18 @@ mpfr_configure() # Set up environment variables: ########################################################################### - user_cflags=$CFLAGS # Save them. 'sage-env' sets CC, but not CFLAGS. + user_cflags=$ORIGINAL_CFLAGS # Save them. 'sage-env' sets CC, but not CFLAGS. required_cflags="" # Additional mandatory settings required by Sage, accumulated below. default_cflags="" # Spkg defaults that can and might get overridden. if [ "$SAGE_DEBUG" = yes ]; then # Disable optimization, add debug symbols: - required_cflags="$required_cflags -g -O0" + required_cflags=$CFLAGS echo >&2 "Warning: Building MPFR with SAGE_DEBUG=yes disables optimization." else # Add debug symbols by default, enable optimization, but do not (yet) # add processor-specific flags (these are eventually added later): - default_cflags="$default_cflags -g -O3" + default_cflags=$CFLAGS_O3 fi # Enabling thread-safe (which meanwhile is or at least may be the default) diff --git a/build/pkgs/mpfrcx/distros/opensuse.txt b/build/pkgs/mpfrcx/distros/opensuse.txt new file mode 100644 index 00000000000..2895bd36da8 --- /dev/null +++ b/build/pkgs/mpfrcx/distros/opensuse.txt @@ -0,0 +1 @@ +mpfrcx-devel diff --git a/build/pkgs/mpir/distros/opensuse.txt b/build/pkgs/mpir/distros/opensuse.txt new file mode 100644 index 00000000000..16b5b660968 --- /dev/null +++ b/build/pkgs/mpir/distros/opensuse.txt @@ -0,0 +1 @@ +libmpir-devel diff --git a/build/pkgs/mpir/spkg-install.in b/build/pkgs/mpir/spkg-install.in index 86b84036358..01070d1dc3e 100644 --- a/build/pkgs/mpir/spkg-install.in +++ b/build/pkgs/mpir/spkg-install.in @@ -49,16 +49,6 @@ if [ -z "$CFLAG64" ]; then fi -if [ "$SAGE_DEBUG" = yes ]; then - # Disable optimization, add debug symbols: - required_cflags="$required_cflags -g -O0" - echo >&2 "Warning: Building MPIR with SAGE_DEBUG=yes disables optimization." -else - # Add debug symbols by default - required_cflags="$required_cflags -g" -fi - - case "$UNAME" in SunOS) true;; # Auto-detect ABI diff --git a/build/pkgs/nauty/distros/opensuse.txt b/build/pkgs/nauty/distros/opensuse.txt new file mode 100644 index 00000000000..8d70dabacdd --- /dev/null +++ b/build/pkgs/nauty/distros/opensuse.txt @@ -0,0 +1,2 @@ +nauty +nauty-devel diff --git a/build/pkgs/nbconvert/distros/opensuse.txt b/build/pkgs/nbconvert/distros/opensuse.txt new file mode 100644 index 00000000000..d7a7eb5cba3 --- /dev/null +++ b/build/pkgs/nbconvert/distros/opensuse.txt @@ -0,0 +1 @@ +jupyter-nbconvert diff --git a/build/pkgs/nbformat/distros/opensuse.txt b/build/pkgs/nbformat/distros/opensuse.txt new file mode 100644 index 00000000000..a4e1f59c652 --- /dev/null +++ b/build/pkgs/nbformat/distros/opensuse.txt @@ -0,0 +1 @@ +jupyter-nbformat diff --git a/build/pkgs/ncurses/distros/opensuse.txt b/build/pkgs/ncurses/distros/opensuse.txt new file mode 100644 index 00000000000..b31c6886b17 --- /dev/null +++ b/build/pkgs/ncurses/distros/opensuse.txt @@ -0,0 +1,2 @@ +"pkgconfig(ncurses)" +"pkgconfig(ncursesw)" diff --git a/build/pkgs/ncurses/spkg-install.in b/build/pkgs/ncurses/spkg-install.in index 4d4cfc18a6f..1f47e2f5493 100644 --- a/build/pkgs/ncurses/spkg-install.in +++ b/build/pkgs/ncurses/spkg-install.in @@ -1,23 +1,10 @@ DEBUG_CONFIGURE_FLAG='' if [ "$SAGE_DEBUG" = yes ]; then - CFLAGS="-O0 -g $CFLAGS" DEBUG_CONFIGURE_FLAG='--with-debug' else DEBUG_CONFIGURE_FLAG='--without-debug' fi - -echo "The following environment variables will be exported:" -echo "Using CC=$CC" -echo "Using CFLAGS=$CFLAGS" -echo "Using CPPFLAGS=$CPPFLAGS" -echo "Using LDFLAGS=$LDFLAGS" -echo - -export CFLAGS -export CPPFLAGS -export LDFLAGS - cd src # Ncurses cannot build narrow and wide (unicode, --enable-widec) diff --git a/build/pkgs/networkx/distros/opensuse.txt b/build/pkgs/networkx/distros/opensuse.txt new file mode 100644 index 00000000000..67790667af2 --- /dev/null +++ b/build/pkgs/networkx/distros/opensuse.txt @@ -0,0 +1 @@ +python3-networkx diff --git a/build/pkgs/nibabel/distros/opensuse.txt b/build/pkgs/nibabel/distros/opensuse.txt new file mode 100644 index 00000000000..19df029d93f --- /dev/null +++ b/build/pkgs/nibabel/distros/opensuse.txt @@ -0,0 +1 @@ +python3-nibabel diff --git a/build/pkgs/ninja_build/distros/opensuse.txt b/build/pkgs/ninja_build/distros/opensuse.txt new file mode 100644 index 00000000000..63730036fd3 --- /dev/null +++ b/build/pkgs/ninja_build/distros/opensuse.txt @@ -0,0 +1 @@ +ninja diff --git a/build/pkgs/ninja_build/distros/void.txt b/build/pkgs/ninja_build/distros/void.txt new file mode 100644 index 00000000000..63730036fd3 --- /dev/null +++ b/build/pkgs/ninja_build/distros/void.txt @@ -0,0 +1 @@ +ninja diff --git a/build/pkgs/nodejs/distros/opensuse.txt b/build/pkgs/nodejs/distros/opensuse.txt new file mode 100644 index 00000000000..e36de65c4cc --- /dev/null +++ b/build/pkgs/nodejs/distros/opensuse.txt @@ -0,0 +1 @@ +nodejs diff --git a/build/pkgs/normaliz/distros/opensuse.txt b/build/pkgs/normaliz/distros/opensuse.txt new file mode 100644 index 00000000000..8d70f950038 --- /dev/null +++ b/build/pkgs/normaliz/distros/opensuse.txt @@ -0,0 +1 @@ +normaliz-devel diff --git a/build/pkgs/ntl/distros/opensuse.txt b/build/pkgs/ntl/distros/opensuse.txt new file mode 100644 index 00000000000..978728a7592 --- /dev/null +++ b/build/pkgs/ntl/distros/opensuse.txt @@ -0,0 +1 @@ +ntl-devel diff --git a/build/pkgs/numpy/spkg-install.in b/build/pkgs/numpy/spkg-install.in index c0a312d1bfe..c6e694079a5 100644 --- a/build/pkgs/numpy/spkg-install.in +++ b/build/pkgs/numpy/spkg-install.in @@ -26,9 +26,6 @@ export NUMPY_FCONFIG="config_fc --noopt --noarch" ################################################ -sage-python23 setup.py \ - --no-user-cfg \ - bdist_wheel \ - ${NUMPY_FCONFIG} || sdh_die "Error building wheel for numpy" +sdh_setup_bdist_wheel ${NUMPY_FCONFIG} sdh_store_and_pip_install_wheel . diff --git a/build/pkgs/openblas/distros/opensuse.txt b/build/pkgs/openblas/distros/opensuse.txt new file mode 100644 index 00000000000..52e4a9f78f4 --- /dev/null +++ b/build/pkgs/openblas/distros/opensuse.txt @@ -0,0 +1 @@ +openblas-devel diff --git a/build/pkgs/openssl/distros/opensuse.txt b/build/pkgs/openssl/distros/opensuse.txt index fa963ae15cb..196ba2d1153 100644 --- a/build/pkgs/openssl/distros/opensuse.txt +++ b/build/pkgs/openssl/distros/opensuse.txt @@ -1 +1 @@ -openssl +"pkgconfig(libssl)" diff --git a/build/pkgs/opensuse-bootstrap.txt b/build/pkgs/opensuse-bootstrap.txt new file mode 100644 index 00000000000..819e4433b53 --- /dev/null +++ b/build/pkgs/opensuse-bootstrap.txt @@ -0,0 +1,6 @@ +# Packages needed for ./bootstrap +gettext-tools +autoconf +automake +libtool +pkgconfig diff --git a/build/pkgs/opensuse.txt b/build/pkgs/opensuse.txt new file mode 100644 index 00000000000..fe5391d0314 --- /dev/null +++ b/build/pkgs/opensuse.txt @@ -0,0 +1,22 @@ +# This file, build/pkgs/opensuse.txt, contains names of OpenSuse packages +# needed for installation of Sage from source. +# +# In addition, the files build/pkgs/SPKG/opensuse.txt contain the names +# of packages that provide the equivalent of SPKG. +# +# See build/bin/sage-spkg, where this information is processed +# for use in "sage -info SPKG". +# +# Everything on a line after a # character is ignored. +binutils +make +m4 +perl +python3 +tar +bc +gcc +# Needed if we download some packages from a https upstream URL +ca-certificates +# gunzip needed for ppl spkg +gzip diff --git a/build/pkgs/pandoc/distros/void.txt b/build/pkgs/pandoc/distros/void.txt new file mode 100644 index 00000000000..4a59b54c8c8 --- /dev/null +++ b/build/pkgs/pandoc/distros/void.txt @@ -0,0 +1 @@ +pandoc diff --git a/build/pkgs/pari/distros/opensuse.txt b/build/pkgs/pari/distros/opensuse.txt new file mode 100644 index 00000000000..517e54b3e5a --- /dev/null +++ b/build/pkgs/pari/distros/opensuse.txt @@ -0,0 +1,2 @@ +pari-devel +pari-gp diff --git a/build/pkgs/pari/distros/void.txt b/build/pkgs/pari/distros/void.txt index 7c8f04b36ae..0a6a6eb2969 100644 --- a/build/pkgs/pari/distros/void.txt +++ b/build/pkgs/pari/distros/void.txt @@ -1,2 +1,6 @@ pari pari-devel +pari-elldata +pari-galdata +pari-galpol +pari-seadata diff --git a/build/pkgs/pari/spkg-check.in b/build/pkgs/pari/spkg-check.in index ae3aecb4a0a..9aaa5ff5fa0 100644 --- a/build/pkgs/pari/spkg-check.in +++ b/build/pkgs/pari/spkg-check.in @@ -2,15 +2,7 @@ ## PARI ########################################### -if [ "x$SAGE_DEBUG" = xyes ] ; then - CFLAGS="$CFLAGS -O0 -g" # Disable optimisation, add debug symbols. Good - # for debugging or working around compiler bugs. -else - CFLAGS="-O3 -g $CFLAGS" # Default optimisation, with debug symbols. - # Prepend to not override user's setting. -fi - -export CFLAGS +export CFLAGS=$CFLAGS_O3 cd src diff --git a/build/pkgs/pari/spkg-install.in b/build/pkgs/pari/spkg-install.in index d8896b62a18..3134aadb353 100644 --- a/build/pkgs/pari/spkg-install.in +++ b/build/pkgs/pari/spkg-install.in @@ -112,10 +112,9 @@ if [ $MACOSX_VERSION -ge 14 ]; then export MACOSX_DEPLOYMENT_TARGET=10.9 fi -# Set CFLAGS +export CFLAGS=$CFLAGS_O3 + if [ "$SAGE_DEBUG" = yes ]; then - # Disable optimisation, add debug symbols. - CFLAGS="-O0 -g $CFLAGS" # Compile kernel files with -O1 instead of -funroll-loops; -O0 gives # a segmentation fault on some OS X systems when doing @@ -123,15 +122,8 @@ if [ "$SAGE_DEBUG" = yes ]; then # See #13921, also reported upstream: # - http://pari.math.u-bordeaux.fr/archives/pari-dev-1301/msg00000.html PARI_MAKEFLAGS="KERNELCFLAGS=-O1 $PARI_MAKEFLAGS" -else - # Use PARI's default CFLAGS (with -g added). - # PARI's Configure adds -O3 to the CFLAGS, so we don't need to add - # it explicitly. - CFLAGS="-g $CFLAGS" fi -export CFLAGS - # Build PARI/GP # Configure PARI/GP, forcing bash instead of /bin/sh. It is not diff --git a/build/pkgs/pari_elldata/distros/opensuse.txt b/build/pkgs/pari_elldata/distros/opensuse.txt new file mode 100644 index 00000000000..540f0b1ab86 --- /dev/null +++ b/build/pkgs/pari_elldata/distros/opensuse.txt @@ -0,0 +1 @@ +pari-elldata diff --git a/build/pkgs/pari_elldata/distros/void.txt b/build/pkgs/pari_elldata/distros/void.txt new file mode 100644 index 00000000000..540f0b1ab86 --- /dev/null +++ b/build/pkgs/pari_elldata/distros/void.txt @@ -0,0 +1 @@ +pari-elldata diff --git a/build/pkgs/pari_galdata/distros/opensuse.txt b/build/pkgs/pari_galdata/distros/opensuse.txt new file mode 100644 index 00000000000..38ad64bac82 --- /dev/null +++ b/build/pkgs/pari_galdata/distros/opensuse.txt @@ -0,0 +1 @@ +pari-galdata diff --git a/build/pkgs/pari_galdata/distros/void.txt b/build/pkgs/pari_galdata/distros/void.txt new file mode 100644 index 00000000000..38ad64bac82 --- /dev/null +++ b/build/pkgs/pari_galdata/distros/void.txt @@ -0,0 +1 @@ +pari-galdata diff --git a/build/pkgs/pari_galpol/distros/opensuse.txt b/build/pkgs/pari_galpol/distros/opensuse.txt new file mode 100644 index 00000000000..e3b41380f41 --- /dev/null +++ b/build/pkgs/pari_galpol/distros/opensuse.txt @@ -0,0 +1 @@ +pari-galpol diff --git a/build/pkgs/pari_galpol/distros/void.txt b/build/pkgs/pari_galpol/distros/void.txt new file mode 100644 index 00000000000..e3b41380f41 --- /dev/null +++ b/build/pkgs/pari_galpol/distros/void.txt @@ -0,0 +1 @@ +pari-galpol diff --git a/build/pkgs/pari_nftables/distros/opensuse.txt b/build/pkgs/pari_nftables/distros/opensuse.txt new file mode 100644 index 00000000000..a9f2eb4a474 --- /dev/null +++ b/build/pkgs/pari_nftables/distros/opensuse.txt @@ -0,0 +1 @@ +pari-nftables diff --git a/build/pkgs/pari_seadata/distros/opensuse.txt b/build/pkgs/pari_seadata/distros/opensuse.txt new file mode 100644 index 00000000000..3abdcf7bfcd --- /dev/null +++ b/build/pkgs/pari_seadata/distros/opensuse.txt @@ -0,0 +1 @@ +pari-seadata diff --git a/build/pkgs/pari_seadata/distros/void.txt b/build/pkgs/pari_seadata/distros/void.txt new file mode 100644 index 00000000000..3abdcf7bfcd --- /dev/null +++ b/build/pkgs/pari_seadata/distros/void.txt @@ -0,0 +1 @@ +pari-seadata diff --git a/build/pkgs/patch/distros/opensuse.txt b/build/pkgs/patch/distros/opensuse.txt new file mode 100644 index 00000000000..9eb7b90ed50 --- /dev/null +++ b/build/pkgs/patch/distros/opensuse.txt @@ -0,0 +1 @@ +patch diff --git a/build/pkgs/pcre/distros/opensuse.txt b/build/pkgs/pcre/distros/opensuse.txt new file mode 100644 index 00000000000..00edc2cd4ca --- /dev/null +++ b/build/pkgs/pcre/distros/opensuse.txt @@ -0,0 +1,3 @@ +"pkgconfig(libpcre)" +"pkgconfig(libpcreposix)" +"pkgconfig(libpcrecpp)" diff --git a/build/pkgs/perl_cpan_polymake_prereq/spkg-install b/build/pkgs/perl_cpan_polymake_prereq/spkg-install index 80d1688cd8f..44bb1e1a6ef 100755 --- a/build/pkgs/perl_cpan_polymake_prereq/spkg-install +++ b/build/pkgs/perl_cpan_polymake_prereq/spkg-install @@ -1,6 +1,6 @@ #! /usr/bin/env bash echo Error: The Perl prerequisites of the package polymake are not installed. -echo Please install CPAN packages $(cat build/pkgs/perl_cpan_polymake_prereq/distros/cpan.txt) +echo Please install CPAN packages $(cat distros/cpan.txt) echo manually, either using the system packages recommended by ./configure echo or directly from CPAN. exit 1 diff --git a/build/pkgs/perl_term_readline_gnu/distros/opensuse.txt b/build/pkgs/perl_term_readline_gnu/distros/opensuse.txt index 3b6a90263dd..ba80f6c445f 100644 --- a/build/pkgs/perl_term_readline_gnu/distros/opensuse.txt +++ b/build/pkgs/perl_term_readline_gnu/distros/opensuse.txt @@ -1 +1 @@ -perl-Term-ReadLine-Gnu +"perl(Term::ReadLine::Gnu)" diff --git a/build/pkgs/perl_term_readline_gnu/distros/void.txt b/build/pkgs/perl_term_readline_gnu/distros/void.txt new file mode 100644 index 00000000000..3b6a90263dd --- /dev/null +++ b/build/pkgs/perl_term_readline_gnu/distros/void.txt @@ -0,0 +1 @@ +perl-Term-ReadLine-Gnu diff --git a/build/pkgs/pexpect/distros/opensuse.txt b/build/pkgs/pexpect/distros/opensuse.txt new file mode 100644 index 00000000000..8d745ee4a07 --- /dev/null +++ b/build/pkgs/pexpect/distros/opensuse.txt @@ -0,0 +1 @@ +python3-pexpect diff --git a/build/pkgs/pickleshare/distros/opensuse.txt b/build/pkgs/pickleshare/distros/opensuse.txt new file mode 100644 index 00000000000..a00907d167b --- /dev/null +++ b/build/pkgs/pickleshare/distros/opensuse.txt @@ -0,0 +1 @@ +python3-pickleshare diff --git a/build/pkgs/pillow/distros/opensuse.txt b/build/pkgs/pillow/distros/opensuse.txt new file mode 100644 index 00000000000..88283bea6d9 --- /dev/null +++ b/build/pkgs/pillow/distros/opensuse.txt @@ -0,0 +1 @@ +python3-Pillow diff --git a/build/pkgs/pillow/spkg-install.in b/build/pkgs/pillow/spkg-install.in index d131fc6bf8e..86b88f1564d 100644 --- a/build/pkgs/pillow/spkg-install.in +++ b/build/pkgs/pillow/spkg-install.in @@ -18,12 +18,10 @@ if [ "$CONDA_PREFIX" != "" ]; then fi # Note: Avoid shared libraries inside egg files, Trac #19467 -sage-python23 setup.py \ - --no-user-cfg \ - bdist_wheel \ +sdh_setup_bdist_wheel \ build_ext \ --debug \ --disable-jpeg \ - $extra_build_ext || sdh_die "Error building/installing Pillow" + $extra_build_ext sdh_store_and_pip_install_wheel . diff --git a/build/pkgs/pip/distros/opensuse.txt b/build/pkgs/pip/distros/opensuse.txt new file mode 100644 index 00000000000..39bd9fc5097 --- /dev/null +++ b/build/pkgs/pip/distros/opensuse.txt @@ -0,0 +1 @@ +python3-pip diff --git a/build/pkgs/pkgconf/distros/opensuse.txt b/build/pkgs/pkgconf/distros/opensuse.txt new file mode 100644 index 00000000000..05a1a221b7d --- /dev/null +++ b/build/pkgs/pkgconf/distros/opensuse.txt @@ -0,0 +1 @@ +pkgconf diff --git a/build/pkgs/pkgconfig/distros/opensuse.txt b/build/pkgs/pkgconfig/distros/opensuse.txt new file mode 100644 index 00000000000..6d2c214eb6d --- /dev/null +++ b/build/pkgs/pkgconfig/distros/opensuse.txt @@ -0,0 +1 @@ +pkg-config diff --git a/build/pkgs/planarity/distros/opensuse.txt b/build/pkgs/planarity/distros/opensuse.txt new file mode 100644 index 00000000000..634b142c650 --- /dev/null +++ b/build/pkgs/planarity/distros/opensuse.txt @@ -0,0 +1,2 @@ +edge-addition-planarity-suite +edge-addition-planarity-suite-devel diff --git a/build/pkgs/polylib/distros/opensuse.txt b/build/pkgs/polylib/distros/opensuse.txt new file mode 100644 index 00000000000..f6432c31dfe --- /dev/null +++ b/build/pkgs/polylib/distros/opensuse.txt @@ -0,0 +1,2 @@ +polylib +"pkgconfig(polylibgmp)" diff --git a/build/pkgs/polymake/distros/opensuse.txt b/build/pkgs/polymake/distros/opensuse.txt new file mode 100644 index 00000000000..2a9cc70b2f5 --- /dev/null +++ b/build/pkgs/polymake/distros/opensuse.txt @@ -0,0 +1 @@ +polymake diff --git a/build/pkgs/ppl/distros/opensuse.txt b/build/pkgs/ppl/distros/opensuse.txt new file mode 100644 index 00000000000..1c5454db76a --- /dev/null +++ b/build/pkgs/ppl/distros/opensuse.txt @@ -0,0 +1 @@ +ppl-devel diff --git a/build/pkgs/primecount/distros/opensuse.txt b/build/pkgs/primecount/distros/opensuse.txt new file mode 100644 index 00000000000..e978f655795 --- /dev/null +++ b/build/pkgs/primecount/distros/opensuse.txt @@ -0,0 +1,2 @@ +primecount +libprimecount-devel diff --git a/build/pkgs/prometheus_client/distros/opensuse.txt b/build/pkgs/prometheus_client/distros/opensuse.txt new file mode 100644 index 00000000000..4d7723ec37e --- /dev/null +++ b/build/pkgs/prometheus_client/distros/opensuse.txt @@ -0,0 +1 @@ +python3-prometheus_client diff --git a/build/pkgs/prompt_toolkit/distros/opensuse.txt b/build/pkgs/prompt_toolkit/distros/opensuse.txt new file mode 100644 index 00000000000..424253f1340 --- /dev/null +++ b/build/pkgs/prompt_toolkit/distros/opensuse.txt @@ -0,0 +1 @@ +python3-prompt_toolkit diff --git a/build/pkgs/psutil/distros/opensuse.txt b/build/pkgs/psutil/distros/opensuse.txt new file mode 100644 index 00000000000..ac842e4b343 --- /dev/null +++ b/build/pkgs/psutil/distros/opensuse.txt @@ -0,0 +1 @@ +python3-psutil diff --git a/build/pkgs/ptyprocess/distros/opensuse.txt b/build/pkgs/ptyprocess/distros/opensuse.txt new file mode 100644 index 00000000000..ad4f6db1ca7 --- /dev/null +++ b/build/pkgs/ptyprocess/distros/opensuse.txt @@ -0,0 +1 @@ +python3-ptyprocess diff --git a/build/pkgs/pybtex/distros/opensuse.txt b/build/pkgs/pybtex/distros/opensuse.txt new file mode 100644 index 00000000000..bdd39a48fde --- /dev/null +++ b/build/pkgs/pybtex/distros/opensuse.txt @@ -0,0 +1 @@ +python3-pybtex diff --git a/build/pkgs/pycparser/distros/opensuse.txt b/build/pkgs/pycparser/distros/opensuse.txt new file mode 100644 index 00000000000..0ba4f8b19f5 --- /dev/null +++ b/build/pkgs/pycparser/distros/opensuse.txt @@ -0,0 +1 @@ +python3-pycparser diff --git a/build/pkgs/pyflakes/distros/opensuse.txt b/build/pkgs/pyflakes/distros/opensuse.txt new file mode 100644 index 00000000000..a16ae878a72 --- /dev/null +++ b/build/pkgs/pyflakes/distros/opensuse.txt @@ -0,0 +1 @@ +python3-pyflakes diff --git a/build/pkgs/pygments/distros/opensuse.txt b/build/pkgs/pygments/distros/opensuse.txt new file mode 100644 index 00000000000..9ff5740e79c --- /dev/null +++ b/build/pkgs/pygments/distros/opensuse.txt @@ -0,0 +1 @@ +python3-Pygments diff --git a/build/pkgs/pyopenssl/distros/opensuse.txt b/build/pkgs/pyopenssl/distros/opensuse.txt new file mode 100644 index 00000000000..353babfd9aa --- /dev/null +++ b/build/pkgs/pyopenssl/distros/opensuse.txt @@ -0,0 +1 @@ +python3-pyOpenSSL diff --git a/build/pkgs/pyparsing/distros/opensuse.txt b/build/pkgs/pyparsing/distros/opensuse.txt new file mode 100644 index 00000000000..492a7ce0a69 --- /dev/null +++ b/build/pkgs/pyparsing/distros/opensuse.txt @@ -0,0 +1 @@ +python3-pyparsing diff --git a/build/pkgs/python_igraph/spkg-install.in b/build/pkgs/python_igraph/spkg-install.in index b8a403546c7..dff68afee40 100644 --- a/build/pkgs/python_igraph/spkg-install.in +++ b/build/pkgs/python_igraph/spkg-install.in @@ -1,6 +1,5 @@ cd src -sage-python23 setup.py bdist_wheel \ - --use-pkg-config || sdh_die "Error building wheel for python_igraph" +sdh_setup_bdist_wheel --use-pkg-config sdh_store_and_pip_install_wheel . diff --git a/build/pkgs/pytz/distros/opensuse.txt b/build/pkgs/pytz/distros/opensuse.txt new file mode 100644 index 00000000000..1b20e1dbb77 --- /dev/null +++ b/build/pkgs/pytz/distros/opensuse.txt @@ -0,0 +1 @@ +python3-pytz diff --git a/build/pkgs/pyx/distros/opensuse.txt b/build/pkgs/pyx/distros/opensuse.txt new file mode 100644 index 00000000000..03265558e86 --- /dev/null +++ b/build/pkgs/pyx/distros/opensuse.txt @@ -0,0 +1 @@ +python3-PyX diff --git a/build/pkgs/pyzmq/distros/opensuse.txt b/build/pkgs/pyzmq/distros/opensuse.txt new file mode 100644 index 00000000000..265a272130e --- /dev/null +++ b/build/pkgs/pyzmq/distros/opensuse.txt @@ -0,0 +1 @@ +python3-pyzmq diff --git a/build/pkgs/qhull/distros/opensuse.txt b/build/pkgs/qhull/distros/opensuse.txt new file mode 100644 index 00000000000..dadb3d626d3 --- /dev/null +++ b/build/pkgs/qhull/distros/opensuse.txt @@ -0,0 +1 @@ +qhull-devel diff --git a/build/pkgs/r/distros/opensuse.txt b/build/pkgs/r/distros/opensuse.txt new file mode 100644 index 00000000000..ea824f16872 --- /dev/null +++ b/build/pkgs/r/distros/opensuse.txt @@ -0,0 +1 @@ +R-base diff --git a/build/pkgs/r/distros/void.txt b/build/pkgs/r/distros/void.txt index 4286f428e3b..331bae08fb7 100644 --- a/build/pkgs/r/distros/void.txt +++ b/build/pkgs/r/distros/void.txt @@ -1 +1 @@ -r +R diff --git a/build/pkgs/r/spkg-install.in b/build/pkgs/r/spkg-install.in index 905fc2a6150..e262131aa30 100644 --- a/build/pkgs/r/spkg-install.in +++ b/build/pkgs/r/spkg-install.in @@ -7,14 +7,6 @@ unset GREP_OPTIONS # and cannot be used to pass this path. CPPFLAGS="$CPPFLAGS" -# Optimization flags -if [ "$SAGE_DEBUG" = yes ]; then - CFLAGS="-g -O0 $CFLAGS" - FCFLAGS="-g -O0 $FCFLAGS" -else - CFLAGS="-g -O2 $CFLAGS" - FCFLAGS="-g -O2 $FCFLAGS" -fi # #29170: Compilation errors caused by a silently failing configure check # "for type of 'hidden' Fortran character lengths" # on ubuntu-bionic-minimal, ubuntu-eoan/focal-minimal, debian-buster/bullseye/sid-minimal, diff --git a/build/pkgs/readline/distros/opensuse.txt b/build/pkgs/readline/distros/opensuse.txt new file mode 100644 index 00000000000..fffe7fdb306 --- /dev/null +++ b/build/pkgs/readline/distros/opensuse.txt @@ -0,0 +1,3 @@ +readline-devel +# not available on Leap 15.2: +"pkgconfig(readline)" diff --git a/build/pkgs/readline/spkg-install.in b/build/pkgs/readline/spkg-install.in index 6bdbc9a5cd0..126c4372169 100644 --- a/build/pkgs/readline/spkg-install.in +++ b/build/pkgs/readline/spkg-install.in @@ -1,21 +1,3 @@ -if [[ $SAGE_DEBUG = yes ]]; then - CFLAGS="$CFLAGS -g -O0" -else - CFLAGS="-g -O2 $CFLAGS" -fi - -echo "The following environment variables will be exported:" -echo "Using CC=$CC" -echo "Using CFLAGS=$CFLAGS" -echo "Using CPPFLAGS=$CPPFLAGS" -echo "Using LDFLAGS=$LDFLAGS" -echo "Configure scripts and/or makefiles might override these later." - -export CC -export CFLAGS -export CPPFLAGS -export LDFLAGS - cd src/ sdh_configure --with-curses --enable-shared --disable-static diff --git a/build/pkgs/requests/distros/opensuse.txt b/build/pkgs/requests/distros/opensuse.txt new file mode 100644 index 00000000000..43147b2be74 --- /dev/null +++ b/build/pkgs/requests/distros/opensuse.txt @@ -0,0 +1 @@ +python3-requests diff --git a/build/pkgs/rubiks/spkg-install.in b/build/pkgs/rubiks/spkg-install.in index 3ff0398d063..e03c76e432a 100644 --- a/build/pkgs/rubiks/spkg-install.in +++ b/build/pkgs/rubiks/spkg-install.in @@ -2,13 +2,11 @@ ## rubiks ########################################### -# Add a sensible default optimisation flag. Change if necessary. -OPTIMIZATION_FLAGS="-O2" # Work around a bug in gcc 4.6.0: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48702 if [ "`testcc.sh $CC`" = GCC ] ; then if $CC -dumpversion 2>/dev/null |grep >/dev/null '^4\.6\.[01]$' ; then echo "Warning: Working around bug in gcc 4.6.0" - OPTIMIZATION_FLAGS="$OPTIMIZATION_FLAGS -fno-ivopts" + EXTRA_FLAG="-fno-ivopts" fi fi @@ -16,28 +14,14 @@ fi # But it is better to do them all each time, rather than ommit # a flag by mistake. -CFLAGS="$CFLAGS $OPTIMIZATION_FLAGS " -CXXFLAGS="$CXXFLAGS $OPTIMIZATION_FLAGS " -FCFLAGS="$FCFLAGS $OPTIMIZATION_FLAGS " -F77FLAGS="$F77FLAGS $OPTIMIZATION_FLAGS " - -# If SAGE_DEBUG is set either unset (the default), or set to 'yes' -# Add debugging information. -# Since both the Sun and GNU compilers accept -g to give debugging information -# there is no need to do anything specific to one compiler or the other. - -if [ "x$SAGE_DEBUG" = "x" ] || [ "x$SAGE_DEBUG" = "xyes" ] ; then - echo "Code will be built with debugging information present. Set 'SAGE_DEBUG' to 'no' if you don't want that." - # Actually anything other than 'yes' will cause - # no debugging information to be added. - CFLAGS="$CFLAGS -g " - CXXFLAGS="$CXXFLAGS -g " - FCFLAGS="$FCFLAGS -g " - F77FLAGS="$F77FLAGS -g " -else - echo "No debugging information will be used during the build of this package" - echo "Unset SAGE_DEBUG if you want debugging information present (-g added)" -fi +export CFLAGS="$CFLAGS $EXTRA_FLAG" +export CXXFLAGS="$CXXFLAGS $EXTRA_FLAG" +export FCFLAGS="$FCFLAGS $EXTRA_FLAG" +export F77FLAGS="$F77FLAGS $EXTRA_FLAG" +export CPPFLAGS +export LDFLAGS +export ABI +export CPPFLAGS # These are all used by GNU to specify compilers. echo "Using CC=$CC" @@ -57,16 +41,6 @@ echo "Using ABI=$ABI" echo "configure scripts and/or makefiles might override these later" echo " " -# export everything. Probably not necessary in most cases. -export CFLAGS -export CXXFLAGS -export FCFLAGS -export F77FLAGS -export CPPFLAGS -export LDFLAGS -export ABI -export CPPFLAGS - # End of pretty general spkg-install file. # Now do the specific things needed for this package (rubiks) diff --git a/build/pkgs/sage_conf/dependencies b/build/pkgs/sage_conf/dependencies index 03d9b278764..3fcf7f76b10 100644 --- a/build/pkgs/sage_conf/dependencies +++ b/build/pkgs/sage_conf/dependencies @@ -1 +1 @@ -$(PYTHON) ../pkgs/sage_conf/src/sage_conf.py ../pkgs/sage_conf/src/setup.cfg | $(PYTHON_TOOLCHAIN) +$(PYTHON) ../pkgs/sage_conf/src/sage_conf.py ../pkgs/sage_conf/src/setup.cfg ../pkgs/sage_conf/src/bin/sage-env-config | $(PYTHON_TOOLCHAIN) diff --git a/build/pkgs/sage_conf/spkg-install b/build/pkgs/sage_conf/spkg-install index 468970ba085..dcb407bf40d 100755 --- a/build/pkgs/sage_conf/spkg-install +++ b/build/pkgs/sage_conf/spkg-install @@ -9,4 +9,8 @@ if [ $? -ne 0 ]; then echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" exit 1 fi -cd src && sdh_pip_install . +cd src +# Need to build a wheel manually because pip does not +# follow symlinks. +sdh_setup_bdist_wheel +sdh_store_and_pip_install_wheel . diff --git a/build/pkgs/sage_conf/spkg-src b/build/pkgs/sage_conf/spkg-src new file mode 100755 index 00000000000..69f7c92245a --- /dev/null +++ b/build/pkgs/sage_conf/spkg-src @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# +# Script to prepare an sdist tarball for sage_conf +# This script is not used during build. +# +# HOW TO MAKE THE TARBALL: +# ./sage --sh build/pkgs/sage_conf/spkg-src + +if [ -z "$SAGE_ROOT" ] ; then + echo >&2 "Error - SAGE_ROOT undefined ... exiting" + echo >&2 "Maybe run 'sage -sh'?" + exit 1 +fi + +# Exit on failure +set -e + +cd build/pkgs/sage_conf + +cd src +sage-python23 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES" diff --git a/build/pkgs/sage_conf/src/MANIFEST.in b/build/pkgs/sage_conf/src/MANIFEST.in new file mode 100644 index 00000000000..d156bc24748 --- /dev/null +++ b/build/pkgs/sage_conf/src/MANIFEST.in @@ -0,0 +1 @@ +include bin/sage-env-config diff --git a/build/pkgs/sage_conf/src/bin/sage-env-config b/build/pkgs/sage_conf/src/bin/sage-env-config new file mode 120000 index 00000000000..a3e48b05b63 --- /dev/null +++ b/build/pkgs/sage_conf/src/bin/sage-env-config @@ -0,0 +1 @@ +../../../../../src/bin/sage-env-config \ No newline at end of file diff --git a/build/pkgs/sage_conf/src/sage_conf.py.in b/build/pkgs/sage_conf/src/sage_conf.py.in index b68efd38da5..4e38838700b 100644 --- a/build/pkgs/sage_conf/src/sage_conf.py.in +++ b/build/pkgs/sage_conf/src/sage_conf.py.in @@ -14,7 +14,6 @@ SAGE_NAUTY_BINS_PREFIX = "@SAGE_NAUTY_BINS_PREFIX@" CBLAS_PC_MODULES = "cblas" # Used in sage.repl.ipython_kernel.install -JSMOL_DIR = "@prefix@/share/jsmol" MATHJAX_DIR = "@prefix@/share/mathjax" THREEJS_DIR = "@prefix@/share/threejs" diff --git a/build/pkgs/sage_conf/src/setup.cfg.in b/build/pkgs/sage_conf/src/setup.cfg.in index 3c0b0392d6c..12ef5727fed 100644 --- a/build/pkgs/sage_conf/src/setup.cfg.in +++ b/build/pkgs/sage_conf/src/setup.cfg.in @@ -14,6 +14,9 @@ url = https://www.sagemath.org py_modules = sage_conf +scripts = + bin/sage-env-config + [options.entry_points] console_scripts = sage-config = sage_conf:_main diff --git a/build/pkgs/sagelib/package-version.txt b/build/pkgs/sagelib/package-version.txt index b2a8dddf89a..3692f999a89 100644 --- a/build/pkgs/sagelib/package-version.txt +++ b/build/pkgs/sagelib/package-version.txt @@ -1 +1 @@ -9.3.beta3 +9.3.beta4 diff --git a/build/pkgs/sagelib/src/setup.py b/build/pkgs/sagelib/src/setup.py index 3c85d979141..6f85b984c25 100755 --- a/build/pkgs/sagelib/src/setup.py +++ b/build/pkgs/sagelib/src/setup.py @@ -140,6 +140,7 @@ 'bin/sage-massif', 'bin/sage-omega', 'bin/sage-valgrind', + 'bin/sage-venv-config', 'bin/sage-version.sh', 'bin/sage-cleaner', ## Only makes sense in sage-the-distribution. TODO: Move to another installation script. @@ -148,7 +149,7 @@ ## Uncategorized scripts in alphabetical order 'bin/math-readline', 'bin/sage-env', - 'bin/sage-env-config', + # sage-env-config -- installed by sage_conf # sage-env-config.in -- not to be installed', 'bin/sage-gdb-commands', 'bin/sage-grep', diff --git a/build/pkgs/sagetex/dependencies b/build/pkgs/sagetex/dependencies index 6d68bddd865..43e658b4ff3 100644 --- a/build/pkgs/sagetex/dependencies +++ b/build/pkgs/sagetex/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) maxima scipy matplotlib pillow tachyon | $(SAGERUNTIME) sympy elliptic_curves jmol +$(PYTHON) maxima scipy matplotlib pillow tachyon | $(and $(filter-out no,$(SAGE_CHECK_sagetex)), $(SAGERUNTIME) sympy elliptic_curves jmol) To build SageTeX, you just need Python, but to test (SAGE_CHECK=yes) SageTeX, you actually need to run Sage, produce plots,... diff --git a/build/pkgs/scandir/distros/opensuse.txt b/build/pkgs/scandir/distros/opensuse.txt new file mode 100644 index 00000000000..d05b4d1319d --- /dev/null +++ b/build/pkgs/scandir/distros/opensuse.txt @@ -0,0 +1 @@ +python3-scandir diff --git a/build/pkgs/scipy/distros/opensuse.txt b/build/pkgs/scipy/distros/opensuse.txt new file mode 100644 index 00000000000..12b366666d6 --- /dev/null +++ b/build/pkgs/scipy/distros/opensuse.txt @@ -0,0 +1 @@ +python3-scipy diff --git a/build/pkgs/send2trash/distros/opensuse.txt b/build/pkgs/send2trash/distros/opensuse.txt new file mode 100644 index 00000000000..404e2bd3580 --- /dev/null +++ b/build/pkgs/send2trash/distros/opensuse.txt @@ -0,0 +1 @@ +python3-Send2Trash diff --git a/build/pkgs/setuptools/distros/opensuse.txt b/build/pkgs/setuptools/distros/opensuse.txt new file mode 100644 index 00000000000..1c0901c0374 --- /dev/null +++ b/build/pkgs/setuptools/distros/opensuse.txt @@ -0,0 +1 @@ +python3-setuptools diff --git a/build/pkgs/setuptools_scm/distros/opensuse.txt b/build/pkgs/setuptools_scm/distros/opensuse.txt new file mode 100644 index 00000000000..2aa5ca12cba --- /dev/null +++ b/build/pkgs/setuptools_scm/distros/opensuse.txt @@ -0,0 +1 @@ +python3-setuptools_scm diff --git a/build/pkgs/simplegeneric/distros/opensuse.txt b/build/pkgs/simplegeneric/distros/opensuse.txt new file mode 100644 index 00000000000..d788a7233a7 --- /dev/null +++ b/build/pkgs/simplegeneric/distros/opensuse.txt @@ -0,0 +1 @@ +python3-simplegeneric diff --git a/build/pkgs/singular/spkg-install.in b/build/pkgs/singular/spkg-install.in index b9359d999fe..49d66d23187 100644 --- a/build/pkgs/singular/spkg-install.in +++ b/build/pkgs/singular/spkg-install.in @@ -9,18 +9,8 @@ if [ "x$SAGE_DEBUG" = "xyes" ]; then # This used to disable omalloc but that is not really supported # by upstream SINGULAR_CONFIGURE="$SINGULAR_CONFIGURE --enable-debug --disable-optimizationflags" - - CFLAGS="$CFLAGS -O0 -g" - CXXFLAGS="$CXXFLAGS -O0 -g" -else - # Singular 4.x (mostly) does not longer set defaults for CFLAGS and CXXFLAGS - CFLAGS="-O2 -g $CFLAGS" - CXXFLAGS="-O2 -g $CXXFLAGS" fi -export CFLAGS CXXFLAGS - - remove_old_version() { # the following is a little verbose but it ensures we leave no trace of 3.x diff --git a/build/pkgs/sirocco/distros/opensuse.txt b/build/pkgs/sirocco/distros/opensuse.txt new file mode 100644 index 00000000000..1281d3f2c84 --- /dev/null +++ b/build/pkgs/sirocco/distros/opensuse.txt @@ -0,0 +1 @@ +sirocco-devel diff --git a/build/pkgs/six/distros/opensuse.txt b/build/pkgs/six/distros/opensuse.txt new file mode 100644 index 00000000000..68ff8595d0b --- /dev/null +++ b/build/pkgs/six/distros/opensuse.txt @@ -0,0 +1 @@ +python3-six diff --git a/build/pkgs/snowballstemmer/distros/opensuse.txt b/build/pkgs/snowballstemmer/distros/opensuse.txt new file mode 100644 index 00000000000..09b2636df60 --- /dev/null +++ b/build/pkgs/snowballstemmer/distros/opensuse.txt @@ -0,0 +1 @@ +python3-snowballstemmer diff --git a/build/pkgs/speaklater/distros/opensuse.txt b/build/pkgs/speaklater/distros/opensuse.txt new file mode 100644 index 00000000000..f06cf684b6f --- /dev/null +++ b/build/pkgs/speaklater/distros/opensuse.txt @@ -0,0 +1 @@ +python3-speaklater diff --git a/build/pkgs/sphinx/distros/opensuse.txt b/build/pkgs/sphinx/distros/opensuse.txt new file mode 100644 index 00000000000..bc54d0bd553 --- /dev/null +++ b/build/pkgs/sphinx/distros/opensuse.txt @@ -0,0 +1 @@ +python3-Sphinx diff --git a/build/pkgs/sphinxcontrib_applehelp/distros/opensuse.txt b/build/pkgs/sphinxcontrib_applehelp/distros/opensuse.txt new file mode 100644 index 00000000000..adedbd455f8 --- /dev/null +++ b/build/pkgs/sphinxcontrib_applehelp/distros/opensuse.txt @@ -0,0 +1 @@ +python3-sphinxcontrib-applehelp diff --git a/build/pkgs/sphinxcontrib_serializinghtml/distros/opensuse.txt b/build/pkgs/sphinxcontrib_serializinghtml/distros/opensuse.txt new file mode 100644 index 00000000000..1a8ea8424a7 --- /dev/null +++ b/build/pkgs/sphinxcontrib_serializinghtml/distros/opensuse.txt @@ -0,0 +1 @@ +python3-sphinxcontrib-serializinghtml diff --git a/build/pkgs/sphinxcontrib_websupport/distros/opensuse.txt b/build/pkgs/sphinxcontrib_websupport/distros/opensuse.txt new file mode 100644 index 00000000000..2c8e8e8d34d --- /dev/null +++ b/build/pkgs/sphinxcontrib_websupport/distros/opensuse.txt @@ -0,0 +1 @@ +python3-sphinxcontrib-websupport diff --git a/build/pkgs/sqlalchemy/distros/opensuse.txt b/build/pkgs/sqlalchemy/distros/opensuse.txt new file mode 100644 index 00000000000..023e06b7468 --- /dev/null +++ b/build/pkgs/sqlalchemy/distros/opensuse.txt @@ -0,0 +1 @@ +python3-SQLAlchemy diff --git a/build/pkgs/sqlite/distros/opensuse.txt b/build/pkgs/sqlite/distros/opensuse.txt new file mode 100644 index 00000000000..e5831abec57 --- /dev/null +++ b/build/pkgs/sqlite/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(sqlite3)" diff --git a/build/pkgs/sqlite/spkg-install.in b/build/pkgs/sqlite/spkg-install.in index 3cca459dae3..f20e4ecdb23 100644 --- a/build/pkgs/sqlite/spkg-install.in +++ b/build/pkgs/sqlite/spkg-install.in @@ -6,15 +6,7 @@ cd src cp "$SAGE_ROOT"/config/config.* . -# Build with -O0 if debugging requested -if [ "$SAGE_DEBUG" = "yes" ]; then - CFLAGS="-g -O0 $CFLAGS" -else - CFLAGS="-g -O2 $CFLAGS" -fi - export CPPFLAGS="$CPPFLAGS -I$SAGE_LOCAL/include" -export CFLAGS # Old OS X systems need -DSQLITE_WITHOUT_ZONEMALLOC if uname -sr |grep 'Darwin [0-8][.]' >/dev/null; then diff --git a/build/pkgs/suitesparse/distros/opensuse.txt b/build/pkgs/suitesparse/distros/opensuse.txt index 8309d12f520..6a520af0d01 100644 --- a/build/pkgs/suitesparse/distros/opensuse.txt +++ b/build/pkgs/suitesparse/distros/opensuse.txt @@ -1 +1 @@ -suitesparse +suitesparse-devel diff --git a/build/pkgs/surf/distros/opensuse.txt b/build/pkgs/surf/distros/opensuse.txt new file mode 100644 index 00000000000..5551a818dc4 --- /dev/null +++ b/build/pkgs/surf/distros/opensuse.txt @@ -0,0 +1 @@ +surf diff --git a/build/pkgs/symmetrica/dependencies b/build/pkgs/symmetrica/dependencies index 3546cda4614..7a7b9cf8a80 100644 --- a/build/pkgs/symmetrica/dependencies +++ b/build/pkgs/symmetrica/dependencies @@ -1,4 +1,6 @@ -# no dependencies +| xz + +xz is needed for unpacking the tarball when sage-bootstrap-python is ancient ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/sympow/distros/opensuse.txt b/build/pkgs/sympow/distros/opensuse.txt new file mode 100644 index 00000000000..a2ae7a8a59c --- /dev/null +++ b/build/pkgs/sympow/distros/opensuse.txt @@ -0,0 +1 @@ +sympow diff --git a/build/pkgs/sympy/checksums.ini b/build/pkgs/sympy/checksums.ini index 66a0bfe4e68..a1ca862ccdf 100644 --- a/build/pkgs/sympy/checksums.ini +++ b/build/pkgs/sympy/checksums.ini @@ -1,5 +1,5 @@ tarball=sympy-VERSION.tar.gz -sha1=17103fdd79d9437756457b08583248dfe6d6e95d -md5=50d6b69b1de36b757484b9ff833a9e0a -cksum=526663062 +sha1=a96e0827a8fd7325b4f0099bb92ba89ae88bace4 +md5=58764f19e5d8ee1acec6264456191699 +cksum=4154398619 upstream_url=https://github.com/sympy/sympy/releases/download/sympy-VERSION/sympy-VERSION.tar.gz diff --git a/build/pkgs/sympy/package-version.txt b/build/pkgs/sympy/package-version.txt index fdd3be6df54..d3bdbdf1fda 100644 --- a/build/pkgs/sympy/package-version.txt +++ b/build/pkgs/sympy/package-version.txt @@ -1 +1 @@ -1.6.2 +1.7 diff --git a/build/pkgs/tachyon/distros/opensuse.txt b/build/pkgs/tachyon/distros/opensuse.txt new file mode 100644 index 00000000000..39e8fd61a2d --- /dev/null +++ b/build/pkgs/tachyon/distros/opensuse.txt @@ -0,0 +1 @@ +tachyon diff --git a/build/pkgs/tornado/distros/opensuse.txt b/build/pkgs/tornado/distros/opensuse.txt new file mode 100644 index 00000000000..426685be95b --- /dev/null +++ b/build/pkgs/tornado/distros/opensuse.txt @@ -0,0 +1 @@ +python3-tornado diff --git a/build/pkgs/tox/distros/cygwin.txt b/build/pkgs/tox/distros/cygwin.txt new file mode 100644 index 00000000000..053148f8486 --- /dev/null +++ b/build/pkgs/tox/distros/cygwin.txt @@ -0,0 +1 @@ +tox diff --git a/build/pkgs/tox/distros/debian.txt b/build/pkgs/tox/distros/debian.txt new file mode 100644 index 00000000000..053148f8486 --- /dev/null +++ b/build/pkgs/tox/distros/debian.txt @@ -0,0 +1 @@ +tox diff --git a/build/pkgs/tox/distros/fedora.txt b/build/pkgs/tox/distros/fedora.txt new file mode 100644 index 00000000000..053148f8486 --- /dev/null +++ b/build/pkgs/tox/distros/fedora.txt @@ -0,0 +1 @@ +tox diff --git a/build/pkgs/tox/distros/freebsd.txt b/build/pkgs/tox/distros/freebsd.txt new file mode 100644 index 00000000000..053148f8486 --- /dev/null +++ b/build/pkgs/tox/distros/freebsd.txt @@ -0,0 +1 @@ +tox diff --git a/build/pkgs/tox/distros/gentoo.txt b/build/pkgs/tox/distros/gentoo.txt new file mode 100644 index 00000000000..053148f8486 --- /dev/null +++ b/build/pkgs/tox/distros/gentoo.txt @@ -0,0 +1 @@ +tox diff --git a/build/pkgs/tox/distros/homebrew.txt b/build/pkgs/tox/distros/homebrew.txt new file mode 100644 index 00000000000..053148f8486 --- /dev/null +++ b/build/pkgs/tox/distros/homebrew.txt @@ -0,0 +1 @@ +tox diff --git a/build/pkgs/tox/distros/slackware.txt b/build/pkgs/tox/distros/slackware.txt new file mode 100644 index 00000000000..053148f8486 --- /dev/null +++ b/build/pkgs/tox/distros/slackware.txt @@ -0,0 +1 @@ +tox diff --git a/build/pkgs/tox/distros/void.txt b/build/pkgs/tox/distros/void.txt new file mode 100644 index 00000000000..053148f8486 --- /dev/null +++ b/build/pkgs/tox/distros/void.txt @@ -0,0 +1 @@ +tox diff --git a/build/pkgs/traitlets/distros/opensuse.txt b/build/pkgs/traitlets/distros/opensuse.txt new file mode 100644 index 00000000000..93cb8375e46 --- /dev/null +++ b/build/pkgs/traitlets/distros/opensuse.txt @@ -0,0 +1 @@ +python3-traitlets diff --git a/build/pkgs/tzlocal/distros/opensuse.txt b/build/pkgs/tzlocal/distros/opensuse.txt new file mode 100644 index 00000000000..95d2d705c05 --- /dev/null +++ b/build/pkgs/tzlocal/distros/opensuse.txt @@ -0,0 +1 @@ +python3-tzlocal diff --git a/build/pkgs/valgrind/distros/opensuse.txt b/build/pkgs/valgrind/distros/opensuse.txt new file mode 100644 index 00000000000..e7af4129194 --- /dev/null +++ b/build/pkgs/valgrind/distros/opensuse.txt @@ -0,0 +1 @@ +valgrind diff --git a/build/pkgs/vcversioner/distros/opensuse.txt b/build/pkgs/vcversioner/distros/opensuse.txt new file mode 100644 index 00000000000..3a9b9818aa4 --- /dev/null +++ b/build/pkgs/vcversioner/distros/opensuse.txt @@ -0,0 +1 @@ +python3-vcversioner diff --git a/build/pkgs/wcwidth/distros/opensuse.txt b/build/pkgs/wcwidth/distros/opensuse.txt new file mode 100644 index 00000000000..2974220c878 --- /dev/null +++ b/build/pkgs/wcwidth/distros/opensuse.txt @@ -0,0 +1 @@ +python3-wcwidth diff --git a/build/pkgs/webencodings/distros/opensuse.txt b/build/pkgs/webencodings/distros/opensuse.txt new file mode 100644 index 00000000000..ac30c2f3307 --- /dev/null +++ b/build/pkgs/webencodings/distros/opensuse.txt @@ -0,0 +1 @@ +python3-webencodings diff --git a/build/pkgs/wheel/distros/opensuse.txt b/build/pkgs/wheel/distros/opensuse.txt new file mode 100644 index 00000000000..3c066725a1d --- /dev/null +++ b/build/pkgs/wheel/distros/opensuse.txt @@ -0,0 +1 @@ +python3-wheel diff --git a/build/pkgs/widgetsnbextension/distros/opensuse.txt b/build/pkgs/widgetsnbextension/distros/opensuse.txt new file mode 100644 index 00000000000..3e0fb97802f --- /dev/null +++ b/build/pkgs/widgetsnbextension/distros/opensuse.txt @@ -0,0 +1 @@ +jupyter-widgetsnbextension diff --git a/build/pkgs/xz/distros/opensuse.txt b/build/pkgs/xz/distros/opensuse.txt new file mode 100644 index 00000000000..f84d903df3e --- /dev/null +++ b/build/pkgs/xz/distros/opensuse.txt @@ -0,0 +1,2 @@ +xz +"pkgconfig(liblzma)" diff --git a/build/pkgs/xz/distros/void.txt b/build/pkgs/xz/distros/void.txt new file mode 100644 index 00000000000..c5fa156f8a0 --- /dev/null +++ b/build/pkgs/xz/distros/void.txt @@ -0,0 +1,2 @@ +xz +liblzma-devel diff --git a/build/pkgs/zeromq/distros/opensuse.txt b/build/pkgs/zeromq/distros/opensuse.txt new file mode 100644 index 00000000000..bf80cc05be1 --- /dev/null +++ b/build/pkgs/zeromq/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(libzmq)" diff --git a/build/pkgs/zlib/distros/opensuse.txt b/build/pkgs/zlib/distros/opensuse.txt new file mode 100644 index 00000000000..734537742c0 --- /dev/null +++ b/build/pkgs/zlib/distros/opensuse.txt @@ -0,0 +1 @@ +"pkgconfig(zlib)" diff --git a/build/pkgs/zn_poly/distros/opensuse.txt b/build/pkgs/zn_poly/distros/opensuse.txt index 5ff8997d672..4bbe6043915 100644 --- a/build/pkgs/zn_poly/distros/opensuse.txt +++ b/build/pkgs/zn_poly/distros/opensuse.txt @@ -1 +1 @@ -zn_poly +zn_poly-devel diff --git a/build/pkgs/zn_poly/spkg-check.in b/build/pkgs/zn_poly/spkg-check.in index 299ac7a6b8a..c7831aed276 100644 --- a/build/pkgs/zn_poly/spkg-check.in +++ b/build/pkgs/zn_poly/spkg-check.in @@ -8,14 +8,8 @@ # Set up environment variables: ############################################################################### -if [ "$SAGE_DEBUG" = yes ]; then - echo >&2 "Warning: Setting SAGE_DEBUG to 'yes' completely disables optimization." - CFLAGS="$CFLAGS -O0 -g -fPIC" - CXXFLAGS="$CXXFLAGS -O0 -g -fPIC" -else - CFLAGS="-O3 -g $CFLAGS -fPIC" - CXXFLAGS="-O3 -g $CXXFLAGS -fPIC" -fi +CFLAGS="$CFLAGS_O3 -fPIC" +CXXFLAGS="$CXXFLAGS_O3 -fPIC" # Work around a bug in GCC 4.7.0 which breaks the build on Itanium CPUs with # '-O3', '-O2' and '-O1' (cf. #12765, #12751, and the bug URL below.) diff --git a/build/pkgs/zn_poly/spkg-install.in b/build/pkgs/zn_poly/spkg-install.in index c937e6a0903..6215a2416e0 100644 --- a/build/pkgs/zn_poly/spkg-install.in +++ b/build/pkgs/zn_poly/spkg-install.in @@ -2,14 +2,8 @@ # Set up environment variables: ############################################################################### -if [ "$SAGE_DEBUG" = yes ]; then - echo >&2 "Warning: Setting SAGE_DEBUG to 'yes' completely disables optimization." - CFLAGS="-O0 -g $CFLAGS -fPIC" - CXXFLAGS="-O0 -g $CXXFLAGS -fPIC" -else - CFLAGS="-O3 -g $CFLAGS -fPIC" - CXXFLAGS="-O3 -g $CXXFLAGS -fPIC" -fi +CFLAGS="$CFLAGS_O3 -fPIC" +CXXFLAGS="$CXXFLAGS_O3 -fPIC" export CFLAGS CPPFLAGS CXXFLAGS LDFLAGS # Partially redundant, but safe. diff --git a/build/pkgs/zope_interface/SPKG.rst b/build/pkgs/zope_interface/SPKG.rst deleted file mode 100644 index 19310888c32..00000000000 --- a/build/pkgs/zope_interface/SPKG.rst +++ /dev/null @@ -1,16 +0,0 @@ -zope.interface -============== - -Description ------------ - -This package is intended to be independently reusable in any Python -project. It is maintained by the Zope Toolkit project. - -This package provides an implementation of "object interfaces" for -Python. Interfaces are a mechanism for labeling objects as conforming to -a given API or contract. So, this package can be considered as -implementation of the Design By Contract methodology support in Python. - -For detailed documentation, please see -http://docs.zope.org/zope.interface diff --git a/build/pkgs/zope_interface/dependencies b/build/pkgs/zope_interface/dependencies deleted file mode 100644 index 15df0c4d6d8..00000000000 --- a/build/pkgs/zope_interface/dependencies +++ /dev/null @@ -1,5 +0,0 @@ -$(PYTHON) | $(PYTHON_TOOLCHAIN) - ----------- -All lines of this file are ignored except the first. -It is copied by SAGE_ROOT/build/make/install into SAGE_ROOT/build/make/Makefile. diff --git a/build/pkgs/zope_interface/distros/conda.txt b/build/pkgs/zope_interface/distros/conda.txt deleted file mode 100644 index 4172f5b18e9..00000000000 --- a/build/pkgs/zope_interface/distros/conda.txt +++ /dev/null @@ -1 +0,0 @@ -zope.interface diff --git a/build/pkgs/zope_interface/spkg-install b/build/pkgs/zope_interface/spkg-install deleted file mode 100755 index d37ec11bc29..00000000000 --- a/build/pkgs/zope_interface/spkg-install +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/sh -echo Installation of zope_interface is disabled, as a preparation for removal diff --git a/build/pkgs/zope_interface/spkg-install.in b/build/pkgs/zope_interface/spkg-install.in deleted file mode 100644 index 9e34dd1f6d2..00000000000 --- a/build/pkgs/zope_interface/spkg-install.in +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env bash -echo Installation of zope_interface is disabled, as a preparation for removal diff --git a/build/sage_bootstrap/app.py b/build/sage_bootstrap/app.py index 52bc896d9f3..e842e074408 100644 --- a/build/sage_bootstrap/app.py +++ b/build/sage_bootstrap/app.py @@ -185,7 +185,7 @@ def upload(self, package_name): """ package = Package(package_name) if not os.path.exists(package.tarball.upstream_fqn): - log.debug('Skipping %s because there is no local tarbal', package_name) + log.debug('Skipping %s because there is no local tarball', package_name) return log.info('Uploading %s', package.tarball.upstream_fqn) fs = FileServer() @@ -230,13 +230,44 @@ def fix_checksum(self, package_name): print('Updating checksum of {0} (tarball {1})'.format(package_name, pkg.tarball_filename)) update.fix_checksum() - def create(self, package_name, version, tarball, pkg_type, upstream_url): + def create(self, package_name, version=None, tarball=None, pkg_type=None, upstream_url=None, + description=None, license=None, upstream_contact=None, pypi=False, source='normal'): + """ + Create a normal package + """ + if '-' in package_name: + raise ValueError('package names must not contain dashes, use underscore instead') + if pypi: + pypi_version = PyPiVersion(package_name) + if source == 'normal': + if not tarball: + # Guess the general format of the tarball name. + tarball = pypi_version.tarball.replace(pypi_version.version, 'VERSION') + if not version: + version = pypi_version.version + # Use a URL from pypi.io instead of the specific URL received from the PyPI query + # because it follows a simple pattern. + upstream_url = 'https://pypi.io/packages/source/{0:1.1}/{0}/{1}'.format(package_name, tarball) + if not description: + description = pypi_version.summary + if not license: + license = pypi_version.license + if not upstream_contact: + upstream_contact = pypi_version.package_url + if tarball and not pkg_type: + # If we set a tarball, also make sure to create a "type" file, + # so that subsequent operations (downloading of tarballs) work. + pkg_type = 'optional' log.debug('Creating %s: %s, %s, %s', package_name, version, tarball, pkg_type) creator = PackageCreator(package_name) if version: creator.set_version(version) if pkg_type: creator.set_type(pkg_type) + if description or license or upstream_contact: + creator.set_description(description, license, upstream_contact) + if pypi or source == 'pip': + creator.set_python_data_and_scripts(pypi_package_name=pypi_version.name, source=source) if tarball: creator.set_tarball(tarball, upstream_url) if upstream_url and version: diff --git a/build/sage_bootstrap/cmdline.py b/build/sage_bootstrap/cmdline.py index 7123eff0818..8ba2772c731 100644 --- a/build/sage_bootstrap/cmdline.py +++ b/build/sage_bootstrap/cmdline.py @@ -283,6 +283,8 @@ def make_parser(): parser_create.add_argument( 'package_name', default=None, type=str, help='Package name.') + parser_create.add_argument( + '--source', type=str, default='normal', help='Package source (one of normal, script, pip)') parser_create.add_argument( '--version', type=str, default=None, help='Package version') parser_create.add_argument( @@ -291,6 +293,15 @@ def make_parser(): '--type', type=str, default=None, help='Package type') parser_create.add_argument( '--url', type=str, default=None, help='Download URL pattern, e.g. http://example.org/Foo-VERSION.tar.bz2') + parser_create.add_argument( + '--description', type=str, default=None, help='Short description of the package (for SPKG.rst)') + parser_create.add_argument( + '--license', type=str, default=None, help='License of the package (for SPKG.rst)') + parser_create.add_argument( + '--upstream-contact', type=str, default=None, help='Upstream contact (for SPKG.rst)') + parser_create.add_argument( + '--pypi', action="store_true", + help='Create a package for a Python package available on PyPI') return parser @@ -327,7 +338,9 @@ def run(): elif args.subcommand == 'download': app.download_cls(args.package_name, args.allow_upstream) elif args.subcommand == 'create': - app.create(args.package_name, args.version, args.tarball, args.type, args.url) + app.create(args.package_name, args.version, args.tarball, args.type, args.url, + args.description, args.license, args.upstream_contact, + pypi=args.pypi, source=args.source) elif args.subcommand == 'upload': app.upload_cls(args.package_name) elif args.subcommand == 'fix-checksum': diff --git a/build/sage_bootstrap/creator.py b/build/sage_bootstrap/creator.py index ec89a5de769..5e101979cca 100644 --- a/build/sage_bootstrap/creator.py +++ b/build/sage_bootstrap/creator.py @@ -59,4 +59,47 @@ def set_tarball(self, tarball, upstream_url): f.write('upstream_url={0}'.format(upstream_url)) f.write('\n') - + def set_description(self, description, license, upstream_contact): + """ + Write the ``SPKG.rst`` file + """ + with open(os.path.join(self.path, 'SPKG.rst'), 'w+') as f: + def heading(title, char='-'): + return '{0}\n{1}\n\n'.format(title, char * len(title)) + f.write(heading(self.package_name, '=')) + f.write(heading('Description')) + if description: + f.write('{0}\n\n'.format(description)) + f.write(heading('License')) + if license: + f.write('{0}\n\n'.format(license)) + f.write(heading('Upstream Contact')) + if upstream_contact: + f.write('{0}\n\n'.format(upstream_contact)) + + def set_python_data_and_scripts(self, pypi_package_name=None, source='normal'): + """ + Write the file ``dependencies`` and other files for Python packages. + + If ``source`` is ``"normal"``, write the files ``spkg-install.in`` and + ``install-requires.txt``. + + If ``source`` is ``"pip"``, write the file ``requirements.txt``. + """ + if pypi_package_name is None: + pypi_package_name = self.package_name + with open(os.path.join(self.path, 'dependencies'), 'w+') as f: + f.write('$(PYTHON) | $(PYTHON_TOOLCHAIN)\n\n') + f.write('----------\nAll lines of this file are ignored except the first.\n') + if source == 'normal': + with open(os.path.join(self.path, 'spkg-install.in'), 'w+') as f: + f.write('cd src\nsdh_pip_install .\n') + with open(os.path.join(self.path, 'install-requires.txt'), 'w+') as f: + f.write('{0}\n'.format(pypi_package_name)) + elif source == 'pip': + with open(os.path.join(self.path, 'requirements.txt'), 'w+') as f: + f.write('{0}\n'.format(pypi_package_name)) + elif source == 'script': + pass + else: + raise ValueError('package source must be one of normal, script, or pip') diff --git a/build/sage_bootstrap/pypi.py b/build/sage_bootstrap/pypi.py index 7b17df3a58e..88bcdfcf3d7 100644 --- a/build/sage_bootstrap/pypi.py +++ b/build/sage_bootstrap/pypi.py @@ -37,6 +37,8 @@ class PyPiVersion(object): def __init__(self, package_name): self.name = package_name self.json = self._get_json() + # Replace provided name with the canonical name + self.name = self.json['info']['name'] def _get_json(self): response = urllib.urlopen(self.json_url) @@ -66,7 +68,38 @@ def url(self): if download['python_version'] == 'source': return download['url'] raise PyPiError('No source url for %s found', self.name) - + + @property + def tarball(self): + """ + Return the source tarball name + """ + for download in self.json['urls']: + if download['python_version'] == 'source': + return download['filename'] + raise PyPiError('No source url for %s found', self.name) + + @property + def package_url(self): + """ + Return the package URL + """ + return self.json['info']['package_url'] + + @property + def license(self): + """ + Return the package license + """ + return self.json['info']['license'] + + @property + def summary(self): + """ + Return the package summary + """ + return self.json['info']['summary'] + def update(self): package = Package(self.name) if package.version == self.version: diff --git a/configure.ac b/configure.ac index 45ac12a2d29..0b08147723f 100644 --- a/configure.ac +++ b/configure.ac @@ -85,6 +85,22 @@ if test "$enable_build_as_root" != yes; then AX_CHECK_ROOT([AC_MSG_ERROR([You cannot build Sage as root, switch to an unprivileged user. (If building in a container, use --enable-build-as-root.)])], []) fi +AC_ARG_ENABLE([fat-binary], + [AS_HELP_STRING([--enable-fat-binary], + [build binaries that will run on the widest range of target CPUs (but not relocatable)])], + [AC_SUBST(SAGE_FAT_BINARY, "yes")], + []) + +AC_ARG_VAR(SAGE_FAT_BINARY, set to "yes" to build binaries that will run on the widest range of target CPUs (but not relocatable)) + +AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug={no|symbols|yes}], + [controls debugging support: "no" debugging; debugging "symbols" (default); build debug version ("yes")])], + [AC_SUBST(SAGE_DEBUG, $enableval)], + []) + +AC_ARG_VAR(SAGE_DEBUG, controls debugging support: "no" debugging; debugging "symbols" (default); build debug version ("yes")) + # Check whether we are on a supported platform AC_CANONICAL_BUILD() AC_CANONICAL_HOST() @@ -300,6 +316,17 @@ AX_PROG_PERL_VERSION([5.8.0],[],[ # Check C/C++/Fortran compilers ############################################################################### +# Save compiler flags as configured by the user. +# We have to redo this, because otherwise `AC_PROG_CC` will just overwrite them. +AC_SUBST(CFLAGS, "$CFLAGS") +AC_SUBST(CXXFLAGS, "$CXXFLAGS") +AC_SUBST(FCFLAGS, "$FCFLAGS") +AC_SUBST(F77FLAGS, "$F77FLAGS") +AC_ARG_VAR(CFLAGS, C compiler flags) +AC_ARG_VAR(CXXFLAGS, C compiler flags) +AC_ARG_VAR(FCFLAGS, Fortran compiler flags) +AC_ARG_VAR(F77CFLAGS, Fortran 77 compiler flags) + SAGE_CHECK_CONDA_COMPILERS AC_PROG_CC() @@ -393,7 +420,7 @@ SAGE_SPKG_COLLECT() dnl AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([build/make/Makefile-auto build/make/Makefile]) -AC_CONFIG_FILES([src/bin/sage-env-config build/bin/sage-build-env-config]) +AC_CONFIG_FILES([src/bin/sage-env-config src/bin/sage-src-env-config build/bin/sage-build-env-config]) AC_CONFIG_FILES([build/pkgs/sage_conf/src/sage_conf.py build/pkgs/sage_conf/src/setup.cfg]) diff --git a/src/.codespell-ignore.txt b/src/.codespell-ignore.txt index 270d2da903d..c59e9833dae 100644 --- a/src/.codespell-ignore.txt +++ b/src/.codespell-ignore.txt @@ -1,2 +1,3 @@ Hart PRing +ans diff --git a/src/bin/sage b/src/bin/sage index 768889bb01f..95b48e5ffbd 100755 --- a/src/bin/sage +++ b/src/bin/sage @@ -58,6 +58,25 @@ usage() { # 'usage_advanced', which prints a longer help message, is defined # below, after sourcing sage-env. +# Determine SAGE_ROOT and SAGE_LOCAL. +if [ -x "$0-config" ]; then + # optional sage-config console script, installed by sage_conf + export SAGE_ROOT=$("$0-config" SAGE_ROOT) + export SAGE_LOCAL=$("$0-config" SAGE_LOCAL) +fi +if [ -f "$0-src-env-config" ]; then + # Not installed script, present only in src/bin/ + . "$0-src-env-config" >&2 +fi +if [ -x "$0-venv-config" ]; then + # installed by setup.py + export SAGE_VENV=$("$0-venv-config" SAGE_VENV) +fi +if [ -f "$0-env-config" ]; then + # As of Trac #22731, sage-env-config is optional. + . "$0-env-config" >&2 +fi + ##################################################################### # Special options to be processed without sage-env ##################################################################### @@ -188,10 +207,6 @@ fi # append -env to that). We redirect stdout to stderr, which is safer # for scripts. ##################################################################### -if [ -f "$0-env-config" ]; then - # As of Trac #22731, sage-env-config is optional. - . "$0-env-config" >&2 -fi if [ -f "$0-env" ]; then . "$0-env" >&2 if [ $? -ne 0 ]; then @@ -635,9 +650,11 @@ if [ "$1" = '-sh' -o "$1" = '--sh' -o "$1" = '-buildsh' -o "$1" = '--buildsh' ]; exit 1 fi . "$SAGE_ROOT"/build/bin/sage-build-env-config || (echo "error: Error sourcing $SAGE_ROOT/build/bin/sage-build-env-config"; exit 1) + . "$SAGE_ROOT"/build/bin/sage-build-env || (echo "error: Error sourcing $SAGE_ROOT/build/bin/sage-build-env"; exit 1) export SAGE_SHPROMPT_PREFIX=sage-buildsh # We export it so that recursive invocation of 'sage-sh' from a sage-buildsh shows the sage-buildsh prompt; - # this makes sense because all environment variables set in build/bin/sage-build-env-config are exported. + # this makes sense because all environment variables set in build/bin/sage-build-env-config + # and build/bin/sage-build-env are exported. fi shift # If $SHELL is unset, default to bash diff --git a/src/bin/sage-env b/src/bin/sage-env index 3767cf60794..c468e62181b 100644 --- a/src/bin/sage-env +++ b/src/bin/sage-env @@ -166,7 +166,7 @@ fi if [ -z "$CC" ]; then if [ -n "$SAGE_LOCAL" -a -x "$SAGE_LOCAL/bin/gcc" ]; then CC=gcc - else + elif [ -n "$CONFIGURED_CC" ]; then CC="$CONFIGURED_CC" fi export CC @@ -174,7 +174,7 @@ fi if [ -z "$CXX" ]; then if [ -n "$SAGE_LOCAL" -a -x "$SAGE_LOCAL/bin/g++" ]; then CXX=g++ - else + elif [ -n "$CONFIGURED_CXX" ]; then CXX="$CONFIGURED_CXX" fi export CXX @@ -182,7 +182,7 @@ fi if [ -z "$FC" ]; then if [ -n "$SAGE_LOCAL" -a -x "$SAGE_LOCAL/bin/gfortran" ]; then FC=gfortran - else + elif [ -n "$CONFIGURED_FC" ]; then FC="$CONFIGURED_FC" fi export FC @@ -280,6 +280,9 @@ fi if [ -n "$SAGE_LOCAL" ]; then export PATH="$SAGE_LOCAL/bin:$PATH" fi +if [ -n "$SAGE_VENV" ]; then + export PATH="$SAGE_VENV/bin:$PATH" +fi if [ -n "$SAGE_SRC" ]; then export PATH="$SAGE_SRC/bin:$PATH" fi diff --git a/src/bin/sage-env-config.in b/src/bin/sage-env-config.in index be8421706f7..299eea7e394 100644 --- a/src/bin/sage-env-config.in +++ b/src/bin/sage-env-config.in @@ -17,7 +17,7 @@ # file. # - Environment variables that are only needed at the time of building # SPKGs or sagelib should be set in build/bin/sage-build-env-config -# instead. +# or build/bin/sage-build-env instead. # - Configuration variables that are only needed by the Sage runtime, # but not as environment variables, should instead be set in # build/pkgs/sage_conf/src/sage_conf.py diff --git a/src/bin/sage-src-env-config.in b/src/bin/sage-src-env-config.in new file mode 100644 index 00000000000..b9e8692f68f --- /dev/null +++ b/src/bin/sage-src-env-config.in @@ -0,0 +1,39 @@ +# -*- shell-script -*- @configure_input@ + +########################################################################### +# +# Set some environment variables that are needed at the runtime of Sage +# and by its child processes. +# +# This file is only for use when sage is invoked from SAGE_ROOT. +# It is not installed in SAGE_LOCAL. +# +# NOTES: +# - You must *source* this script instead of executing. +# - Use "return" instead of "exit" to signal a failure. Since this +# file is sourced, an "exit" here will actually exit src/bin/sage, +# which is probably not intended. +# - Environment variables that should be available in the Sage environment +# should be exported. +# - This file is only for setting immediate values. Any kind of conditionals +# or computed values are to be set by src/bin/sage-env after sourcing this +# file. +# - Environment variables that are only needed at the time of building +# SPKGs or sagelib should be set in build/bin/sage-build-env-config +# instead. +# - Configuration variables that are only needed by the Sage runtime, +# but not as environment variables, should instead be set in +# build/pkgs/sage_conf/src/sage_conf.py +# +########################################################################## + +# SAGE_LOCAL is the installation prefix and can be customized by using +# ./configure --prefix +export SAGE_LOCAL="@prefix@" + +# SAGE_VENV is the root of the virtual environment of sagelib. +# Currently, it is identical to SAGE_LOCAL +export SAGE_VENV="@prefix@" + +# SAGE_ROOT is the location of the Sage source/build tree. +export SAGE_ROOT="@SAGE_ROOT@" diff --git a/src/bin/sage-venv-config b/src/bin/sage-venv-config new file mode 100644 index 00000000000..ead8588f8aa --- /dev/null +++ b/src/bin/sage-venv-config @@ -0,0 +1,29 @@ +#! /doesnotexist/python3 +# this interpreter will be replaced by the interpreter in the venv +# during installation. + +try: + from sage_conf import * +except ImportError: + pass + +from sys import prefix as SAGE_VENV + +def _main(): + from argparse import ArgumentParser + from sys import exit, stdout + parser = ArgumentParser() + parser.add_argument('--version', help="show version", action="version", + version='%(prog)s ' + VERSION) + parser.add_argument("VARIABLE", nargs='?', help="output the value of VARIABLE") + args = parser.parse_args() + d = globals() + if args.VARIABLE: + stdout.write('{}\n'.format(d[args.VARIABLE])) + else: + for k, v in d.items(): + if not k.startswith('_'): + stdout.write('{}={}\n'.format(k, v)) + +if __name__ == "__main__": + _main() diff --git a/src/bin/sage-version.sh b/src/bin/sage-version.sh index 041e98ab5d0..8a835d95f5f 100644 --- a/src/bin/sage-version.sh +++ b/src/bin/sage-version.sh @@ -1,5 +1,5 @@ # Sage version information for shell scripts # This file is auto-generated by the sage-update-version script, do not edit! -SAGE_VERSION='9.3.beta3' -SAGE_RELEASE_DATE='2020-12-06' -SAGE_VERSION_BANNER='SageMath version 9.3.beta3, Release Date: 2020-12-06' +SAGE_VERSION='9.3.beta4' +SAGE_RELEASE_DATE='2020-12-14' +SAGE_VERSION_BANNER='SageMath version 9.3.beta4, Release Date: 2020-12-14' diff --git a/src/doc/en/developer/packaging.rst b/src/doc/en/developer/packaging.rst index 6ed9541ed49..dc18e37eecf 100644 --- a/src/doc/en/developer/packaging.rst +++ b/src/doc/en/developer/packaging.rst @@ -251,6 +251,24 @@ something like the following to install it: sdh_install doc/ "$SAGE_SHARE"/doc/PACKAGE_NAME fi +At build time :envvar:`CFLAGS`, :envvar:`CXXFLAGS`, :envvar:`FCFLAGS`, +and :envvar:`F77FLAGS` are usually set to ``-g -O2`` +(according to `debugging options <../installation/source.html#sage-debug>`_ +and whether building +`fat binaries <../installation/source.html#sage-fat-binary>`_). + +Slightly modified versions are available: + +.. CODE-BLOCK:: bash + + # ``-O3`` instead of ``-O2``. + export CFLAGS=$CFLAGS_O3 + + # Use flags as set by the user, possibly empty. + export CFLAGS=$ORIGINAL_CFLAGS + +Likewise for :envvar:`CXXFLAGS`, :envvar:`FCFLAGS`, and :envvar:`F77FLAGS`. + .. note:: Prior to Sage 9.1, the script templates were called ``spkg-build``, @@ -311,8 +329,8 @@ It needs to be an executable shell script; it is not subject to the templating described in the previous section. Sage runs ``spkg-install`` from the directory ``$SAGE_ROOT/build/pkgs/`` -in the environment obtained by sourcing the files ``src/bin/sage-env`` and -``build/bin/sage-build-env-config``. +in the environment obtained by sourcing the files ``src/bin/sage-env``, +``build/bin/sage-build-env-config``, and ``build/bin/sage-build-env``. .. _section-sdh-helpers: @@ -371,6 +389,10 @@ begin with ``sdh_``, which stands for "Sage-distribution helper". arguments. If ``$SAGE_DESTDIR`` is not set then the command is run with ``$SAGE_SUDO``, if set. +- ``sdh_setup_bdist_wheel [...]``: Runs ``setup.py bdist_wheel`` with + the given arguments, as well as additional default arguments used for + installing packages into Sage. + - ``sdh_pip_install [...]``: The equivalent of running ``pip install`` with the given arguments, as well as additional default arguments used for installing packages into Sage with pip. The last argument must be @@ -687,7 +709,7 @@ For example, considering the layout: SAGE_ROOT/build/pkgs/foo |-- patches | |-- solaris - | | |-- solaris.patch + | | |-- solaris.patch | |-- bar.patch | `-- baz.patch @@ -742,7 +764,7 @@ When to patch, when to repackage, when to autoconfiscate - If the upstream Makefile does not build shared libraries, don't bother trying to patch it. - + Autoconfiscate the package instead and use the standard facilities of Automake and Libtool. This ensures that the shared library build is portable between Linux and macOS. @@ -786,7 +808,7 @@ We recommend the following workflow for maintaining a set of patches. rm -Rf SAGE_ROOT/build/pkgs/PACKAGE/patches mkdir SAGE_ROOT/build/pkgs/PACKAGE/patches git format-patch -o SAGE_ROOT/build/pkgs/PACKAGE/patches/ upstream - + - Optionally, create an ``spkg-src`` file in the Sage package's directory that regenerates the patch directory using the above commands. @@ -939,6 +961,20 @@ You can skip the manual downloading of the upstream tarball by using the additional argument ``--upstream-url``. This command will also set the ``upstream_url`` field in ``checksums.ini`` described above. +For Python packages available from PyPI, you can use:: + + [user@localhost]$ sage -package create scikit_spatial --pypi --type optional + +This automatically downloads the most recent version from PyPI and also +obtains most of the necessary information by querying PyPI. +The ``dependencies`` file may need editing, and also you may want to set +lower and upper bounds for acceptable package versions in the file +``install-requires.txt``. + +To create a pip package rather than a normal package, you can use:: + + [user@localhost]$ sage -package create scikit_spatial --pypi --source pip --type optional + .. _section-manual-build: diff --git a/src/doc/en/installation/source.rst b/src/doc/en/installation/source.rst index 1b28af7e02f..d2b127b6942 100644 --- a/src/doc/en/installation/source.rst +++ b/src/doc/en/installation/source.rst @@ -1178,7 +1178,9 @@ Here are some of the more commonly used variables affecting the build process: building ccache for Sage, so that Sage can pull down the necessary sources. -- :envvar:`SAGE_DEBUG` - controls debugging support. +- .. _sage_debug: + + :envvar:`SAGE_DEBUG` - controls debugging support. There are three different possible values: * Not set (or set to anything else than "yes" or "no"): build binaries with @@ -1195,6 +1197,9 @@ Here are some of the more commonly used variables affecting the build process: These will be notably slower but, for example, make it much easier to pinpoint memory allocation problems. + Instead of using :envvar:`SAGE_DEBUG` one can configure with + ``--enable-debug={no|symbols|yes}``. + - :envvar:`SAGE_PROFILE` - controls profiling support. If this is set to ``yes``, profiling support is enabled where possible. Note that Python-level profiling is always available; This option enables @@ -1283,9 +1288,12 @@ Here are some of the more commonly used variables affecting the build process: So you can set this variable to ``yes`` instead of using the ``-s`` flag for ``sage -i`` and ``sage -f``. -- :envvar:`SAGE_FAT_BINARY` - to build binaries that will run on the +- .. _sage_fat_binary: + + :envvar:`SAGE_FAT_BINARY` - to build binaries that will run on the widest range of target CPUs set this variable to ``yes`` before - building Sage. This does not make the binaries relocatable, it only + building Sage or configure with ``--enable-fat-binary``. + This does not make the binaries relocatable, it only avoids newer CPU instruction set extensions. For relocatable (=can be moved to a different directory) binaries, you must use https://github.com/sagemath/binary-pkg diff --git a/src/doc/en/reference/plot3d/threejs.rst b/src/doc/en/reference/plot3d/threejs.rst index 1234ecc41db..388ed735989 100644 --- a/src/doc/en/reference/plot3d/threejs.rst +++ b/src/doc/en/reference/plot3d/threejs.rst @@ -34,6 +34,11 @@ Options currently supported by the viewer: - ``axes_labels`` -- (default: ['x','y','z']) list or tuple of three strings; set to False to remove all labels +- ``axes_labels_style`` -- (default: None) list of three dicts, one per axis, or + a single dict controlling all three axes; supports the same styling options as + :func:`~sage.plot.plot3d.shapes2.text3d` such as ``color``, ``opacity``, ``fontsize``, + ``fontweight``, ``fontstyle``, and ``fontfamily`` + - ``color`` -- (default: 'blue') color of the 3D object - ``decimals`` -- (default: 2) integer determining decimals displayed in labels @@ -45,6 +50,9 @@ Options currently supported by the viewer: - ``opacity`` -- (default: 1) numeric value for transparency of lines and surfaces +- ``page_title`` -- (default: None) string containing the title of the generated HTML page; often + displayed in the browser window's title bar, its tab list, and/or the operating system's task bar + - ``projection`` -- (default: 'perspective') the type of camera projection to use; 'perspective' or 'orthographic' diff --git a/src/sage/algebras/free_zinbiel_algebra.py b/src/sage/algebras/free_zinbiel_algebra.py index 6c996ae84e6..c87c48b6c9a 100644 --- a/src/sage/algebras/free_zinbiel_algebra.py +++ b/src/sage/algebras/free_zinbiel_algebra.py @@ -47,6 +47,10 @@ class FreeZinbielAlgebra(CombinatorialFreeModule): [LV2012]_) as the Koszul dual to Leibniz algebras (hence the name coined by Lemaire). + By default, the convention above is used. The opposite product, + which satisfy the opposite axiom, can be used instead by setting + the ``side`` parameter to ``'>'`` instead of the default value ``'<'``. + Zinbiel algebras are divided power algebras, in that for .. MATH:: @@ -140,8 +144,17 @@ class FreeZinbielAlgebra(CombinatorialFreeModule): sage: (((x*x)*x)*x)*x 24*Z[xxxxx] + A few tests with the opposite convention for the product:: + + sage: Z. = algebras.FreeZinbiel(QQ, side='>') + sage: (x*y)*z + Z[xyz] + sage: x*(y*z) + Z[xyz] + Z[yxz] + TESTS:: + sage: Z. = algebras.FreeZinbiel(QQ) sage: Z.basis().keys() Finite words over {'x', 'y', 'z'} @@ -159,7 +172,8 @@ class FreeZinbielAlgebra(CombinatorialFreeModule): - [LV2012]_ """ @staticmethod - def __classcall_private__(cls, R, n=None, names=None, prefix=None): + def __classcall_private__(cls, R, n=None, names=None, + prefix=None, side=None): """ Standardize input to ensure a unique representation. @@ -193,12 +207,16 @@ def __classcall_private__(cls, R, n=None, names=None, prefix=None): raise TypeError("argument R must be a ring") if prefix is None: prefix = 'Z' + if side is None: + side = '<' + if side not in ['<', '>']: + raise ValueError("side must be either '<' or '>'") superclass = super(FreeZinbielAlgebra, cls) if names is None: - return superclass.__classcall__(cls, R, n, None, prefix) - return superclass.__classcall__(cls, R, n, tuple(names), prefix) + return superclass.__classcall__(cls, R, n, None, prefix, side) + return superclass.__classcall__(cls, R, n, tuple(names), prefix, side) - def __init__(self, R, n, names, prefix): + def __init__(self, R, n, names, prefix, side): """ Initialize ``self``. @@ -229,6 +247,11 @@ def __init__(self, R, n, names, prefix): else: indices = Words(Alphabet(n, names=names), infinite=False) self._n = n + self._side = side + if side == '<': + self.product_on_basis = self.product_on_basis_left + else: + self.product_on_basis = self.product_on_basis_right cat = MagmaticAlgebras(R).WithBasis().Graded() cat &= CoalgebrasWithBasis(R) CombinatorialFreeModule.__init__(self, R, indices, prefix=prefix, @@ -268,6 +291,20 @@ def _repr_(self): return "Free Zinbiel algebra on generators {} over {}".format( self.gens(), self.base_ring()) + def side(self): + """ + Return the choice of side for the product. + + This is either ``'<'`` or ``'>'``. + + EXAMPLES:: + + sage: Z. = algebras.FreeZinbiel(QQ) + sage: Z.side() + '<' + """ + return self._side + @cached_method def algebra_generators(self): """ @@ -293,6 +330,8 @@ def change_ring(self, R): - ``R`` -- a ring + The same side convention is used for the product. + EXAMPLES:: sage: A = algebras.FreeZinbiel(ZZ, 'f,g,h') @@ -301,7 +340,7 @@ def change_ring(self, R): over Rational Field """ A = self.variable_names() - return FreeZinbielAlgebra(R, n=len(A), names=A) + return FreeZinbielAlgebra(R, n=len(A), names=A, side=self._side) @cached_method def gens(self): @@ -333,9 +372,12 @@ def degree_on_basis(self, t): """ return len(t) - def product_on_basis(self, x, y): + def product_on_basis_left(self, x, y): """ - Return the product of the basis elements indexed by ``x`` and ``y``. + Return the product < of the basis elements indexed by ``x`` and ``y``. + + This is one half of the shuffle product, where the first letter + comes from the first letter of the first argument. INPUT: @@ -358,6 +400,34 @@ def product_on_basis(self, x, y): x0 = self._indices([x[0]]) return self.sum_of_monomials(x0 + sh for sh in x[1:].shuffle(y)) + def product_on_basis_right(self, x, y): + """ + Return the product > of the basis elements indexed by ``x`` and ``y``. + + This is one half of the shuffle product, where the last letter + comes from the last letter of the second argument. + + INPUT: + + - ``x``, ``y`` -- two words + + EXAMPLES:: + + sage: Z. = algebras.FreeZinbiel(QQ, side='>') + sage: (x*y)*z # indirect doctest + Z[xyz] + + TESTS:: + + sage: Z. = algebras.FreeZinbiel(QQ, side='>') + sage: Z.product_on_basis(Word('x'), Word()) + Z[x] + """ + if not y: + return self.monomial(x) + yf = self._indices([y[-1]]) + return self.sum_of_monomials(sh + yf for sh in x.shuffle(y[:-1])) + def coproduct_on_basis(self, w): """ Return the coproduct of the element of the basis indexed by @@ -444,8 +514,15 @@ def _element_constructor_(self, x): except AttributeError: raise TypeError('not able to convert this to this algebra') if isinstance(P, FreeZinbielAlgebra) and self._coerce_map_from_(P): - return self.element_class(self, - x.monomial_coefficients(copy=False)) + if self._side == P._side: + return self.element_class(self, + x.monomial_coefficients(copy=False)) + else: + dic = x.monomial_coefficients(copy=False) + # canonical isomorphism when switching side + return self.element_class(self, + {w.reversal(): cf + for w, cf in dic.items()}) else: raise TypeError('not able to convert this to this algebra') # Ok, not a Zinbiel algebra element (or should not be viewed as one). @@ -523,8 +600,9 @@ def _coerce_map_from_(self, R): if isinstance(R, FreeZinbielAlgebra): if self._n is None or R._n is None: return False - return (all(x in self.variable_names() for x in R.variable_names()) - and self.base_ring().has_coerce_map_from(R.base_ring())) + return (all(x in self.variable_names() + for x in R.variable_names()) and + self.base_ring().has_coerce_map_from(R.base_ring())) return super(FreeZinbielAlgebra, self)._coerce_map_from_(R) def construction(self): @@ -550,7 +628,7 @@ def construction(self): A = self._indices.alphabet() else: A = self.variable_names() - return ZinbielFunctor(A), self.base_ring() + return ZinbielFunctor(A, side=self._side), self.base_ring() class ZinbielFunctor(ConstructionFunctor): @@ -575,24 +653,24 @@ class ZinbielFunctor(ConstructionFunctor): Generic endomorphism of Free Zinbiel algebra on generators (Z[x], Z[y]) over Multivariate Polynomial Ring in a, b over Finite Field of size 5 - sage: F(f)(a * F(A)(x)) (a+b)*Z[x] """ rank = 9 - def __init__(self, variables): + def __init__(self, variables, side): """ EXAMPLES:: sage: functor = sage.algebras.free_zinbiel_algebra.ZinbielFunctor - sage: F = functor(['x','y']); F + sage: F = functor(['x','y'], '<'); F Zinbiel[x,y] sage: F(ZZ) Free Zinbiel algebra on generators (Z[x], Z[y]) over Integer Ring """ Functor.__init__(self, Rings(), Magmas()) self.vars = variables + self._side = side self._finite_vars = bool(isinstance(variables, (list, tuple)) or variables in Sets().Finite()) def _apply_functor(self, R): @@ -617,8 +695,9 @@ def _apply_functor(self, R): Free Zinbiel algebra on generators indexed by Integer Ring over Integer Ring """ if self._finite_vars: - return FreeZinbielAlgebra(R, len(self.vars), self.vars) - return FreeZinbielAlgebra(R, self.vars) + return FreeZinbielAlgebra(R, len(self.vars), self.vars, + side=self._side) + return FreeZinbielAlgebra(R, self.vars, side=self._side) def _apply_functor_to_morphism(self, f): """ @@ -658,7 +737,7 @@ def __eq__(self, other): """ if not isinstance(other, ZinbielFunctor): return False - return self.vars == other.vars + return self.vars == other.vars and self._side == other._side def __hash__(self): """ @@ -681,14 +760,14 @@ def __mul__(self, other): EXAMPLES:: sage: from sage.algebras.free_zinbiel_algebra import ZinbielFunctor as functor - sage: F = functor(['x','y']) - sage: G = functor(['t']) + sage: F = functor(['x','y'], '<') + sage: G = functor(['t'], '<') sage: G * F Zinbiel[x,y,t] With an infinite generating set:: - sage: H = functor(ZZ) + sage: H = functor(ZZ, '<') sage: H * G Traceback (most recent call last): ... @@ -701,12 +780,14 @@ def __mul__(self, other): if isinstance(other, IdentityConstructionFunctor): return self if isinstance(other, ZinbielFunctor): + if self._side != other._side: + raise CoercionException("detection of distinct sides") if not self._finite_vars or not other._finite_vars: raise CoercionException("Unable to determine overlap for infinite sets") if set(self.vars).intersection(other.vars): raise CoercionException("Overlapping variables (%s,%s)" % (self.vars, other.vars)) - return ZinbielFunctor(other.vars + self.vars) + return ZinbielFunctor(other.vars + self.vars, self._side) elif (isinstance(other, CompositeConstructionFunctor) and isinstance(other.all[-1], ZinbielFunctor)): return CompositeConstructionFunctor(other.all[:-1], @@ -721,8 +802,8 @@ def merge(self, other): EXAMPLES:: sage: functor = sage.algebras.free_zinbiel_algebra.ZinbielFunctor - sage: F = functor(['x','y']) - sage: G = functor(['t']) + sage: F = functor(['x','y'], '<') + sage: G = functor(['t'], '<') sage: F.merge(G) Zinbiel[x,y,t] sage: F.merge(F) @@ -730,7 +811,7 @@ def merge(self, other): With an infinite generating set:: - sage: H = functor(ZZ) + sage: H = functor(ZZ, '<') sage: H.merge(H) is H True sage: H.merge(F) is None @@ -755,10 +836,28 @@ def merge(self, other): sage: parent(x * t) Free Zinbiel algebra on generators (Z[z], Z[t], Z[x], Z[y]) over Rational Field + + TESTS: + + Using the other side convention:: + + sage: F = functor(['x','y'], '>') + sage: G = functor(['t'], '>') + sage: H = functor(['t'], '<') + sage: F.merge(G) + Zinbiel[x,y,t] + sage: F.merge(H) + Traceback (most recent call last): + ... + TypeError: cannot merge free Zinbiel algebras with distinct sides """ if isinstance(other, ZinbielFunctor): + if self._side != other._side: + raise TypeError('cannot merge free Zinbiel algebras ' + 'with distinct sides') if self.vars == other.vars: return self + def check(x): return isinstance(x, (list, tuple)) or x in Sets().Finite() if not check(self.vars) or not check(other.vars): @@ -768,7 +867,7 @@ def check(x): for v in other.vars: if v not in cur_vars: ret.append(v) - return ZinbielFunctor(ret) + return ZinbielFunctor(ret, self._side) else: return None @@ -785,4 +884,3 @@ def _repr_(self): if self._finite_vars: return "Zinbiel[%s]" % ','.join(self.vars) return "Zinbiel[{}]".format(self.vars) - diff --git a/src/sage/categories/pushout.py b/src/sage/categories/pushout.py index 083dd1e3a83..2d4eb607f6b 100644 --- a/src/sage/categories/pushout.py +++ b/src/sage/categories/pushout.py @@ -1146,7 +1146,7 @@ def _repr_(self): class InfinitePolynomialFunctor(ConstructionFunctor): - """ + r""" A Construction Functor for Infinite Polynomial Rings (see :mod:`~sage.rings.polynomial.infinite_polynomial_ring`). AUTHOR: @@ -1187,7 +1187,7 @@ class InfinitePolynomialFunctor(ConstructionFunctor): ... CoercionException: Incompatible term orders lex, degrevlex - In an infinite polynomial ring with generator `a_\\ast`, the variable `a_3` will always be greater + In an infinite polynomial ring with generator `a_\ast`, the variable `a_3` will always be greater than the variable `a_1`. Hence, the orders are incompatible in the next example as well:: sage: A.construction()[0]*PolynomialRing(QQ,names=['x','y','a_1','a_3'], order='lex').construction()[0] @@ -1197,7 +1197,7 @@ class InfinitePolynomialFunctor(ConstructionFunctor): Another requirement is that after merging the order of the remaining variables must be unique. This is not the case in the following example, since it is not clear whether the variables `x,y` - should be greater or smaller than the variables `b_\\ast`:: + should be greater or smaller than the variables `b_\ast`:: sage: A.construction()[0]*PolynomialRing(QQ,names=['a_3','a_1','x','y'], order='lex').construction()[0] Traceback (most recent call last): @@ -1215,7 +1215,7 @@ class InfinitePolynomialFunctor(ConstructionFunctor): sage: X. = InfinitePolynomialRing(ZZ) sage: Y. = InfinitePolynomialRing(QQ) - `X` and `Y` have an overlapping generators `x_\\ast, y_\\ast`. Since the default lexicographic order is + `X` and `Y` have an overlapping generators `x_\ast, y_\ast`. Since the default lexicographic order is used in both rings, it gives rise to isomorphic sub-monoids in both `X` and `Y`. They are merged in the pushout, which also yields a common parent for doing arithmetic:: diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py index e81beda52ec..1ce16fce5df 100644 --- a/src/sage/coding/linear_code.py +++ b/src/sage/coding/linear_code.py @@ -478,17 +478,17 @@ def automorphism_group_gens(self, equivalence="semilinear"): 0 sage: C = codes.HammingCode(GF(4, 'z'), 3) sage: C.automorphism_group_gens() - ([((1, z, z + 1, z, z, 1, 1, z, z + 1, z, z, 1, z, z + 1, z, z, 1, z, z + 1, z, z); (1,5,18,7,11,8)(2,12,21)(3,20,14,10,19,15)(4,9)(13,17,16), Ring endomorphism of Finite Field in z of size 2^2 - Defn: z |--> z + 1), - ((1, 1, z, z + 1, z, z, z + 1, z + 1, z, 1, 1, z, z, z + 1, z + 1, 1, z, z, 1, z, z + 1); (2,11)(3,13)(4,14)(5,20)(6,17)(8,15)(16,19), Ring endomorphism of Finite Field in z of size 2^2 + ([((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2 Defn: z |--> z + 1), + ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2 + Defn: z |--> z), ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2 Defn: z |--> z)], 362880) sage: C.automorphism_group_gens(equivalence="linear") - ([((z, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, 1, 1, z, z, z + 1, z); (1,6)(2,20,9,16)(3,10,8,11)(4,15,21,5)(12,17)(13,14,19,18), Ring endomorphism of Finite Field in z of size 2^2 + ([((z + 1, 1, z + 1, z + 1, z + 1, z, 1, z, 1, 1, 1, 1, z + 1, z + 1, z + 1, z, z, 1, z, z, z); (1,15,2,8,16,18,3)(4,9,12,13,20,10,11)(5,21,14,6,7,19,17), Ring endomorphism of Finite Field in z of size 2^2 Defn: z |--> z), - ((1, z, z + 1, z, z, z, z + 1, z + 1, 1, z, z, z, 1, z, 1, z + 1, z, z + 1, z, z + 1, 1); (1,15,20,5,8,6,12,14,13,7,16,11,19,3,21,4,9,10,18,17,2), Ring endomorphism of Finite Field in z of size 2^2 + ((z + 1, z + 1, z + 1, z + 1, z + 1, 1, z, 1, z, z, z, 1, z, 1, 1, 1, z + 1, z + 1, z + 1, 1, z); (1,15,21,8,9)(2,18,5,3,11,16,7,10,19,13,12,4,17,6,20), Ring endomorphism of Finite Field in z of size 2^2 Defn: z |--> z), ((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2 Defn: z |--> z)], @@ -704,10 +704,10 @@ def _canonize(self, equivalence): sage: C_iso == aut_group_can_label.get_canonical_form() True sage: aut_group_can_label.get_autom_gens() - [((1, z, z + 1, z, z, 1, 1, z, z + 1, z, z, 1, z, z + 1, z, z, 1, z, z + 1, z, z); (1,5,18,7,11,8)(2,12,21)(3,20,14,10,19,15)(4,9)(13,17,16), Ring endomorphism of Finite Field in z of size 2^2 - Defn: z |--> z + 1), - ((1, 1, z, z + 1, z, z, z + 1, z + 1, z, 1, 1, z, z, z + 1, z + 1, 1, z, z, 1, z, z + 1); (2,11)(3,13)(4,14)(5,20)(6,17)(8,15)(16,19), Ring endomorphism of Finite Field in z of size 2^2 + [((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2 Defn: z |--> z + 1), + ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2 + Defn: z |--> z), ((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2 Defn: z |--> z)] """ diff --git a/src/sage/combinat/affine_permutation.py b/src/sage/combinat/affine_permutation.py index 5da8030f454..114895b417c 100644 --- a/src/sage/combinat/affine_permutation.py +++ b/src/sage/combinat/affine_permutation.py @@ -28,9 +28,10 @@ from sage.combinat.composition import Composition from sage.combinat.partition import Partition + class AffinePermutation(ClonableArray): r""" - An affine permutation, representated in the window notation, and + An affine permutation, represented in the window notation, and considered as a bijection from `\ZZ` to `\ZZ`. EXAMPLES:: diff --git a/src/sage/combinat/blob_algebra.py b/src/sage/combinat/blob_algebra.py index 00d3376306f..6bd3dba1747 100644 --- a/src/sage/combinat/blob_algebra.py +++ b/src/sage/combinat/blob_algebra.py @@ -279,7 +279,7 @@ def __contains__(self, X): Traceback (most recent call last): ... ValueError: not a blob diagram of order 4 - sage: BD4([[3,-3]], [[1,-1],[2,-2],[4,-4]]) # trapped propogating line + sage: BD4([[3,-3]], [[1,-1],[2,-2],[4,-4]]) # trapped propagating line Traceback (most recent call last): ... ValueError: not a blob diagram of order 4 @@ -297,7 +297,7 @@ def __contains__(self, X): if P[1] < 0: # P is a cap continue if P[1] < x: - if P[0] < 0: # A propogating line to the left + if P[0] < 0: # A propagating line to the left return False else: # Note that P[1] != x if 0 < P[0] < x: # A nesting line @@ -307,12 +307,12 @@ def __contains__(self, X): if P[0] > 0: # P is a cup continue if P[0] > y: - if P[1] > 0: # A propogating line to the left + if P[1] > 0: # A propagating line to the left return False else: # Note that P[0] != y if 0 > P[1] > y: # A nesting line return False - else: # Must be a propogating line + else: # Must be a propagating line if any(P[0] < 0 and P[1] > 0 and P[1] < y for P in TL): return False return True diff --git a/src/sage/combinat/cartesian_product.py b/src/sage/combinat/cartesian_product.py index 3d769c77bec..2f0c59ca668 100644 --- a/src/sage/combinat/cartesian_product.py +++ b/src/sage/combinat/cartesian_product.py @@ -100,6 +100,7 @@ def __init__(self, *iters): category = category.Finite() if self.is_finite() else category.Infinite() except ValueError: # Unable to determine if it is finite or not pass + def iterfunc(): # we can not use self.__iterate__ directly because # that leads to an infinite recursion in __eq__ @@ -204,7 +205,7 @@ def __len__(self): sage: len(C) Traceback (most recent call last): ... - TypeError: cardinality does not fit into a Python int. + TypeError: cardinality does not fit into a Python int sage: C = CartesianProduct_iters(ZZ, []) sage: len(C) 0 diff --git a/src/sage/combinat/chas/fsym.py b/src/sage/combinat/chas/fsym.py index 36ef2fdbe35..5a3fe04b921 100644 --- a/src/sage/combinat/chas/fsym.py +++ b/src/sage/combinat/chas/fsym.py @@ -143,8 +143,8 @@ def _coerce_map_from_(self, R): FSym = self.realization_of() if R.realization_of() == FSym: return True - if (isinstance(R.realization_of(), FreeSymmetricFunctions) - != isinstance(FSym, FreeSymmetricFunctions)): + if (isinstance(R.realization_of(), FreeSymmetricFunctions) != + isinstance(FSym, FreeSymmetricFunctions)): # If they are dual bases, then no coercion return False if not self.base_ring().has_coerce_map_from(R.base_ring()): @@ -1071,7 +1071,9 @@ def standardize(t): sage: standardize(t) [[1, 3, 4, 7], [2, 5, 6], [8]] - Returns an equal tableau if already standard:: + TESTS: + + This returns an equal tableau if already standard:: sage: t = Tableau([[1,3,4,5],[2,6,7],[8]]) sage: standardize(t) diff --git a/src/sage/combinat/chas/wqsym.py b/src/sage/combinat/chas/wqsym.py index 0f1a7af870a..88bb4d0d116 100644 --- a/src/sage/combinat/chas/wqsym.py +++ b/src/sage/combinat/chas/wqsym.py @@ -942,7 +942,7 @@ def some_elements(self): u = self.one() o = self([[1]]) s = self.base_ring().an_element() - return [u, o, self([[1,2]]), u + s*o] + return [u, o, self([[1, 2]]), u + s * o] def _C_to_X(self, P): """ @@ -967,7 +967,7 @@ def _C_to_X(self, P): data = [] while temp: i = min(min(X) for X in temp) - for j,A in enumerate(temp): + for j, A in enumerate(temp): if i in A: data.append(OSP(temp[j:])) temp = temp[:j] @@ -1077,7 +1077,7 @@ def some_elements(self): u = self.one() o = self([[1]]) s = self.base_ring().an_element() - return [u, o, self([[1,2]]), u + s*o] + return [u, o, self([[1, 2]]), u + s * o] def _Q_to_M(self, P): """ @@ -1459,7 +1459,7 @@ def some_elements(self): u = self.one() o = self([[1]]) s = self.base_ring().an_element() - return [u, o, self([[1,2]]), u + s*o] + return [u, o, self([[1, 2]]), u + s * o] def _Phi_to_M(self, P): """ @@ -1647,15 +1647,15 @@ def digest(s): s1 = [p[1] for p in s] N = len(s) bars = [False] * N - for i in range(N-1): + for i in range(N - 1): s0i = s0[i] - s0i1 = s0[i+1] + s0i1 = s0[i + 1] if s0i <= m and s0i1 <= m: - bars[i+1] = s1[i+1] + bars[i + 1] = s1[i + 1] elif s0i > m and s0i1 > m: - bars[i+1] = s1[i+1] + bars[i + 1] = s1[i + 1] elif s0i > m and s0i1 <= m: - bars[i+1] = True + bars[i + 1] = True blocks = [] block = [] for i in range(N): @@ -1728,7 +1728,7 @@ def coproduct_on_basis(self, x): def standardize(P): # standardize an ordered set partition base = sorted(sum((list(part) for part in P), [])) # base is the ground set of P, as a sorted list. - d = {val: i+1 for i,val in enumerate(base)} + d = {val: i + 1 for i, val in enumerate(base)} # d is the unique order isomorphism from base to # {1, 2, ..., |base|} (encoded as dict). return K([[d[x] for x in part] for part in P]) @@ -1737,7 +1737,7 @@ def standardize(P): # standardize an ordered set partition xi = sorted(x[i]) for j in range(1, len(xi)): left = K(list(x[:i]) + [xi[:j]]) - right = K([xi[j:]] + list(x[i+1:])) + right = K([xi[j:]] + list(x[i + 1:])) deconcatenates.append((left, right)) T = self.tensor_square() return T.sum_of_monomials((standardize(left), standardize(right)) diff --git a/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py b/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py index a4dc89c3aa4..7261e2d1f05 100644 --- a/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py +++ b/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py @@ -4559,11 +4559,11 @@ def _produce_upper_cluster_algebra_element(self, vd, cList): #Each compatible sequence gives a term in the numerator of the Laurent polynomial. for s in cList[i]: term = 1 - #Calulates the monomial in the term. + # Calculates the monomial in the term. for j in range(num_rows): x = R.gen(j) expn = 0 - #The exponent is determined by the vectors a,s, and the matrix B. + # The exponent is determined by the vectors a,s, and the matrix B. for k in range(num_cols): expn += (vd[i][0][k]-s[k])*max(0, B[j][k])+s[k]*max(0, -B[j][k]) term *= x ** expn diff --git a/src/sage/combinat/cluster_algebra_quiver/mutation_type.py b/src/sage/combinat/cluster_algebra_quiver/mutation_type.py index a4f5f917aa3..ada4fcc0d63 100644 --- a/src/sage/combinat/cluster_algebra_quiver/mutation_type.py +++ b/src/sage/combinat/cluster_algebra_quiver/mutation_type.py @@ -878,7 +878,7 @@ def _connected_mutation_type_AAtildeD(dg, ret_conn_vert=False): # If on the other hand, (c1 and c2) is isomorphic to a triangulated square, then # delete c1. This ensures that c2 is an edge of the triangulated square, and we delete - # it irregardless of orientation. Then check if the digraph has exactly two connected + # it regardless of orientation. Then check if the digraph has exactly two connected # components, and again this testing method is rerun on both components. for c1 in Combinations( [ vertex for vertex in vertices if dg.degree(vertex) == 2], 2 ): diff --git a/src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py b/src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py index b15e4a25cb8..b819aed8966 100644 --- a/src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py +++ b/src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py @@ -380,7 +380,7 @@ def _samples(self): * Grassmannian: This defines the cluster algebra (without coefficients) corresponding to the cluster algebra with - coefficients which is the co-ordinate ring of a Grassmannian. + coefficients which is the coordinate ring of a Grassmannian. ``letter`` is 'GR'. ``rank`` is a pair of integers (`k`, `n`) with 'k' < 'n' specifying the Grassmannian of `k`-planes in `n`-space. This defines a quiver given by a (k-1) x (n-k-1) diff --git a/src/sage/combinat/crystals/generalized_young_walls.py b/src/sage/combinat/crystals/generalized_young_walls.py index 0ad6cb38842..d656d27080f 100644 --- a/src/sage/combinat/crystals/generalized_young_walls.py +++ b/src/sage/combinat/crystals/generalized_young_walls.py @@ -537,7 +537,7 @@ def _latex_(self): def weight(self, root_lattice=False): r""" - Returns the weight of ``self``. + Return the weight of ``self``. INPUT: diff --git a/src/sage/combinat/crystals/infinity_crystals.py b/src/sage/combinat/crystals/infinity_crystals.py index 940c02aed63..919242aa1b8 100644 --- a/src/sage/combinat/crystals/infinity_crystals.py +++ b/src/sage/combinat/crystals/infinity_crystals.py @@ -682,7 +682,7 @@ def module_generator(self): r""" Return the module generator (or highest weight element) of ``self``. - The module generator is the unique semistandard hoook tableau of shape + The module generator is the unique semistandard hook tableau of shape `(n, n-1, \ldots,2, 1)` with weight `0`. EXAMPLES:: diff --git a/src/sage/combinat/decorated_permutation.py b/src/sage/combinat/decorated_permutation.py index 08290735b00..2632364aff2 100644 --- a/src/sage/combinat/decorated_permutation.py +++ b/src/sage/combinat/decorated_permutation.py @@ -31,6 +31,7 @@ from sage.combinat.colored_permutations import SignedPermutations from sage.structure.list_clone import ClonableArray + class DecoratedPermutation(ClonableArray, metaclass=InheritComparisonClasscallMetaclass): r""" @@ -79,7 +80,7 @@ def check(self): sage: elt.check() sage: elt = S([2, -1, 3]) Traceback (most recent call last): - ... + ... ValueError: invalid decorated permutation """ if self not in self.parent(): @@ -147,6 +148,7 @@ def to_signed_permutation(self): """ return SignedPermutations(len(self))(list(self)) + class DecoratedPermutations(UniqueRepresentation, Parent): r""" Class of all decorated permutations of `n`. @@ -214,7 +216,7 @@ def __contains__(self, pi): for i, (v, abs_v) in enumerate(zip(values, abs_values), 1): if i != abs_v and v < 0: return False - return sorted(abs_values) == list(range(1, self._n+1)) + return sorted(abs_values) == list(range(1, self._n + 1)) def _element_constructor_(self, pi, check=True): """ @@ -267,7 +269,8 @@ def cardinality(self): sage: [DecoratedPermutations(n).cardinality() for n in range(11)] [1, 2, 5, 16, 65, 326, 1957, 13700, 109601, 986410, 9864101] """ - return Integer(sum(factorial(self._n)//factorial(k) for k in range(self._n+1))) + return Integer(sum(factorial(self._n) // factorial(k) + for k in range(self._n + 1))) def __iter__(self): r""" @@ -285,5 +288,5 @@ def __iter__(self): for X in Subsets(F): tau = list(sigma) for i in X: - tau[i-1] = -tau[i-1] + tau[i - 1] = -tau[i - 1] yield DecoratedPermutations(self._n)(tau) diff --git a/src/sage/combinat/degree_sequences.pyx b/src/sage/combinat/degree_sequences.pyx index d225055e950..6f5f91fbaa9 100644 --- a/src/sage/combinat/degree_sequences.pyx +++ b/src/sage/combinat/degree_sequences.pyx @@ -210,7 +210,7 @@ the run of ``enum``. **Extending the current partial sequence** The two cases for which the maximum degree of the partial sequence does not -change are easy to detect. It is (sligthly) harder to enumerate all the sets +change are easy to detect. It is (slightly) harder to enumerate all the sets `I` corresponding to possible extensions of the partial sequence. As said previously, to each set `I` one can associate an integer ``current_box`` such that `I` contains all the `i` satisfying `d_i>current\_box`. The variable diff --git a/src/sage/combinat/designs/bibd.py b/src/sage/combinat/designs/bibd.py index 54993ac9558..f39003afb13 100644 --- a/src/sage/combinat/designs/bibd.py +++ b/src/sage/combinat/designs/bibd.py @@ -95,7 +95,7 @@ def biplane(n, existence=False): sage: designs.biplane(9) (56,11,2)-Balanced Incomplete Block Design - Check all knwon biplanes:: + Check all known biplanes:: sage: [n for n in [0,1,2,3,4,7,9,11] if designs.biplane(n, existence=True) is True] [0, 1, 2, 3, 4, 7, 9, 11] diff --git a/src/sage/combinat/designs/incidence_structures.py b/src/sage/combinat/designs/incidence_structures.py index e7416990708..1e722f41aad 100644 --- a/src/sage/combinat/designs/incidence_structures.py +++ b/src/sage/combinat/designs/incidence_structures.py @@ -61,7 +61,7 @@ class IncidenceStructure(object): .. NOTE:: - The following syntax, where ``points`` is ommitted, automatically + The following syntax, where ``points`` is omitted, automatically defines the ground set as the union of the blocks:: sage: H = IncidenceStructure([['a','b','c'],['c','d','e']]) diff --git a/src/sage/combinat/designs/latin_squares.py b/src/sage/combinat/designs/latin_squares.py index a0d0ec9a341..2bb04f749f1 100644 --- a/src/sage/combinat/designs/latin_squares.py +++ b/src/sage/combinat/designs/latin_squares.py @@ -131,7 +131,7 @@ def are_mutually_orthogonal_latin_squares(l, verbose=False): r""" - Check wether the list of matrices in ``l`` form mutually orthogonal latin + Check whether the list of matrices in ``l`` form mutually orthogonal latin squares. INPUT: diff --git a/src/sage/combinat/designs/subhypergraph_search.pyx b/src/sage/combinat/designs/subhypergraph_search.pyx index 70b41f8c633..9c6b7278a40 100644 --- a/src/sage/combinat/designs/subhypergraph_search.pyx +++ b/src/sage/combinat/designs/subhypergraph_search.pyx @@ -40,7 +40,7 @@ fields: * ``sets`` (``uint64_t **``) -- ``sets[i]`` points toward the ``limbs`` blocks encoding set `i`. Note also that ``sets[i][limbs]`` is equal to the - cardinality of ``set[i]``, so that ``sets`` has lenth + cardinality of ``set[i]``, so that ``sets`` has length ``m*(limbs+1)*sizeof(uint64_t)``. * ``names`` (``int *``) -- associates an integer 'name' to each of the ``n`` @@ -108,14 +108,14 @@ AUTHORS: Methods ------- """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2014 Nathann Cohen # # Distributed under the terms of the GNU General Public License (GPL) # as published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # http://www.gnu.org/licenses/ -#***************************************************************************** +# **************************************************************************** from libc.stdlib cimport qsort from libc.stdint cimport uint64_t @@ -131,7 +131,7 @@ ctypedef struct hypergraph: cdef inline int bs_get(uint64_t * bitset, int index): r""" - Returs a bit of a bitset + Return a bit of a bitset """ return (bitset[index/64]>>(index%64))&1 diff --git a/src/sage/combinat/designs/twographs.py b/src/sage/combinat/designs/twographs.py index 7936de3555c..d8c63d0c35e 100644 --- a/src/sage/combinat/designs/twographs.py +++ b/src/sage/combinat/designs/twographs.py @@ -252,9 +252,10 @@ def has_triple(x_y_z): return True + def twograph_descendant(G, v, name=None): r""" - Returns the descendant graph w.r.t. vertex `v` of the two-graph of `G` + Return the descendant graph w.r.t. vertex `v` of the two-graph of `G` In the :mod:`switching class ` of `G`, construct a graph `\Delta` with `v` an isolated vertex, and return the subgraph diff --git a/src/sage/combinat/finite_state_machine.py b/src/sage/combinat/finite_state_machine.py index 8df486ac876..95eab382f40 100644 --- a/src/sage/combinat/finite_state_machine.py +++ b/src/sage/combinat/finite_state_machine.py @@ -6039,7 +6039,7 @@ class is created and is used during the processing. accepted or not) usually corresponds to using the more specialized class :class:`Automaton`. - Non-deterministic finite state machines can be handeled as well. + Non-deterministic finite state machines can be handled as well. :: @@ -8152,7 +8152,7 @@ def composition(self, other, algorithm=None, sage: is_Automaton(A.composition(T, algorithm='explorative')) True - Non-deterministic final output cannot be handeled:: + Non-deterministic final output cannot be handled:: sage: F = Transducer([('I', 'A', 0, 42), ('I', 'B', 0, 42)], ....: initial_states=['I'], @@ -8845,11 +8845,10 @@ def completion(self, sink=None): # simplifications # ************************************************************************* - def prepone_output(self): """ For all paths, shift the output of the path from one - transition to the earliest possible preceeding transition of + transition to the earliest possible preceding transition of the path. INPUT: diff --git a/src/sage/combinat/fully_commutative_elements.py b/src/sage/combinat/fully_commutative_elements.py index 9584aec5dd1..e85f7be7672 100644 --- a/src/sage/combinat/fully_commutative_elements.py +++ b/src/sage/combinat/fully_commutative_elements.py @@ -36,7 +36,6 @@ from sage.combinat.posets.posets import Poset from sage.categories.coxeter_groups import CoxeterGroups from sage.combinat.root_system.coxeter_group import CoxeterGroup -import itertools class FullyCommutativeElement(NormalizedClonableList): @@ -80,7 +79,7 @@ def check(self): r""" Called automatically when an element is created. - TESTS:: + EXAMPLES:: sage: CoxeterGroup(['A', 3]).fully_commutative_elements()([1, 2]) # indirect doctest [1, 2] @@ -124,7 +123,7 @@ def normalize(self): out_word = [] - while len(self) > 0: + while self: fronts = self.descents() out_word.extend(sorted(fronts)) for s in fronts: @@ -145,10 +144,10 @@ def is_fully_commutative(self): :func:`check` is an alias of this method, and is called automatically when an element is created. - - TESTS:: - sage: FC = CoxeterGroup(['A', 3]).fully_commutative_elements() + EXAMPLES:: + + sage: FC = CoxeterGroup(['A', 3]).fully_commutative_elements() sage: x = FC([1, 2]); x.is_fully_commutative() True sage: x = FC.element_class(FC, [1, 2, 1], check=False); x.is_fully_commutative() @@ -156,15 +155,15 @@ def is_fully_commutative(self): """ matrix = self.parent().coxeter_group().coxeter_matrix() w = tuple(self) - + # The following function detects 'braid' words. def contains_long_braid(w): - for i in range(0, len(w) - 2): + for i in range(len(w) - 2): a = w[i] b = w[i + 1] m = matrix[a, b] if m > 2 and i + m <= len(w): - ab_braid = (a, b) * (m // 2) + ((a,) if m % 2 == 1 else ()) + ab_braid = (a, b) * (m // 2) + ((a,) if m % 2 else ()) if w[i:i + m] == ab_braid: return True return False @@ -174,7 +173,7 @@ def commute_once(word, i): return word[:i] + (word[i + 1], word[i]) + word[i + 2:] # A word is the reduced word of an FC element iff no sequence of - # commutation relations on it yields a word with a 'braid' word: + # commutation relations on it yields a word with a 'braid' word: if contains_long_braid(w): return False else: @@ -241,8 +240,8 @@ def letter(index): return self[index - 1] if one_index else self[index] # specify the partial order: - relations = [(i, j) for [i, j] in itertools.product( - elements, repeat=2) if i < j and m[letter(i), letter(j)] != 2] + relations = [(i, j) for i in elements for j in elements + if i < j and m[letter(i), letter(j)] != 2] p = Poset((elements, relations)) if not display_labeling: @@ -271,7 +270,7 @@ def plot_heap(self): Graphics object consisting of 15 graphics primitives .. PLOT:: - :width: 400px + :width: 400 px FC = CoxeterGroup(['B', 5]).fully_commutative_elements() g = FC([3,2,4,3,1]).plot_heap() @@ -372,7 +371,6 @@ def find_descent(self, s, side='left'): the index of the leftmost occurrence of ``s`` in ``self`` if so and return ``None`` if not. - EXAMPLES:: sage: FC = CoxeterGroup(['B', 5]).fully_commutative_elements() @@ -464,7 +462,7 @@ def descents(self, side='left'): # Coset decompositions def coset_decomposition(self, J, side='left'): r""" - Return the coset decomposition of ``self`` with repsect to the parabolic + Return the coset decomposition of ``self`` with respect to the parabolic subgroup generated by ``J``. INPUT: @@ -604,7 +602,7 @@ def _still_reduced_fc_after_prepending(self, s): removing the leftmost `s` from `u_2`; ... - + (m-1) the appropriate element in `\{s, t\}` is a left descent of the word `u_{m-1}` obtained by removing the leftmost letter required to be a descent in Condition (m-2) from `u_{m-2}`. @@ -702,7 +700,7 @@ def star_operation(self, J, direction, side='left'): sage: w.coset_decomposition({5, 6}) ([6, 5, 6], [1, 2, 4, 5]) - Only the lower star operation is defined on the left on `w`:: + Only the lower star operation is defined on the left on `w`:: sage: w.star_operation({5,6}, 'upper') @@ -939,14 +937,14 @@ def __init__(self, coxeter_group): # Start with the category of enumerated sets and refine it to finite or # infinite enumerated sets for Coxeter groups of Cartan types. - category = EnumeratedSets() + category = EnumeratedSets() coxeter_type = self._coxeter_group.coxeter_type() if not isinstance(coxeter_type, CoxeterMatrix): # This case handles all finite or affine Coxeter types (or products thereof) ctypes = [coxeter_type] if coxeter_type.is_irreducible() else coxeter_type.component_types() - + is_finite = True # this type will be FC-finite if and only if each component type is: for ctype in ctypes: @@ -958,7 +956,7 @@ def __init__(self, coxeter_group): if not (ctype.is_finite() or (family == 'F' and rank == 5) or (family == 'E' and rank == 9)): is_finite = False break - + if is_finite: category = category.Finite() else: diff --git a/src/sage/combinat/integer_lists/invlex.pyx b/src/sage/combinat/integer_lists/invlex.pyx index 23e1fe85c92..f73014012c2 100644 --- a/src/sage/combinat/integer_lists/invlex.pyx +++ b/src/sage/combinat/integer_lists/invlex.pyx @@ -1105,7 +1105,7 @@ class IntegerListsLexIter(builtins.object): ``_current_list``: the range for each part. Furthermore, we assume that there is no obvious contradiction - in the contraints: + in the constraints: - ``self.backend.min_length <= self.backend.max_length``; - ``self.backend.min_slope <= self.backend.max_slope`` diff --git a/src/sage/combinat/parallelogram_polyomino.py b/src/sage/combinat/parallelogram_polyomino.py index 5b1f3a02f93..e24ed79070b 100644 --- a/src/sage/combinat/parallelogram_polyomino.py +++ b/src/sage/combinat/parallelogram_polyomino.py @@ -644,7 +644,7 @@ def XY(self, v): and XY user function. First we apply XY function, then the translation, then the mirror and - finaly the rotation. + finally the rotation. INPUT: @@ -757,11 +757,11 @@ def draw_line(self, v1, v2, color=None, size=None): - ``v2`` -- point, The second point of the line. - ``color`` -- string (default:``None``), The color of the line. - If set to ``None``, the color is choosen according the + If set to ``None``, the color is chosen according the drawing option given by ``_drawing_tool``. - ``size`` -- integer (default:``None``), The size of the line. - If set to ``None``, the size is choosen according the + If set to ``None``, the size is chosen according the drawing option given by ``_drawing_tool``. OUTPUT: @@ -799,11 +799,11 @@ def draw_polyline(self, list_of_vertices, color=None, size=None): - ``list_of_vertices`` -- A list of points - ``color`` -- string (default:``None``), The color of the line. - If set to ``None``, the color is choosen according the + If set to ``None``, the color is chosen according the drawing option given by ``_drawing_tool``. - ``size`` -- integer (default:``None``), The size of the line. - If set to ``None``, the size is choosen according the + If set to ``None``, the size is chosen according the drawing option given by ``_drawing_tool``. OUTPUT: @@ -839,11 +839,11 @@ def draw_point(self, p1, color=None, size=None): - ``p1`` -- A point - ``color`` -- string (default:``None``), The color of the line. - If set to ``None``, the color is choosen according the + If set to ``None``, the color is chosen according the drawing option given by ``_drawing_tool``. - ``size`` -- integer (default:``None``), The size of the line. - If set to ``None``, the size is choosen according the + If set to ``None``, the size is chosen according the drawing option given by ``_drawing_tool``. OUTPUT: @@ -2173,7 +2173,7 @@ def __init__(self, polyomino, row): def __getitem__(self, column): r""" - Return 0 or 1 if the is a cell inside the specific colum inside the + Return 0 or 1 if the is a cell inside the specific column inside the row. EXAMPLES:: @@ -2827,7 +2827,7 @@ def _get_node_position_at_row(self, row): OUTPUT: - A [row,colum] position of the cell. + A [row,column] position of the cell. EXAMPLES:: @@ -2874,7 +2874,7 @@ def _get_node_position_at_column(self, column): OUTPUT: - A [row,colum] position of the cell. + A [row,column] position of the cell. EXAMPLES:: @@ -2932,7 +2932,7 @@ def get_node_position_from_box(self, box_position, direction, nb_crossed_nodes=[ OUTPUT: - A [row,colum] position of the cell. + A [row,column] position of the cell. EXAMPLES:: @@ -3337,7 +3337,7 @@ def get_left_BS_nodes(self): OUTPUT: - A list of [row,colum] position of cells. + A list of [row,column] position of cells. EXAMPLES:: diff --git a/src/sage/combinat/partition.py b/src/sage/combinat/partition.py index 292d1d8c601..40a4ce76e0e 100644 --- a/src/sage/combinat/partition.py +++ b/src/sage/combinat/partition.py @@ -2962,7 +2962,7 @@ def prime_degree(self, p): The degree of a partition `\lambda` is the sum of the `e`-:meth:`degree` of the standard tableaux of shape `\lambda`, for - `e` a poer of the prime `p`. The prime degree gives the exponent of + `e` a power of the prime `p`. The prime degree gives the exponent of `p` in the Gram determinant of the integral Specht module of the symmetric group. @@ -3304,7 +3304,6 @@ def hook_polynomial(self, q, t): res *= 1-q**(self[i]-j-1)*t**(nu[j]-i) return res - def hook_length(self, i, j): r""" Return the length of the hook of cell `(i,j)` in ``self``. @@ -5105,7 +5104,7 @@ def inv_factorial(i): def multinomial_with_partitions(sizes,path_counts): # count the number of ways of performing the k paths in parallel, - # if we know the total length alloted for each of the paths (sizes), and the number + # if we know the total length allotted for each of the paths (sizes), and the number # of paths for each component. A multinomial picks the ordering of the components where # each step is taken. return prod(path_counts) * multinomial(sizes) @@ -6488,7 +6487,7 @@ def random_element(self, measure = 'uniform'): elif measure == 'Plancherel': return self.random_element_plancherel() else: - raise ValueError("Unkown measure: %s" % (measure)) + raise ValueError("Unknown measure: %s" % measure) def random_element_uniform(self): """ @@ -7187,7 +7186,7 @@ def __classcall_private__(cls, n, starting_partition): def __init__(self, n, starting_partition): """ - Initilizes ``self``. + Initialize ``self``. EXAMPLES:: diff --git a/src/sage/combinat/posets/hasse_diagram.py b/src/sage/combinat/posets/hasse_diagram.py index 845d1cd6510..abf5d226ef2 100644 --- a/src/sage/combinat/posets/hasse_diagram.py +++ b/src/sage/combinat/posets/hasse_diagram.py @@ -2044,7 +2044,7 @@ def find_nonsemimodular_pair(self, upper): INPUT: - - upper, a Boolean -- if ``True``, test wheter the lattice is + - upper, a Boolean -- if ``True``, test whether the lattice is upper semimodular; otherwise test whether the lattice is lower semimodular. diff --git a/src/sage/combinat/posets/lattices.py b/src/sage/combinat/posets/lattices.py index 0fc257d7c47..2ef29209a27 100644 --- a/src/sage/combinat/posets/lattices.py +++ b/src/sage/combinat/posets/lattices.py @@ -2494,7 +2494,7 @@ def is_planar(self): the `\mathbb{R}^2` plane, in such a way that `x` is strictly below `y` (on the vertical axis) whenever `x # # Distributed under the terms of the GNU General Public License (GPL) @@ -23,18 +23,17 @@ # # The full text of the GPL is available at: # -# http://www.gnu.org/licenses/ -#***************************************************************************** - +# https://www.gnu.org/licenses/ +# **************************************************************************** from sage.misc.cachefunc import cached_method from sage.structure.list_clone import ClonableArray from sage.rings.integer import Integer from sage.rings.integer_ring import ZZ -from sage.combinat.rigged_configurations.rigged_partition import RiggedPartition, \ - RiggedPartitionTypeB +from sage.combinat.rigged_configurations.rigged_partition import RiggedPartition, RiggedPartitionTypeB + #################################################### -## Base classes for rigged configuration elements ## +# Base classes for rigged configuration elements # #################################################### class RiggedConfigurationElement(ClonableArray): @@ -1768,7 +1767,7 @@ def right_split(self): 1[ ]0 0[ ][ ]0 -1[ ]-1 0[ ]0 - We check that the bijection commutes with the right spliting map:: + We check that the bijection commutes with the right splitting map:: sage: RC = RiggedConfigurations(['A', 3, 1], [[1,1], [2,2]]) sage: all(rc.right_split().to_tensor_product_of_kirillov_reshetikhin_tableaux() diff --git a/src/sage/combinat/rigged_configurations/rigged_configurations.py b/src/sage/combinat/rigged_configurations/rigged_configurations.py index 2c4f14dd885..c16b92649ee 100644 --- a/src/sage/combinat/rigged_configurations/rigged_configurations.py +++ b/src/sage/combinat/rigged_configurations/rigged_configurations.py @@ -1622,7 +1622,7 @@ def _calc_vacancy_number(self, partitions, a, i, **options): - ``a`` -- the rigged partition index - - ``i`` -- the row lenth + - ``i`` -- the row length TESTS:: diff --git a/src/sage/combinat/root_system/fusion_ring.py b/src/sage/combinat/root_system/fusion_ring.py index bfce6d351d5..667b71760d4 100644 --- a/src/sage/combinat/root_system/fusion_ring.py +++ b/src/sage/combinat/root_system/fusion_ring.py @@ -391,7 +391,7 @@ def fusion_labels(self, labels=None, inject_variables=False): [ x3 x2 x1 x0] We give an example where the variables are injected into the - global namepsace:: + global namespace:: sage: A13.fusion_labels("y", inject_variables=True) sage: y0 diff --git a/src/sage/combinat/root_system/integrable_representations.py b/src/sage/combinat/root_system/integrable_representations.py index fba58979b32..080bbf21971 100644 --- a/src/sage/combinat/root_system/integrable_representations.py +++ b/src/sage/combinat/root_system/integrable_representations.py @@ -664,7 +664,7 @@ def _freudenthal_roots_real(self, nu): elif self._cartan_type.type() == 'BC': #case A^2_{2l} - # We have to keep track of the roots we have visted for this case + # We have to keep track of the roots we have visited for this case ret = set(self._classical_positive_roots) for al in self._classical_roots: if al in self._classical_short_roots: diff --git a/src/sage/combinat/root_system/plot.py b/src/sage/combinat/root_system/plot.py index 154d5ab39f9..5e8ee505465 100644 --- a/src/sage/combinat/root_system/plot.py +++ b/src/sage/combinat/root_system/plot.py @@ -84,7 +84,7 @@ The group is now the dihedral group of order 12, generated by the two reflections `s_1` and `s_2`. The picture displays the hyperplanes for all 12 reflections of the group. Those reflections delimit 12 chambers -which are in one to one correspondance with the elements of the +which are in one to one correspondence with the elements of the group. The fundamental chamber, which is grayed out, is associated with the identity of the group. @@ -772,7 +772,7 @@ same weight and are thus superposed (look for example near the center). Some more layout logic would be needed to separate those nodes properly, but the - foundations are laid firmly and uniformly accross all + foundations are laid firmly and uniformly across all types of root systems for writing such extensions. Here is an analogue picture in 3D:: diff --git a/src/sage/combinat/root_system/reflection_group_c.pyx b/src/sage/combinat/root_system/reflection_group_c.pyx index 8283a98e88b..6c1808fe3f8 100644 --- a/src/sage/combinat/root_system/reflection_group_c.pyx +++ b/src/sage/combinat/root_system/reflection_group_c.pyx @@ -3,7 +3,7 @@ r""" This contains a few time-critical auxiliary cython functions for finite complex or real reflection groups. """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2011-2016 Christian Stump # 2016 Travis Scrimshaw # @@ -12,7 +12,7 @@ finite complex or real reflection groups. # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # https://www.gnu.org/licenses/ -#***************************************************************************** +# **************************************************************************** from sage.groups.perm_gps.permgroup_element cimport PermutationGroupElement from collections import deque @@ -64,7 +64,7 @@ cdef class Iterator(object): def __init__(self, W, int N, str algorithm="depth", bint tracking_words=True, order=None): """ - Initalize ``self``. + Initialize ``self``. EXAMPLES:: diff --git a/src/sage/combinat/root_system/reflection_group_element.pyx b/src/sage/combinat/root_system/reflection_group_element.pyx index 29fe6d12a7e..157c74e18dd 100644 --- a/src/sage/combinat/root_system/reflection_group_element.pyx +++ b/src/sage/combinat/root_system/reflection_group_element.pyx @@ -1148,7 +1148,7 @@ _gap_factorization_code = r""" # MinimalWord(G,w) # given a permutation group G find some expression of minimal length in the # generators of G and their inverses of the element w (an inverse is -# representated by a negative index). +# represented by a negative index). # To speed up later calls to the same function the fields G.base, G.words, # G.nbwordslength are kept. MinimalWord:=function(G,w) diff --git a/src/sage/combinat/root_system/root_lattice_realization_algebras.py b/src/sage/combinat/root_system/root_lattice_realization_algebras.py index 468d80b832a..d8068675b0f 100644 --- a/src/sage/combinat/root_system/root_lattice_realization_algebras.py +++ b/src/sage/combinat/root_system/root_lattice_realization_algebras.py @@ -1082,7 +1082,7 @@ def twisted_demazure_lusztig_operators(self, q1, q2, convention="antidominant"): Investigate why `T_0^\vee` currently does not satisfy the quadratic relation in type `BC`. This should - hopefuly be fixed when `T_0^\vee` will have a more + hopefully be fixed when `T_0^\vee` will have a more uniform implementation:: sage: cartan_type = CartanType(["BC",1,2]) diff --git a/src/sage/combinat/root_system/root_lattice_realizations.py b/src/sage/combinat/root_system/root_lattice_realizations.py index f6167d36653..77c278c6aba 100644 --- a/src/sage/combinat/root_system/root_lattice_realizations.py +++ b/src/sage/combinat/root_system/root_lattice_realizations.py @@ -1429,7 +1429,7 @@ def fundamental_weights_from_simple_roots(self): # We first scale the inverse of the Cartan matrix to be # with integer coefficients; then the linear combination # of the simple roots is guaranteed to live in this space, - # and then we rely on division by d to fail gracefuly. + # and then we rely on division by d to fail gracefully. M = self.cartan_type().cartan_matrix() d = M.det() if not d: @@ -2180,7 +2180,7 @@ def _plot_projection_barycentric_matrix(self): # result is zero. This is close to be the case for the # original matrix and for the current rational # approximation. We tidy up the work by replacing the - # first colum by the opposite of the sum of the others. + # first column by the opposite of the sum of the others. if self.dimension()>1: # not needed in the trivial cases m.set_column(0, -sum(m[:,1:].columns())) m.set_immutable() @@ -2619,7 +2619,7 @@ def plot_fundamental_chamber(self, style="normal", **options): def plot_alcoves(self, alcoves=True, alcove_labels=False, wireframe=False, **options): r""" - Plot the alcoves and optionaly their labels. + Plot the alcoves and optionally their labels. INPUT: diff --git a/src/sage/combinat/root_system/type_marked.py b/src/sage/combinat/root_system/type_marked.py index 19792e631e9..9547bc536be 100644 --- a/src/sage/combinat/root_system/type_marked.py +++ b/src/sage/combinat/root_system/type_marked.py @@ -325,7 +325,7 @@ def ascii_art(self, label=lambda i: i, node=None): def dynkin_diagram(self): """ - Returns the Dynkin diagram for this Cartan type. + Return the Dynkin diagram for this Cartan type. EXAMPLES:: diff --git a/src/sage/combinat/root_system/weyl_characters.py b/src/sage/combinat/root_system/weyl_characters.py index f7045f36c4d..977d191646d 100644 --- a/src/sage/combinat/root_system/weyl_characters.py +++ b/src/sage/combinat/root_system/weyl_characters.py @@ -10,7 +10,7 @@ # **************************************************************************** import sage.combinat.root_system.branching_rules -from sage.categories.all import Category, Algebras, AlgebrasWithBasis +from sage.categories.all import Algebras, AlgebrasWithBasis from sage.combinat.free_module import CombinatorialFreeModule from sage.combinat.root_system.cartan_type import CartanType from sage.combinat.root_system.root_system import RootSystem @@ -20,6 +20,7 @@ from sage.misc.functional import is_even from sage.rings.all import ZZ + class WeylCharacterRing(CombinatorialFreeModule): r""" A class for rings of Weyl characters. @@ -140,6 +141,7 @@ def __init__(self, ct, base_ring=ZZ, prefix=None, style="lattice", k=None, conju if k is not None: self._prefix += str(k) fw = self._space.fundamental_weights() + def next_level(wt): return [wt + la for la in fw if self.level(wt + la) <= k] B = list(RecursivelyEnumeratedSet([self._space.zero()], next_level)) @@ -147,12 +149,10 @@ def next_level(wt): else: B = self._space - # TODO: remove the Category.join once not needed anymore (bug in CombinatorialFreeModule) - category = Category.join([AlgebrasWithBasis(base_ring), - Algebras(base_ring).Subobjects()]) + cat = AlgebrasWithBasis(base_ring).Subobjects() if k is None: - category = category.Graded() - CombinatorialFreeModule.__init__(self, base_ring, B, category=category) + cat = cat.Graded() + CombinatorialFreeModule.__init__(self, base_ring, B, category=cat) # Register the embedding of self into ambient as a coercion self.lift.register_as_coercion() @@ -228,7 +228,7 @@ def lift_on_basis(self, irr): sage: A2.lift_on_basis(v) 2*a2(1,1,1) + a2(1,2,0) + a2(1,0,2) + a2(2,1,0) + a2(2,0,1) + a2(0,1,2) + a2(0,2,1) - This is consistent with the analoguous calculation with symmetric + This is consistent with the analogous calculation with symmetric Schur functions:: sage: s = SymmetricFunctions(QQ).s() @@ -272,7 +272,7 @@ def demazure_character(self, hwv, word, debug=False): """ if self._style != "coroots": raise ValueError('demazure method unavailable. Use style="coroots".') - hwv = self._space.from_vector_notation(hwv, style = "coroots") + hwv = self._space.from_vector_notation(hwv, style="coroots") return self.ambient()._from_dict(self._demazure_weights(hwv, word=word, debug=debug)) @lazy_attribute @@ -306,8 +306,8 @@ def lift(self): a2(1,3,0) + a2(1,0,3) + a2(3,1,0) + a2(3,0,1) + a2(0,1,3) + a2(0,3,1) """ return self.module_morphism(self.lift_on_basis, - codomain = self.ambient(), - category = AlgebrasWithBasis(self.base_ring())) + codomain=self.ambient(), + category=AlgebrasWithBasis(self.base_ring())) def _retract(self, chi): """ @@ -395,7 +395,6 @@ def _repr_(self): else: return "The Fusion Ring of Type {} and level {} with {} coefficients".format(self._cartan_type._repr_(compact=True), self._k, self._base_ring) - def __call__(self, *args): """ Construct an element of ``self``. @@ -470,7 +469,7 @@ def _element_constructor_(self, weight): sage: A2._element_constructor_([2,1,0]) A2(2,1,0) """ - weight = self._space.from_vector_notation(weight, style = self._style) + weight = self._space.from_vector_notation(weight, style=self._style) if not weight.is_dominant_weight(): raise ValueError("{} is not a dominant element of the weight lattice".format(weight)) if self._k is not None: @@ -529,7 +528,7 @@ def _product_helper(self, d1, b): if epsilon == 1: d[g] = d.get(g,0) + d1[k] elif epsilon == -1: - d[g] = d.get(g,0)- d1[k] + d[g] = d.get(g,0) - d1[k] return self._from_dict(d) def dot_reduce(self, a): @@ -828,7 +827,7 @@ def _dual_helper(self, wt): sage: [A3._dual_helper(x) for x in A3.fundamental_weights()] [(0, 0, 0, -1), (0, 0, -1, -1), (0, -1, -1, -1)] """ - if self.cartan_type()[0] == 'A': # handled separately for GL(n) compatibility + if self.cartan_type()[0] == 'A': # handled separately for GL(n) compatibility return self.space()([-x for x in reversed(wt.to_vector().list())]) ret = 0 alphacheck = self._space.simple_coroots() @@ -861,9 +860,9 @@ def _wt_repr(self, wt): else: raise ValueError("unknown style") hstring = str(vec[0]) - for i in range(1,len(vec)): - hstring=hstring+","+str(vec[i]) - return "("+hstring+")" + for i in range(1, len(vec)): + hstring = hstring + "," + str(vec[i]) + return "(" + hstring + ")" def _repr_term(self, t): """ @@ -1347,9 +1346,9 @@ def symmetric_power(self, k): if k == 1: return self ret = par.zero() - for r in range(1,k+1): + for r in range(1, k+1): adam_r = self._adams_operation_helper(r) - ret += par.linear_combination( (par._product_helper(adam_r, l), c) for (l, c) in self.symmetric_power(k-r)) + ret += par.linear_combination((par._product_helper(adam_r, l), c) for (l, c) in self.symmetric_power(k-r)) dd = {} m = ret.weight_multiplicities() for l in m: @@ -1389,9 +1388,9 @@ def exterior_power(self, k): for r in range(1,k+1): adam_r = self._adams_operation_helper(r) if is_even(r): - ret -= par.linear_combination( (par._product_helper(adam_r, l), c) for (l, c) in self.exterior_power(k-r)) + ret -= par.linear_combination((par._product_helper(adam_r, l), c) for (l, c) in self.exterior_power(k-r)) else: - ret += par.linear_combination( (par._product_helper(adam_r, l), c) for (l, c) in self.exterior_power(k-r)) + ret += par.linear_combination((par._product_helper(adam_r, l), c) for (l, c) in self.exterior_power(k-r)) dd = {} m = ret.weight_multiplicities() for l in m: @@ -1626,6 +1625,7 @@ def multiplicity(self, other): raise ValueError("{} is not irreducible".format(other)) return self.coefficient(other.support()[0]) + def irreducible_character_freudenthal(hwv, debug=False): r""" Return the dictionary of multiplicities for the irreducible @@ -1655,7 +1655,7 @@ def irreducible_character_freudenthal(hwv, debug=False): L = hwv.parent() rho = L.rho() mdict = {} - current_layer = {hwv:1} + current_layer = {hwv: 1} simple_roots = L.simple_roots() positive_roots = L.positive_roots() @@ -1666,7 +1666,7 @@ def irreducible_character_freudenthal(hwv, debug=False): if current_layer[mu] != 0: mdict[mu] = current_layer[mu] for alpha in simple_roots: - next_layer[mu-alpha] = None + next_layer[mu - alpha] = None if debug: print(next_layer) @@ -1682,11 +1682,12 @@ def irreducible_character_freudenthal(hwv, debug=False): next_layer[mu] = 0 else: hwv_plus_rho = hwv + rho - mu_plus_rho = mu + rho + mu_plus_rho = mu + rho next_layer[mu] = ZZ(2*accum)/ZZ((hwv_plus_rho).inner_product(hwv_plus_rho)-(mu_plus_rho).inner_product(mu_plus_rho)) current_layer = next_layer return mdict + class WeightRing(CombinatorialFreeModule): """ The weight ring, which is the group algebra over a weight lattice. @@ -1767,10 +1768,10 @@ def __init__(self, parent, prefix): prefix = self._parent._prefix.upper() else: # TODO: this only works for irreducible Cartan types! - prefix = (self._cartan_type[0].lower()+str(self._rank)) + prefix = (self._cartan_type[0].lower() + str(self._rank)) self._prefix = prefix category = AlgebrasWithBasis(self._base_ring) - CombinatorialFreeModule.__init__(self, self._base_ring, self._space, category = category) + CombinatorialFreeModule.__init__(self, self._base_ring, self._space, category=category) def _repr_(self): """ @@ -1781,7 +1782,7 @@ def _repr_(self): sage: WeightRing(G2) # indirect doctest The Weight ring attached to The Weyl Character Ring of Type G2 with Univariate Polynomial Ring in q over Rational Field coefficients """ - return "The Weight ring attached to %s"%self._parent + return "The Weight ring attached to %s" % self._parent def __call__(self, *args): """ @@ -1838,7 +1839,7 @@ def _element_constructor_(self, weight): sage: A2._element_constructor_([2,1,0]) A2(2,1,0) """ - weight = self._space.from_vector_notation(weight, style = self._style) + weight = self._space.from_vector_notation(weight, style=self._style) return self.monomial(weight) def product_on_basis(self, a, b): @@ -2071,9 +2072,7 @@ def scale(self, k): if k == 0: raise ValueError("parameter must be nonzero") d1 = self.monomial_coefficients() - d2 = {} - for mu in d1: - d2[k * mu] = d1[mu] + d2 = {k * mu: coeff for mu, coeff in d1.items()} return self.parent()._from_dict(d2) def shift(self, mu): @@ -2201,16 +2200,16 @@ def demazure_lusztig(self, i, v): True """ if i in self.parent().space().index_set(): - rho = self.parent().space().from_vector_notation(self.parent().space().rho(),style="coroots") + rho = self.parent().space().from_vector_notation(self.parent().space().rho(), style="coroots") inv = self.scale(-1) - return (-inv.shift(-rho).demazure([i]).shift(rho)+v*inv.demazure([i])).scale(-1) + return (-inv.shift(-rho).demazure([i]).shift(rho)+v * inv.demazure([i])).scale(-1) elif isinstance(i, list): - if len(i) == 0: + if not i: return self elif len(i) == 1: return self.demazure_lusztig(i[0], v) else: - return self.demazure_lusztig(i[1:], v).demazure_lusztig(i[:1],v) + return self.demazure_lusztig(i[1:], v).demazure_lusztig(i[:1], v) else: try: return self.demazure_lusztig(i.reduced_word(), v) diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index 1fa00afe834..585a8fd7ffe 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -54,7 +54,7 @@ def __init__(self, Sym): def _dual_basis_default(self): r""" - Returns the dual basis to ``self``. + Return the dual basis to ``self``. INPUT: @@ -100,7 +100,7 @@ def _dual_basis_default(self): def coproduct_on_generators(self, i): r""" - Returns the coproduct on `h_i`. + Return the coproduct on `h_i`. INPUT: diff --git a/src/sage/combinat/shifted_primed_tableau.py b/src/sage/combinat/shifted_primed_tableau.py index 69814b05606..0ff05b0c80d 100644 --- a/src/sage/combinat/shifted_primed_tableau.py +++ b/src/sage/combinat/shifted_primed_tableau.py @@ -1046,7 +1046,7 @@ def f(self, ind): ones = sorted([pos for pos, elt in read_word if elt == 1], key=lambda x: x[1]) - # f_{-1} acts as zero if tableau cotnains no entries equal to 1 + # f_{-1} acts as zero if tableau contains no entries equal to 1 if len(ones) == 0: return None # otherwise, f_{-1} changes last 1 in first row to 2' (if off diagonal) or 2 (if on diagonal) diff --git a/src/sage/combinat/shuffle.py b/src/sage/combinat/shuffle.py index 4f6f59e18d7..ff42faaad20 100644 --- a/src/sage/combinat/shuffle.py +++ b/src/sage/combinat/shuffle.py @@ -43,7 +43,7 @@ Author: - - Jean-Baptiste Priez +- Jean-Baptiste Priez """ # **************************************************************************** # Copyright (C) 2014 Jean-Baptiste Priez @@ -59,22 +59,123 @@ import itertools import operator -from sage.arith.all import binomial -from sage.structure.sage_object import SageObject -from sage.combinat.combinat import CombinatorialClass +from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets from sage.combinat.integer_vector import IntegerVectors from sage.combinat.words.abstract_word import Word_class +from sage.rings.integer import Integer +from sage.structure.parent import Parent -## TODO: Think about Parent/Element for this and the category -## sage.categories.finite_enumerated_sets.FiniteEnumeratedSets -class SetShuffleProduct(SageObject): + +# TODO: Think about Parent/Element for this and the category +# sage.categories.finite_enumerated_sets.FiniteEnumeratedSets + +class ShuffleProduct_abstract(Parent): """ - The union of all possible shuffle products of two sets of iterables. + Abstract base class for shuffle products. + """ + def __init__(self, l1, l2, element_constructor=None): + """ + Initialize ``self``. - TESTS:: + TESTS:: - sage: from sage.combinat.shuffle import SetShuffleProduct - sage: TestSuite(SetShuffleProduct).run() + sage: from sage.combinat.shuffle import ShuffleProduct + sage: SP = ShuffleProduct([1,2],[4,5,7,8,9]) + sage: TestSuite(SP).run(skip="_test_an_element") + """ + self._l1 = l1 + self._l2 = l2 + if element_constructor is None: + self._element_constructor_ = self._constructor_ + else: + self._element_constructor_ = element_constructor + Parent.__init__(self, category=FiniteEnumeratedSets()) + + def _constructor_(self, x): + """ + This is used by default to produce elements when iterating. + + TESTS:: + + sage: from sage.combinat.shuffle import ShuffleProduct + sage: S = ShuffleProduct([1,2,3],[4,5]) + sage: S._constructor_((1,2,3)) + [1, 2, 3] + + sage: from sage.combinat.shuffle import ShuffleProduct_overlapping + sage: w, u = map(Words(range(20)), [[2, 9], [9, 1]]) + sage: S = ShuffleProduct_overlapping(w,u) + sage: S._constructor_((1,2,3)) + [1, 2, 3] + + sage: from sage.combinat.shuffle import SetShuffleProduct + sage: S = SetShuffleProduct([[1,2],[3,4]], [[1,4]]) + sage: S._constructor_((1,2,3)) + [1, 2, 3] + + sage: from sage.combinat.shuffle import ShuffleProduct_overlapping_r + sage: w, u = map(Words(range(20)), [[2, 9], [9, 1]]) + sage: S = ShuffleProduct_overlapping_r(w,u,1) + sage: S._constructor_((1,2,3)) + [1, 2, 3] + """ + return list(x) + + def __eq__(self, other): + """ + Test for equality. + + TESTS:: + + sage: from sage.combinat.shuffle import ShuffleProduct + sage: SP = ShuffleProduct([1,2],[4,5,7,8,9]) + sage: loads(dumps(SP)) == SP + True + sage: SP == ShuffleProduct([1,2],[4,5,7]) + False + """ + if not isinstance(other, type(self)): + return False + return (self._l1 == other._l1 and self._l2 == other._l2) + + def __ne__(self, other): + """ + Test for unequality + + EXAMPLES:: + + sage: from sage.combinat.shuffle import ShuffleProduct_overlapping_r + sage: w, u = map(Words(range(20)), [[2, 9], [9, 1]]) + sage: A = ShuffleProduct_overlapping_r(w,u,1) + sage: B = ShuffleProduct_overlapping_r(u,w,2) + sage: A != A + False + sage: A != B + True + """ + return not (self == other) + + def __contains__(self, x): + """ + Check containment. + + TESTS:: + + sage: from sage.combinat.shuffle import ShuffleProduct + sage: SP = ShuffleProduct([1,2],[4,5,7]) + sage: [1,4,5,2,7] in SP + True + sage: (1,4,5,2,7) in SP + False + sage: [2,1,4,5,7] in SP + False + """ + return x in self.list() + + +class SetShuffleProduct(ShuffleProduct_abstract): + """ + The union of all possible shuffle products of two sets of iterables. EXAMPLES:: @@ -94,9 +195,7 @@ class SetShuffleProduct(SageObject): [4, 5, 2, 3], [6, 1], [6, 2, 3]] - """ - def __init__(self, l1, l2, element_constructor=None): """ Construct the set of all possible shuffle products of two sets of iterables. @@ -107,35 +206,33 @@ def __init__(self, l1, l2, element_constructor=None): - ``element_constructor`` -- constructor for the returned elements - TESTS:: sage: from sage.combinat.shuffle import SetShuffleProduct - sage: SetShuffleProduct({(1,2,3), (2,3,4)}, {(5,)}) # random + sage: X = SetShuffleProduct({(1,2,3), (2,3,4)}, {(5,)}) + sage: X # random Shuffle set product of: [(2, 3, 4), (1, 2, 3)] and [(5,)] + sage: TestSuite(X).run(skip="_test_an_element") + sage: list(SetShuffleProduct({(1,2,3), (2,3,4)}, {(5,)})) # random - [[2, 3, 4, 5], [2, 5, 3, 4], [5, 2, 3, 4], [2, 3, 5, 4], [1, 2, 3, 5], [1, 5, 2, 3], - [5, 1, 2, 3], [1, 2, 5, 3]] + [[2, 3, 4, 5], [2, 5, 3, 4], [5, 2, 3, 4], [2, 3, 5, 4], + [1, 2, 3, 5], [1, 5, 2, 3], [5, 1, 2, 3], [1, 2, 5, 3]] """ assert(isinstance(l1, Iterable) and - isinstance(l2, Iterable) - ) + isinstance(l2, Iterable)) assert(all(isinstance(elem, Iterable) for elem in l1)) assert(all(isinstance(elem, Iterable) for elem in l2)) - self._l1 = list(l1) - self._l2 = list(l2) - if element_constructor is not None: - self._element_constructor_ = element_constructor - else: + if element_constructor is None: try: e = next(iter(l1)) try: - self._element_constructor_ = e.parent()._element_constructor_ + element_constructor = e.parent()._element_constructor_ except AttributeError: - self._element_constructor_ = list + pass except StopIteration: - self._element_constructor_ = list + pass + ShuffleProduct_abstract.__init__(self, list(l1), list(l2), element_constructor) def _repr_(self): """ @@ -165,9 +262,9 @@ def _ascii_art_(self): """ from sage.typeset.ascii_art import ascii_art - return ascii_art("Set shuffle product of:") * \ - (ascii_art(self._l1) + ascii_art(" and ") + - ascii_art(self._l2)) + return (ascii_art("Set shuffle product of:") * + (ascii_art(self._l1) + ascii_art(" and ") + + ascii_art(self._l2))) def __iter__(self): """ @@ -178,7 +275,7 @@ def __iter__(self): [[], []] sage: list(SetShuffleProduct([[1,2],[3]], [[4]])) [[1, 2, 4], [4, 1, 2], [1, 4, 2], [3, 4], [4, 3]] - sage: list(SetShuffleProduct([[1,2],[3,4]], [[1,4]], element_constructor=set)) #rando + sage: list(SetShuffleProduct([[1,2],[3,4]], [[1,4]], element_constructor=set)) [{1, 2, 4}, {1, 2, 4}, {1, 2, 4}, @@ -193,9 +290,9 @@ def __iter__(self): {1, 3, 4}] """ return itertools.chain.from_iterable( - ShuffleProduct(*pair, - element_constructor=self._element_constructor_) - for pair in itertools.product(self._l1, self._l2)) + ShuffleProduct(*pair, + element_constructor=self._element_constructor_) + for pair in itertools.product(self._l1, self._l2)) def cardinality(self): """ @@ -209,15 +306,15 @@ def cardinality(self): 12 """ def comp_binom(el1, el2): - ll1 = len(el1) - ll2 = len(el2) - return binomial(ll1 + ll2, ll2) + ll1 = Integer(len(el1)) + ll2 = Integer(len(el2)) + return (ll1 + ll2).binomial(ll2) return sum(comp_binom(el1, el2) for (el1, el2) in itertools.product(self._l1, self._l2)) -class ShuffleProduct(SageObject): +class ShuffleProduct(ShuffleProduct_abstract): """ Shuffle product of two iterables. @@ -249,30 +346,26 @@ def __init__(self, l1, l2, element_constructor=None): - ``element_constructor``: constructor for the returned elements - TESTS:: sage: from sage.combinat.shuffle import ShuffleProduct - sage: ShuffleProduct([1,2,3],[4,5]) + sage: SP = ShuffleProduct([1,2,3],[4,5]) + sage: SP Shuffle product of: [1, 2, 3] and [4, 5] + sage: TestSuite(SP).run(skip="_test_an_element") + sage: list(ShuffleProduct(Word("aa"), Word("bbb"), Word)) [word: aabbb, word: baabb, word: ababb, word: bbaab, word: babab, word: abbab, word: bbbaa, word: bbaba, word: babba, word: abbba] - """ - assert(isinstance(l1, Iterable) and - isinstance(l2, Iterable) - ) - self._l1 = list(l1) - self._l2 = list(l2) + assert(isinstance(l1, Iterable) and isinstance(l2, Iterable)) if element_constructor is None: try: - self._element_constructor_ = l1.parent()._element_constructor_ + element_constructor = l1.parent()._element_constructor_ except AttributeError: - self._element_constructor_ = list - else: - self._element_constructor_ = element_constructor + pass + ShuffleProduct_abstract.__init__(self, list(l1), list(l2), element_constructor) def _repr_(self): """ @@ -338,7 +431,7 @@ def __iter__(self): [ o o o ] ] """ - ############ Gray code ############# + # -------------- Gray code -------------- def swap(i, j): l[i - 1], l[j - 1] = l[j - 1], l[i - 1] @@ -427,8 +520,8 @@ def __contains__(self, iterable): def cardinality(self): r""" - Return the number of shuffles of `l_1` and `l_2`, respectively of lengths `m` and - `n`, which is `\binom{m+n}{n}`. + Return the number of shuffles of `l_1` and `l_2`, respectively of + lengths `m` and `n`, which is `\binom{m+n}{n}`. TESTS:: @@ -438,11 +531,12 @@ def cardinality(self): sage: ShuffleProduct([3,1,2,5,6,4], [4,2,1,3]).cardinality() == binomial(10,4) True """ - ll1 = len(self._l1) - ll2 = len(self._l2) - return binomial(ll1 + ll2, ll1) + ll1 = Integer(len(self._l1)) + ll2 = Integer(len(self._l2)) + return (ll1 + ll2).binomial(ll1) -class ShuffleProduct_overlapping_r(CombinatorialClass): + +class ShuffleProduct_overlapping_r(ShuffleProduct_abstract): """ The overlapping shuffle product of the two words ``w1`` and ``w2`` with precisely ``r`` overlaps. @@ -471,28 +565,24 @@ def __init__(self, w1, w2, r, element_constructor=None, add=operator.add): sage: from sage.combinat.shuffle import ShuffleProduct_overlapping_r sage: w, u = map(Words(range(20)), [[2, 9], [9, 1]]) sage: S = ShuffleProduct_overlapping_r(w,u,1) - sage: S == loads(dumps(S)) - True + sage: TestSuite(S).run(skip="_test_an_element") """ - self._w1 = w1 - self._w2 = w2 - self.r = r + self.r = r self.add = add if element_constructor is None: # Special case for words since their parent has a __call__ but # not an _element_constructor_ if isinstance(w1, Word_class): - self._element_constructor_ = w1.parent() + element_constructor = w1.parent() else: try: - self._element_constructor_ = self._w1.parent()._element_constructor_ + element_constructor = w1.parent()._element_constructor_ except AttributeError: - self._element_constructor_ = list - else: - self._element_constructor_ = element_constructor + pass + ShuffleProduct_abstract.__init__(self, w1, w2, element_constructor) - def __repr__(self): + def _repr_(self): """ EXAMPLES:: @@ -501,7 +591,24 @@ def __repr__(self): sage: ShuffleProduct_overlapping_r(w,u,1).__repr__() 'Overlapping shuffle product of word: 29 and word: 91 with 1 overlaps' """ - return "Overlapping shuffle product of %s and %s with %s overlaps"%(repr(self._w1), repr(self._w2), self.r) + return "Overlapping shuffle product of %s and %s with %s overlaps" % (repr(self._l1), repr(self._l2), self.r) + + def __eq__(self, other): + """ + Check equality. + + EXAMPLES:: + + sage: from sage.combinat.shuffle import ShuffleProduct_overlapping_r + sage: w, u = map(Words(range(20)), [[2, 9], [9, 1]]) + sage: A = ShuffleProduct_overlapping_r(w,u,1) + sage: B = ShuffleProduct_overlapping_r(u,w,2) + sage: A == A + True + sage: A == B + False + """ + return ShuffleProduct_abstract.__eq__(self, other) and self.r == other.r def __iter__(self): """ @@ -534,19 +641,19 @@ def __iter__(self): """ EC = self._element_constructor_ - m = len(self._w1) - n = len(self._w2) + m = len(self._l1) + n = len(self._l2) r = self.r add = self.add - wc1, wc2 = self._w1, self._w2 + wc1, wc2 = self._l1, self._l2 - blank = [None] * (m+n-r) - for iv in IntegerVectors(m, m+n-r, max_part=1): + blank = [None] * (m + n - r) + for iv in IntegerVectors(m, m + n - r, max_part=1): w = blank[:] filled_places = [] unfilled_places = [] - #Fill in w1 into the iv slots + # Fill in w1 into the iv slots i = 0 for j in range(len(iv)): if iv[j] == 1: @@ -556,11 +663,11 @@ def __iter__(self): else: unfilled_places.append(j) - #Choose r of these filled places + # Choose r of these filled places for subset in itertools.combinations(filled_places, r): places_to_fill = sorted(unfilled_places + list(subset)) - #Fill in w2 into the places + # Fill in w2 into the places i = 0 res = w[:] for j in places_to_fill: @@ -572,7 +679,8 @@ def __iter__(self): yield EC(res) -class ShuffleProduct_overlapping(CombinatorialClass): + +class ShuffleProduct_overlapping(ShuffleProduct_abstract): r""" The overlapping shuffle product of the two words ``w1`` and ``w2``. @@ -666,27 +774,23 @@ def __init__(self, w1, w2, element_constructor=None, add=operator.add): sage: from sage.combinat.shuffle import ShuffleProduct_overlapping sage: w, u = map(Words(range(20)), [[2, 9], [9, 1]]) sage: S = ShuffleProduct_overlapping(w,u) - sage: S == loads(dumps(S)) - True + sage: TestSuite(S).run(skip="_test_an_element") """ - self._w1 = w1 - self._w2 = w2 self._add = add if element_constructor is None: # Special case for words since their parent has a __call__ but # not an _element_constructor_ if isinstance(w1, Word_class): - self._element_constructor_ = w1.parent() + element_constructor = w1.parent() else: try: - self._element_constructor_ = self._w1.parent()._element_constructor_ + element_constructor = self._l1.parent()._element_constructor_ except AttributeError: - self._element_constructor_ = list - else: - self._element_constructor_ = element_constructor + pass + ShuffleProduct_abstract.__init__(self, w1, w2, element_constructor) - def __repr__(self): + def _repr_(self): """ EXAMPLES:: @@ -695,7 +799,8 @@ def __repr__(self): sage: ShuffleProduct_overlapping(w,u).__repr__() 'Overlapping shuffle product of word: 29 and word: 91' """ - return "Overlapping shuffle product of %s and %s"%(repr(self._w1), repr(self._w2)) + return "Overlapping shuffle product of %s and %s" % (repr(self._l1), + repr(self._l2)) def __iter__(self): """ @@ -716,10 +821,9 @@ def __iter__(self): word: 3412, word: 424, word: 154, word: 442, word: 136, word: 352, word: 316, word: 46] """ - m = len(self._w1) - n = len(self._w2) - for r in range(min(m,n)+1): - for w in ShuffleProduct_overlapping_r(self._w1, self._w2, r, - self._element_constructor_, - add=self._add): - yield w + m = len(self._l1) + n = len(self._l2) + for r in range(min(m, n) + 1): + yield from ShuffleProduct_overlapping_r(self._l1, self._l2, r, + self._element_constructor_, + add=self._add) diff --git a/src/sage/combinat/tableau.py b/src/sage/combinat/tableau.py index 0b60c39ba7c..94cc572bb45 100644 --- a/src/sage/combinat/tableau.py +++ b/src/sage/combinat/tableau.py @@ -93,10 +93,12 @@ from sage.structure.list_clone import ClonableList from sage.structure.parent import Parent from sage.structure.richcmp import richcmp, richcmp_method +from sage.misc.persist import register_unpickle_override from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass from sage.rings.finite_rings.integer_mod_ring import IntegerModRing from sage.rings.infinity import PlusInfinity from sage.arith.all import factorial, binomial +from sage.arith.misc import multinomial from sage.rings.integer import Integer from sage.combinat.composition import Composition, Compositions from sage.combinat.integer_vector import IntegerVectors, integer_vectors_nk_fast_iter @@ -113,6 +115,7 @@ from sage.combinat.combinatorial_map import combinatorial_map from sage.combinat.posets.posets import Poset + @richcmp_method class Tableau(ClonableList, metaclass=InheritComparisonClasscallMetaclass): """ @@ -431,7 +434,7 @@ def _repr_compact(self): """ if not self: return '-' - return '/'.join(','.join('%s'%r for r in row) for row in self) + return '/'.join(','.join('%s' % r for r in row) for row in self) def _ascii_art_(self): """ @@ -740,11 +743,11 @@ def __call__(self, *cell): try: return self[i][j] except IndexError: - raise IndexError("The cell (%d,%d) is not contained in %s"%(i,j,repr(self))) + raise IndexError("The cell (%d,%d) is not contained in %s" % (i, j, repr(self))) def level(self): """ - Returns the level of ``self``, which is always 1. + Return the level of ``self``, which is always 1. This function exists mainly for compatibility with :class:`TableauTuple`. @@ -808,7 +811,6 @@ def corners(self): """ return self.shape().corners() - @combinatorial_map(order=2,name='conjugate') def conjugate(self): """ @@ -1080,9 +1082,10 @@ def inversion_number(self): 0 """ p = self.shape() - return len(self.inversions()) - sum([ p.arm_length(*cell) for cell in self.descents() ]) + return len(self.inversions()) - sum(p.arm_length(*cell) + for cell in self.descents()) - def to_sign_matrix(self, max_entry = None): + def to_sign_matrix(self, max_entry=None): r""" Return the sign matrix of ``self``. @@ -1145,7 +1148,7 @@ def to_sign_matrix(self, max_entry = None): sign_matrix[i,j] = partial_sum_matrix[i,j] - partial_sum_matrix[i-1,j] return sign_matrix - def schuetzenberger_involution(self, n = None, check=True): + def schuetzenberger_involution(self, n=None, check=True): r""" Return the Schuetzenberger involution of the tableau ``self``. @@ -1210,7 +1213,7 @@ def schuetzenberger_involution(self, n = None, check=True): return t @combinatorial_map(order=2,name='evacuation') - def evacuation(self, n = None, check=True): + def evacuation(self, n=None, check=True): r""" Return the evacuation of the tableau ``self``. @@ -1459,7 +1462,7 @@ def entries(self): def entry(self, cell): """ - Returns the entry of cell ``cell`` in the tableau ``self``. Here, + Return the entry of cell ``cell`` in the tableau ``self``. Here, ``cell`` should be given as a tuple `(i,j)` of zero-based coordinates (so the northwesternmost cell in English notation is `(0,0)`). @@ -1596,9 +1599,10 @@ def test(a, b): else: def test(a, b): return a < b + def tworow(a, b): return all(test(a[i], b_i) for i, b_i in enumerate(b)) - return all(tworow(self[r], self[r+1]) for r in range(len(self) - 1)) + return all(tworow(self[r], self[r + 1]) for r in range(len(self) - 1)) def is_column_strict(self): """ @@ -1842,13 +1846,14 @@ def leq(self, secondtab): sage: T.leq(SemistandardTableau(S)) True """ - if not secondtab in Tableaux(): + if secondtab not in Tableaux(): raise TypeError("{} must be a tableau".format(secondtab)) sh = self.shape() if sh != secondtab.shape(): raise TypeError("the tableaux must be the same shape") - return all( self[a][b] <= secondtab[a][b] for a in range(len(self)) - for b in range(len(self[a])) ) + return all(self[a][b] <= secondtab[a][b] + for a in range(len(self)) + for b in range(len(self[a]))) def k_weight(self, k): r""" @@ -2212,13 +2217,13 @@ def _left_schensted_insert(self, letter): i = heights[j-1] while i != h1 and rep[i-1][j-1] >= letter: i += 1 - if i == heights[j-1]: #add on top of column j + if i == heights[j-1]: # add on top of column j if j == 1: rep = [[letter]] + rep else: rep[i-2].append(letter) break - elif i == h1 and j == width: #add on right of line i + elif i == h1 and j == width: # add on right of line i if rep[i-2][j-1] < letter: rep[i-2].append(letter) else: @@ -2845,11 +2850,11 @@ def _heights(self): [1, 3] """ cor = self.corners() - ncor = len(cor) - if ncor == 0: + if not cor: return [] + ncor = len(cor) k = len(self) - cor = [ [k-i,j+1] for i,j in reversed(cor)] + cor = [[k - i, j + 1] for i, j in reversed(cor)] heights = [1]*(cor[0][1]) for i in range(1, ncor): @@ -2952,7 +2957,6 @@ def cocharge(self): """ return self.to_word().cocharge() - def add_entry(self, cell, m): """ Return the result of setting the entry in cell ``cell`` equal @@ -3031,7 +3035,6 @@ def add_entry(self, cell, m): except Exception: return Tableau(tab) - ############## # catabolism # ############## @@ -3124,8 +3127,9 @@ def lambda_catabolism(self, part): sage: t.lambda_catabolism([4,1]) [[3, 3]] """ - #Reduce the partition if it is too big for the tableau - part = [ min(part[i],len(self[i])) for i in range(min(len(self), len(part))) ] + # Reduce the partition if it is too big for the tableau + part = [min(part[i], len(self[i])) + for i in range(min(len(self), len(part)))] if self.shape() == part: return Tableau([]) @@ -3135,10 +3139,9 @@ def lambda_catabolism(self, part): w2 = [] for i,row in enumerate(reversed(self[:m])): - w2 += row[ part[-1-i] : ] - - return Tableau([]).insert_word(w2+w1) + w2 += row[part[-1 - i]:] + return Tableau([]).insert_word(w2 + w1) def reduced_lambda_catabolism(self, part): """ @@ -3272,10 +3275,10 @@ def promotion_operator(self, i): ltab = [ from_chain( chain + [next] ) for next in l ] return [ x.symmetric_group_action_on_values(perm) for x in ltab ] - ################################## # actions on tableaux from words # ################################## + def raise_action_from_words(self, f, *args): """ EXAMPLES:: @@ -3406,7 +3409,6 @@ def atom(self): lres[i] = ll[i] - ll[i-1] return lres - def symmetric_group_action_on_entries(self, w): r""" Return the tableau obtained form this tableau by acting by the @@ -3439,7 +3441,7 @@ def symmetric_group_action_on_entries(self, w): sage: _.category() Category of elements of Tableaux """ - w = w + [i+1 for i in range(len(w), self.size())] #need to ensure that it belongs to Sym_size + w = w + [i + 1 for i in range(len(w), self.size())] # need to ensure that it belongs to Sym_size try: return self.parent()([[w[entry-1] for entry in row] for row in self]) except Exception: @@ -3743,7 +3745,7 @@ def content(self, k, multicharge=[0]): return row.index(k) - r + multicharge[0] except ValueError: pass - raise ValueError("%d does not appear in tableau"%k) + raise ValueError("%d does not appear in tableau" % k) def residue(self, k, e, multicharge=(0,)): r""" @@ -3787,11 +3789,11 @@ def residue(self, k, e, multicharge=(0,)): ValueError: 6 does not appear in the tableau """ for r, row in enumerate(self): - try: - return IntegerModRing(e)(row.index(k) - r + multicharge[0]) - except ValueError: - pass - raise ValueError('%d does not appear in the tableau'%k) + try: + return IntegerModRing(e)(row.index(k) - r + multicharge[0]) + except ValueError: + pass + raise ValueError('%d does not appear in the tableau' % k) def residue_sequence(self, e, multicharge=(0,)): r""" @@ -4218,6 +4220,7 @@ def sulzgruber_correspondence(self): WeakReversePlanePartition) return WeakReversePlanePartition(sulzgruber_correspondence(list(self))) + class SemistandardTableau(Tableau): """ A class to model a semistandard tableau. @@ -4310,10 +4313,10 @@ def __classcall_private__(self, t): raise ValueError('%s is not a tableau' % t) if not all(isinstance(c, (int, Integer)) and c > 0 for row in t for c in row): - raise ValueError("entries must be positive integers"%t) + raise ValueError("entries must be positive integers" % t) if any(row[c] > row[c+1] for row in t for c in range(len(row)-1)): - raise ValueError("The rows of %s are not weakly increasing"%t) + raise ValueError("The rows of %s are not weakly increasing" % t) # If we're still here ``t`` cannot be column strict raise ValueError('%s is not a column strict tableau' % t) @@ -4359,6 +4362,7 @@ def check(self): if not all(row[c] < next[c] for c in range(len(next))): raise ValueError("the entries of each column of a semistandard tableau must be strictly increasing") + class RowStandardTableau(Tableau): """ A class to model a row standard tableau. @@ -4602,9 +4606,9 @@ def dominates(self, t): False """ - t=StandardTableau(t) + t = StandardTableau(t) return all(self.restrict(m).shape().dominates(t.restrict(m).shape()) - for m in range(1,1+self.size())) + for m in range(1, 1 + self.size())) def is_standard(self): """ @@ -4847,7 +4851,7 @@ def promotion(self, n=None): def from_chain(chain): """ - Returns a semistandard tableau from a chain of partitions. + Return a semistandard tableau from a chain of partitions. EXAMPLES:: @@ -4855,16 +4859,17 @@ def from_chain(chain): sage: from_chain([[], [2], [2, 1], [3, 2, 1]]) [[1, 1, 3], [2, 3], [3]] """ - res = [[0]*chain[-1][i] for i in range(len(chain[-1]))] - for i in reversed(range(2, len(chain)+1)): - for j in range(len(chain[i-1])): - for k in range(chain[i-1][j]): + res = [[0] * chain[-1][i] for i in range(len(chain[-1]))] + for i in reversed(range(2, len(chain) + 1)): + for j in range(len(chain[i - 1])): + for k in range(chain[i - 1][j]): res[j][k] = i -1 return Tableau(res) + def from_shape_and_word(shape, w, convention="French"): r""" - Returns a tableau from a shape and word. + Return a tableau from a shape and word. INPUT: @@ -4908,6 +4913,7 @@ def from_shape_and_word(shape, w, convention="French"): res.reverse() return Tableau(res) + class IncreasingTableau(Tableau): """ A class to model an increasing tableau. @@ -5236,6 +5242,7 @@ def dual_K_evacuation(self, ceiling=None): ans = ans.K_bender_knuth(i) return ans + class Tableaux(UniqueRepresentation, Parent): """ A factory class for the various classes of tableaux. @@ -5473,8 +5480,8 @@ def _element_constructor_(self, t): ... ValueError: [[1, 2]] is not an element of Tableaux of size 3. """ - if not t in self: - raise ValueError("%s is not an element of %s."%(t, self)) + if t not in self: + raise ValueError("%s is not an element of %s." % (t, self)) return self.element_class(self, t) @@ -5518,6 +5525,7 @@ def __contains__(self, x): else: return False + class Tableaux_all(Tableaux): def __init__(self): @@ -5543,7 +5551,7 @@ def _repr_(self): def an_element(self): r""" - Returns a particular element of the class. + Return a particular element of the class. TESTS:: @@ -5599,11 +5607,11 @@ def _repr_(self): sage: repr(Tableaux(4)) # indirect doctest 'Tableaux of size 4' """ - return "Tableaux of size %s"%self.size + return "Tableaux of size %s" % self.size def an_element(self): r""" - Returns a particular element of the class. + Return a particular element of the class. TESTS:: @@ -5829,7 +5837,7 @@ def __classcall_private__(cls, *args, **kwargs): else: if shape is not None: raise ValueError( "the shape was specified more than once" ) - shape = args[0] # we check it's a partition later + shape = args[0] # we check it's a partition later if len(args) == 2: # The second non-keyword argument is the weight @@ -5858,8 +5866,7 @@ def __classcall_private__(cls, *args, **kwargs): raise ValueError( "shape must be a (skew) partition" ) if mu is not None: - if (not mu in Compositions()) and\ - (not mu in _Partitions): + if mu not in Compositions() and mu not in _Partitions: raise ValueError( "mu must be a composition" ) mu = Composition(mu) @@ -6047,9 +6054,9 @@ def __contains__(self, t): False """ if isinstance(t, SemistandardTableau): - return self.max_entry is None or \ - len(t) == 0 or \ - max(max(row) for row in t) <= self.max_entry + return (self.max_entry is None or + len(t) == 0 or + max(max(row) for row in t) <= self.max_entry) elif not t: return True elif Tableaux.__contains__(self, t): @@ -6065,6 +6072,7 @@ def __contains__(self, t): else: return False + class SemistandardTableaux_all(SemistandardTableaux, DisjointUnionEnumeratedSets): """ All semistandard tableaux. @@ -6088,11 +6096,12 @@ def __init__(self, max_entry=None): """ if max_entry is not PlusInfinity(): self.max_entry = max_entry - SST_n = lambda n: SemistandardTableaux_size(n, max_entry) - DisjointUnionEnumeratedSets.__init__( self, - Family(NonNegativeIntegers(), SST_n), - facade=True, keepkey = False) + def SST_n(n): + return SemistandardTableaux_size(n, max_entry) + DisjointUnionEnumeratedSets.__init__(self, + Family(NonNegativeIntegers(), SST_n), + facade=True, keepkey=False) else: self.max_entry = None @@ -6107,10 +6116,9 @@ def _repr_(self): Semistandard tableaux with maximum entry 3 """ if self.max_entry is not None: - return "Semistandard tableaux with maximum entry %s"%str(self.max_entry) + return "Semistandard tableaux with maximum entry %s" % str(self.max_entry) return "Semistandard tableaux" - def list(self): """ TESTS:: @@ -6129,7 +6137,7 @@ class SemistandardTableaux_size_inf(SemistandardTableaux): """ def __init__(self, n): r""" - Initializes the class of semistandard tableaux of size ``n`` with no + Initialize the class of semistandard tableaux of size ``n`` with no maximum entry. .. WARNING:: @@ -6143,10 +6151,9 @@ def __init__(self, n): sage: TestSuite(T).run() """ super(SemistandardTableaux_size_inf, self).__init__( - category = InfiniteEnumeratedSets()) + category=InfiniteEnumeratedSets()) self.size = n - def _repr_(self): """ TESTS:: @@ -6154,7 +6161,7 @@ def _repr_(self): sage: repr(SemistandardTableaux(3, max_entry=oo)) # indirect doctest 'Semistandard tableaux of size 3' """ - return "Semistandard tableaux of size %s"%str(self.size) + return "Semistandard tableaux of size %s" % str(self.size) def __contains__(self, t): """ @@ -6213,7 +6220,6 @@ def __iter__(self): yield self.element_class(self, sst) i += 1 - def list(self): """ TESTS:: @@ -6251,7 +6257,6 @@ def __init__(self, p): category=InfiniteEnumeratedSets()) self.shape = p - def __contains__(self, x): """ EXAMPLES:: @@ -6278,8 +6283,7 @@ def _repr_(self): sage: repr(SemistandardTableaux([2,1], max_entry=oo)) # indirect doctest 'Semistandard tableaux of shape [2, 1]' """ - return "Semistandard tableaux of shape %s" %str(self.shape) - + return "Semistandard tableaux of shape %s" % str(self.shape) def __iter__(self): """ @@ -6359,7 +6363,7 @@ def _repr_(self): sage: repr(SemistandardTableaux(3, max_entry=6)) 'Semistandard tableaux of size 3 and maximum entry 6' """ - return "Semistandard tableaux of size %s and maximum entry %s"%(str(self.size), str(self.max_entry)) + return "Semistandard tableaux of size %s and maximum entry %s" % (str(self.size), str(self.max_entry)) def __contains__(self, x): """ @@ -6465,7 +6469,6 @@ def cardinality(self): c += SemistandardTableaux_shape(part, self.max_entry).cardinality() return c - def __iter__(self): """ EXAMPLES:: @@ -6510,6 +6513,7 @@ def __iter__(self): for sst in SemistandardTableaux_shape(part, self.max_entry): yield self.element_class(self, sst) + class SemistandardTableaux_shape(SemistandardTableaux): """ Semistandard tableaux of fixed shape `p` with a given max entry. @@ -6591,7 +6595,6 @@ def __iter__(self): for sst in SemistandardTableaux_shape_weight(self.shape, Composition(c)): yield self.element_class(self, sst) - def __contains__(self, x): """ EXAMPLES:: @@ -6730,6 +6733,7 @@ def cardinality(self, algorithm='hook'): return c raise ValueError("unknown algorithm {}".format(algorithm)) + class SemistandardTableaux_shape_weight(SemistandardTableaux_shape): r""" Semistandard tableaux of fixed shape `p` and weight `\mu`. @@ -6759,7 +6763,7 @@ def _repr_(self): sage: repr(SemistandardTableaux([2,1],[2,1])) # indirect doctest 'Semistandard tableaux of shape [2, 1] and weight [2, 1]' """ - return "Semistandard tableaux of shape %s and weight %s"%(self.shape, self.weight) + return "Semistandard tableaux of shape %s and weight %s" % (self.shape, self.weight) def __contains__(self, x): """ @@ -6794,11 +6798,10 @@ def __contains__(self, x): return True - def cardinality(self): """ - Returns the number of semistandard tableaux of the given shape and - weight, as computed by ``kostka_number`` function of symmetrica. + Return the number of semistandard tableaux of the given shape and + weight, as computed by ``kostka_number`` function of ``symmetrica``. EXAMPLES:: @@ -6811,7 +6814,7 @@ def cardinality(self): sage: SemistandardTableaux([3,2,1], [2, 2, 2]).cardinality() 2 """ - return symmetrica.kostka_number(self.shape,self.weight) + return symmetrica.kostka_number(self.shape, self.weight) def __iter__(self): """ @@ -6826,7 +6829,6 @@ def __iter__(self): for t in symmetrica.kostka_tab(self.shape, self.weight): yield self.element_class(self, t) - def list(self): """ Return a list of all semistandard tableaux in ``self`` generated @@ -6877,7 +6879,7 @@ def _repr_(self): sage: repr(SemistandardTableaux(3, [2,1])) # indirect doctest 'Semistandard tableaux of size 3 and weight [2, 1]' """ - return "Semistandard tableaux of size %s and weight %s"%(self.size, self.weight) + return "Semistandard tableaux of size %s and weight %s" % (self.size, self.weight) def __iter__(self): """ @@ -6896,7 +6898,6 @@ def __iter__(self): for sst in SemistandardTableaux_shape_weight(p, self.weight): yield self.element_class(self, sst) - def cardinality(self): """ Return the cardinality of ``self``. @@ -7094,6 +7095,7 @@ def __contains__(self, x): and all(row[i] < row[i+1] for row in x for i in range(len(row)-1)) ) return False + class RowStandardTableaux_all(RowStandardTableaux, DisjointUnionEnumeratedSets): """ All row standard tableaux. @@ -7212,7 +7214,7 @@ def __contains__(self, x): def an_element(self): r""" - Returns a particular element of the class. + Return a particular element of the class. EXAMPLES:: @@ -7224,7 +7226,8 @@ def an_element(self): elif self._size == 1: return self.element_class(self, [[1]]) else: - return self.element_class(self, [range(1,self._size+1)]) + return self.element_class(self, [range(1,self._size + 1)]) + class RowStandardTableaux_shape(RowStandardTableaux): """ @@ -7335,7 +7338,7 @@ def cardinality(self): sage: RowStandardTableaux([]).cardinality() 1 """ - return Integer( factorial(sum(self.shape)) // prod(factorial(m) for m in self.shape) ) + return Integer(multinomial([m for m in self.shape])) ######################## @@ -7492,6 +7495,7 @@ def __contains__(self, x): )) return False + class StandardTableaux_all(StandardTableaux, DisjointUnionEnumeratedSets): """ All standard tableaux. @@ -7707,7 +7711,7 @@ def random_element(self): # We add the number of involutions with ``fixed_point_number`` # fixed points. partial_sum += binomial(self.size, fixed_point_number) * \ - prod(range(1, self.size - fixed_point_number , 2)) + prod(range(1, self.size - fixed_point_number, 2)) # If the partial sum is greater than the involution index, # then the random involution that we want to generate has # ``fixed_point_number`` fixed points. @@ -7775,7 +7779,7 @@ def _repr_(self): sage: repr(StandardTableaux([2,1,1])) # indirect doctest 'Standard tableaux of shape [2, 1, 1]' """ - return "Standard tableaux of shape %s"%str(self.shape) + return "Standard tableaux of shape %s" % str(self.shape) def cardinality(self): r""" @@ -7829,16 +7833,11 @@ def cardinality(self): - http://mathworld.wolfram.com/HookLengthFormula.html """ pi = self.shape - number = factorial(sum(pi)) - hook = pi.hook_lengths() - - for row in hook: + for row in pi.hook_lengths(): for col in row: - #Divide the hook length by the entry - number /= col - - return Integer(number) + number //= col + return number def __iter__(self): r""" @@ -7975,7 +7974,6 @@ def list(self): """ return [y for y in self] - def random_element(self): """ Return a random standard tableau of the given shape using the @@ -7990,7 +7988,7 @@ def random_element(self): [] """ p = self.shape - t = [[None]*n for n in p] + t = [[None] * n for n in p] # Get the cells in the Young diagram cells = [] @@ -8145,6 +8143,7 @@ def __setstate__(self, state): self.__class__ = Tableau self.__init__(Tableaux(), state['_list']) + ########################## # Increasing tableaux # ########################## @@ -8357,7 +8356,7 @@ def __classcall_private__(cls, *args, **kwargs): else: if shape is not None: raise ValueError("the shape was specified more than once") - shape = args[0] # we check it's a partition later + shape = args[0] # we check it's a partition later if len(args) == 2: # The second non-keyword argument is the weight @@ -8392,10 +8391,10 @@ def __classcall_private__(cls, *args, **kwargs): while k >= 0 and wt[k] == 0: k -= 1 wt = tuple(wt[:k+1]) - if not all(k in [0,1] for k in wt): + if not all(k in [0, 1] for k in wt): raise ValueError("wt must be a binary vector") if max_entry is not None and max_entry != len(wt): - raise ValueError("the maximum entry must match the weight") + raise ValueError("the maximum entry must match the weight") is_inf = bool(max_entry == PlusInfinity()) @@ -8598,6 +8597,7 @@ def __contains__(self, t): return False return self.max_entry is None or max(max(row) for row in t) <= self.max_entry + class IncreasingTableaux_all(IncreasingTableaux, DisjointUnionEnumeratedSets): """ All increasing tableaux. @@ -8655,17 +8655,19 @@ def __init__(self, max_entry=None): sage: T = IncreasingTableaux_all(max_entry=0) sage: TestSuite(T).run() """ - SST_n = lambda n: IncreasingTableaux_size(n, max_entry) + + def SST_n(n): + return IncreasingTableaux_size(n, max_entry) if max_entry is None or max_entry == PlusInfinity(): self.max_entry = None DisjointUnionEnumeratedSets.__init__(self, - Family(NonNegativeIntegers(), SST_n), - facade=True, keepkey=False) + Family(NonNegativeIntegers(), SST_n), + facade=True, keepkey=False) else: self.max_entry = max_entry DisjointUnionEnumeratedSets.__init__(self, - Family(list(range(max_entry+1)), SST_n), - facade=True, keepkey=False) + Family(list(range(max_entry + 1)), SST_n), + facade=True, keepkey=False) def _repr_(self): """ @@ -8678,7 +8680,7 @@ def _repr_(self): Increasing tableaux with maximum entry 3 """ if self.max_entry is not None: - return "Increasing tableaux with maximum entry %s"%str(self.max_entry) + return "Increasing tableaux with maximum entry %s" % str(self.max_entry) return "Increasing tableaux" @@ -8952,6 +8954,7 @@ def __iter__(self): for sst in IncreasingTableaux_shape(part, self.max_entry): yield self.element_class(self, sst) + class IncreasingTableaux_shape(IncreasingTableaux): """ Increasing tableaux of fixed shape `p` with a given max entry. @@ -9078,6 +9081,7 @@ def _repr_(self): """ return "Increasing tableaux of shape %s and maximum entry %s" % (str(self.shape), str(self.max_entry)) + class IncreasingTableaux_shape_weight(IncreasingTableaux_shape): r""" Increasing tableaux of fixed shape `p` and binary weight `wt`. @@ -9294,12 +9298,11 @@ def __contains__(self, x): # October 2012: fixing outdated pickles which use classed being deprecated -from sage.misc.persist import register_unpickle_override -register_unpickle_override('sage.combinat.tableau', 'Tableau_class', Tableau_class) -register_unpickle_override('sage.combinat.tableau', 'Tableaux_n', Tableaux_size) -register_unpickle_override('sage.combinat.tableau', 'StandardTableaux_n', StandardTableaux_size) -register_unpickle_override('sage.combinat.tableau', 'StandardTableaux_partition', StandardTableaux_shape) -register_unpickle_override('sage.combinat.tableau', 'SemistandardTableaux_n', SemistandardTableaux_size) -register_unpickle_override('sage.combinat.tableau', 'SemistandardTableaux_p', SemistandardTableaux_shape) -register_unpickle_override('sage.combinat.tableau', 'SemistandardTableaux_nmu', SemistandardTableaux_size_weight) -register_unpickle_override('sage.combinat.tableau', 'SemistandardTableaux_pmu', SemistandardTableaux_shape_weight) +register_unpickle_override('sage.combinat.tableau', 'Tableau_class', Tableau_class) +register_unpickle_override('sage.combinat.tableau', 'Tableaux_n', Tableaux_size) +register_unpickle_override('sage.combinat.tableau', 'StandardTableaux_n', StandardTableaux_size) +register_unpickle_override('sage.combinat.tableau', 'StandardTableaux_partition', StandardTableaux_shape) +register_unpickle_override('sage.combinat.tableau', 'SemistandardTableaux_n', SemistandardTableaux_size) +register_unpickle_override('sage.combinat.tableau', 'SemistandardTableaux_p', SemistandardTableaux_shape) +register_unpickle_override('sage.combinat.tableau', 'SemistandardTableaux_nmu', SemistandardTableaux_size_weight) +register_unpickle_override('sage.combinat.tableau', 'SemistandardTableaux_pmu', SemistandardTableaux_shape_weight) diff --git a/src/sage/combinat/tiling.py b/src/sage/combinat/tiling.py index 797cc3159a6..025adfe7d58 100644 --- a/src/sage/combinat/tiling.py +++ b/src/sage/combinat/tiling.py @@ -60,7 +60,7 @@ Scott's pentamino problem ------------------------- -As mentionned in the introduction of [Knuth1]_, Scott's pentamino problem +As mentioned in the introduction of [Knuth1]_, Scott's pentamino problem consists in tiling a chessboard leaving the center four squares vacant with the 12 distinct pentaminoes. @@ -319,21 +319,21 @@ def ncube_isometry_group(n, orientation_preserving=True): sage: ncube_isometry_group(3) [ - [1 0 0] [ 1 0 0] [ 0 1 0] [ 0 0 -1] [ 1 0 0] [ 0 1 0] - [0 1 0] [ 0 0 1] [ 0 0 -1] [ 0 -1 0] [ 0 0 -1] [-1 0 0] - [0 0 1], [ 0 -1 0], [-1 0 0], [-1 0 0], [ 0 1 0], [ 0 0 1], + [1 0 0] [ 1 0 0] [ 1 0 0] [ 0 1 0] [0 1 0] [ 0 0 1] + [0 1 0] [ 0 0 1] [ 0 0 -1] [-1 0 0] [0 0 1] [ 0 -1 0] + [0 0 1], [ 0 -1 0], [ 0 1 0], [ 0 0 1], [1 0 0], [ 1 0 0], - [ 1 0 0] [ 0 0 1] [0 1 0] [ 0 0 1] [ 0 0 -1] [ 0 -1 0] - [ 0 -1 0] [-1 0 0] [0 0 1] [ 0 -1 0] [-1 0 0] [-1 0 0] - [ 0 0 -1], [ 0 -1 0], [1 0 0], [ 1 0 0], [ 0 1 0], [ 0 0 -1], + [-1 0 0] [ 0 -1 0] [-1 0 0] [-1 0 0] [ 0 -1 0] [ 0 0 -1] + [ 0 -1 0] [ 0 0 -1] [ 0 0 -1] [ 0 1 0] [ 0 0 1] [ 1 0 0] + [ 0 0 1], [ 1 0 0], [ 0 -1 0], [ 0 0 -1], [-1 0 0], [ 0 -1 0], - [ 0 1 0] [ 0 0 1] [ 0 0 -1] [ 0 -1 0] [0 0 1] [ 0 -1 0] - [ 1 0 0] [ 0 1 0] [ 1 0 0] [ 0 0 1] [1 0 0] [ 1 0 0] - [ 0 0 -1], [-1 0 0], [ 0 -1 0], [-1 0 0], [0 1 0], [ 0 0 1], + [ 0 1 0] [ 0 0 1] [0 0 1] [ 0 -1 0] [ 0 0 -1] [-1 0 0] + [ 1 0 0] [ 0 1 0] [1 0 0] [ 1 0 0] [ 0 1 0] [ 0 0 1] + [ 0 0 -1], [-1 0 0], [0 1 0], [ 0 0 1], [ 1 0 0], [ 0 1 0], - [-1 0 0] [-1 0 0] [ 0 0 -1] [-1 0 0] [ 0 -1 0] [-1 0 0] - [ 0 1 0] [ 0 0 -1] [ 0 1 0] [ 0 0 1] [ 0 0 -1] [ 0 -1 0] - [ 0 0 -1], [ 0 -1 0], [ 1 0 0], [ 0 1 0], [ 1 0 0], [ 0 0 1] + [ 0 -1 0] [ 0 0 -1] [ 0 0 1] [ 1 0 0] [ 0 0 -1] [ 0 1 0] + [-1 0 0] [-1 0 0] [-1 0 0] [ 0 -1 0] [ 0 -1 0] [ 0 0 -1] + [ 0 0 -1], [ 0 1 0], [ 0 -1 0], [ 0 0 -1], [-1 0 0], [-1 0 0] ] TESTS:: diff --git a/src/sage/combinat/words/finite_word.py b/src/sage/combinat/words/finite_word.py index dc345e2b649..b70d44fe911 100644 --- a/src/sage/combinat/words/finite_word.py +++ b/src/sage/combinat/words/finite_word.py @@ -547,7 +547,7 @@ def content(self, n=None): OUTPUT: - - a list where the `i`-th entry indiciates the multiplicity + - a list where the `i`-th entry indicates the multiplicity of the `i`-th letter in the alphabet in ``self`` EXAMPLES:: diff --git a/src/sage/combinat/words/suffix_trees.py b/src/sage/combinat/words/suffix_trees.py index 9a61e4e4b36..351bfa7e04e 100644 --- a/src/sage/combinat/words/suffix_trees.py +++ b/src/sage/combinat/words/suffix_trees.py @@ -1694,7 +1694,7 @@ def treat_node(current_node, parent): OUTPUT: The resulting list P(current_node) with current_node have been - processed by ``node_processing``. The ouput is a pair ``(i, + processed by ``node_processing``. The output is a pair ``(i, pos)`` such that ``P[i][pos:]`` is the list of current_node. """ @@ -1781,15 +1781,15 @@ def walk_chain(u, v, l, start): def treat_node(current_node, i, j): r""" - Execute a depht-first search on self and start a suffix walk for - labeled points on each edges of T. The fonction is recursive, call + Execute a depth-first search on self and start a suffix walk for + labeled points on each edges of T. The function is recursive, call treat_node(0,0,0) to initiate the search. INPUT: - ``current_node`` - The node to treat - ``(i, j)`` - Pair of index such that the path from 0 to - ``current_node`` reads ``self.word()[i:j]`` + ``current_node`` reads ``self.word()[i:j]`` """ if current_node in D: diff --git a/src/sage/databases/findstat.py b/src/sage/databases/findstat.py index 17bb19eb2b5..79ea0744f93 100644 --- a/src/sage/databases/findstat.py +++ b/src/sage/databases/findstat.py @@ -197,14 +197,14 @@ def mapping(sigma): ------------------- """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2015 Martin Rubey , # # Distributed under the terms of the GNU General Public License (GPL) # as published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** from sage.misc.lazy_list import lazy_list from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass from sage.structure.element import Element @@ -1245,7 +1245,7 @@ def findmap(*args, **kwargs): 0: Mp00146 (quality [100]) sage: findmap("Dyck paths", "Set partitions", lambda D: [(a+1, b) for a,b in D.tunnels()]) # optional -- internet - 0: Mp00092oMp00146 (quality [50]) + 0: Mp00092oMp00146 (quality [...]) Finally, we can also retrieve all maps with a given domain or codomain:: @@ -3476,7 +3476,6 @@ def __init__(self, data=None, values_of=None, distribution_of=None, function=function) Element.__init__(self, FindStatMaps()) # this is not completely correct, but it works - def __repr__(self): """ Return a string representation of the query. diff --git a/src/sage/databases/oeis.py b/src/sage/databases/oeis.py index 75ec5aacab7..ee8f31a75c4 100644 --- a/src/sage/databases/oeis.py +++ b/src/sage/databases/oeis.py @@ -987,7 +987,7 @@ def keywords(self): A000053: Local stops on New York City Broadway line (IRT #1) subway. sage: f.keywords() # optional -- internet - ('nonn', 'fini', 'full') + ('nonn', 'fini', ...) TESTS:: diff --git a/src/sage/env.py b/src/sage/env.py index c896b76114b..4d28659d7ee 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -192,7 +192,6 @@ def var(key, *fallbacks, **kwds): var('CREMONA_MINI_DATA_DIR', join(SAGE_SHARE, 'cremona')) var('CREMONA_LARGE_DATA_DIR', join(SAGE_SHARE, 'cremona')) var('JMOL_DIR', join(SAGE_SHARE, 'jmol')) -var('JSMOL_DIR', join(SAGE_SHARE, 'jsmol')) var('MATHJAX_DIR', join(SAGE_SHARE, 'mathjax')) var('MTXLIB', join(SAGE_SHARE, 'meataxe')) var('THREEJS_DIR', join(SAGE_SHARE, 'threejs')) diff --git a/src/sage/ext_data/threejs/threejs_template.html b/src/sage/ext_data/threejs/threejs_template.html index 150f7aee9f7..c9f2726a894 100644 --- a/src/sage/ext_data/threejs/threejs_template.html +++ b/src/sage/ext_data/threejs/threejs_template.html @@ -1,7 +1,7 @@ - +SAGE_TITLE