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

Commit

Permalink
Merge branch 'develop' into t/24889/enumerate_all_genera_of_given_sig…
Browse files Browse the repository at this point in the history
…nature__determinant_and_bounded_scale_of_a_jordan_block_

Conflicts:
	src/sage/quadratic_forms/genera/genus.py
  • Loading branch information
Simon Brandhorst committed Jun 18, 2018
2 parents 1701994 + 8a6bc91 commit add11fa
Show file tree
Hide file tree
Showing 855 changed files with 35,086 additions and 12,279 deletions.
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE.md
@@ -0,0 +1,3 @@
Unfortunately we are not accepting issues on GitHub yet. To report an issue,
please head over to https://trac.sagemath.org, log in with your GitHub account,
and create a ticket there :)
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,8 @@
Thanks for contributing to Sage! Unfortunately we are not accepting pull
requests on GitHub yet. To propose a change to Sage, please log in with your
GitHub account at https://trac.sagemath.org, create a ticket, and push your
changes to that ticket as explained in our
[Developer's Guide](https://doc.sagemath.org/html/en/developer/manual_git.html).

Please make sure to also have a look at our
[Code Style Conventions](https://doc.sagemath.org/html/en/developer/coding_basics.html).
502 changes: 224 additions & 278 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion VERSION.txt
@@ -1 +1 @@
SageMath version 8.3.beta1, Release Date: 2018-05-14
SageMath version 8.3.beta6, Release Date: 2018-06-17
77 changes: 59 additions & 18 deletions build/bin/sage-spkg
Expand Up @@ -167,11 +167,13 @@ if [ -z "$SAGE_BUILD_DIR" ]; then
export SAGE_BUILD_DIR="$SAGE_LOCAL/var/tmp/sage/build"
fi

mkdir -p "$SAGE_SPKG_INST"
if [ $? -ne 0 ]; then
error_msg "Error creating directory $SAGE_SPKG_INST"
exit 1
fi
for dir in "$SAGE_SPKG_INST" "$SAGE_SPKG_SCRIPTS"; do
mkdir -p "$dir"
if [ $? -ne 0 ]; then
error_msg "Error creating directory $dir"
exit 1
fi
done


# Remove '.' from PYTHONPATH, which may also come from SAGE_PATH, to avoid
Expand Down Expand Up @@ -660,7 +662,7 @@ cd ..
# passed in as an absolute path.
write_script_wrapper() {
local script="$1"
local pkgdir="$(dirname "$script")"
local script_dir="$2"

trap "echo >&2 Error: Unexpected error writing wrapper script for $script; exit \$_" ERR

Expand All @@ -676,7 +678,7 @@ write_script_wrapper() {
export SAGE_ROOT="$SAGE_ROOT"
export SAGE_SRC="$SAGE_SRC"
export SAGE_PKG_DIR="$pkgdir"
export SAGE_PKG_DIR="$script_dir"
export PKG_NAME="$PKG_NAME"
export PKG_BASE="$PKG_BASE"
Expand Down Expand Up @@ -714,8 +716,22 @@ __EOF__
}


for script in build install check postinst; do
WRAPPED_SCRIPTS="build install check postinst legacy-uninstall prerm postrm"
INSTALLED_SCRIPTS="prerm postrm"


for script in $WRAPPED_SCRIPTS; do
# 'Installed' scripts are not run immediately out of the package build
# directory, and may be run later, so set their root directory to
# $SAGE_ROOT
if echo "$INSTALLED_SCRIPTS" | grep -w "$script" > /dev/null; then
script_dir="$SAGE_ROOT"
else
script_dir="$(pwd)"
fi

script="spkg-$script"

if [ -f "$script" ]; then
if [ "$USE_LOCAL_SCRIPTS" = "yes" ]; then
if [ -x "$script" ]; then
Expand All @@ -731,7 +747,7 @@ for script in build install check postinst; do
fi
fi

write_script_wrapper $(pwd)/"$script"
write_script_wrapper "$(pwd)/$script" "$script_dir"
else
if [ ! -x "$script" ]; then
echo >&2 "WARNING: $script is not executable, making it executable"
Expand Down Expand Up @@ -787,12 +803,6 @@ echo "C compiler version:"
$CC -v
echo "****************************************************"

##################################################################
# Remove install markers for any other versions of this spkg.
##################################################################

rm -f "$SAGE_SPKG_INST/$PKG_BASE-"*

##################################################################
# Poison the proxy variable to forbid downloads in spkg-install
##################################################################
Expand Down Expand Up @@ -858,6 +868,10 @@ else
fi
fi

# We are now ready to install the new package files into $SAGE_LOCAL, so first
# uninstall the previous version of this package, if any
sage-spkg-uninstall "$PKG_BASE"

# All spkgs should eventually support this, but fall back on old behavior in
# case DESTDIR=$SAGE_DESTDIR installation was not used
echo "Copying package files from temporary location $SAGE_DESTDIR to $SAGE_LOCAL"
Expand All @@ -873,7 +887,7 @@ if [ -d "$SAGE_DESTDIR" ]; then
# Generate installed file manifest
FILE_LIST=""
FIRST=1
IFS=$'\n'
old_IFS="$IFS"; IFS=$'\n'
for filename in $(find "$PREFIX" -type f -o -type l | sort); do
filename="${filename#$PREFIX}"
if [ $FIRST -eq 1 ]; then
Expand All @@ -888,26 +902,53 @@ if [ -d "$SAGE_DESTDIR" ]; then
fi
$SAGE_SUDO mv "$PREFIX$filename" "${SAGE_LOCAL%/}/$filename"
if [ $? -ne 0 ]; then
error_msg "Error moving files for $PKG_BASE."
error_msg "Error moving files for $PKG_NAME."
exit 1
fi
done
IFS="$old_IFS"

# Remove the $SAGE_DESTDIR entirely once all files have been moved to their
# final location.
rm -rf "$SAGE_DESTDIR"
fi


# At this stage the path in $SAGE_DESTDIR no longer exists, so the variable
# should be unset
unset SAGE_DESTDIR
unset SAGE_DESTDIR_LOCAL


# Some spkg scripts, if they exist, should also be installed to
# $SAGE_SPKG_SCRIPTS; they are not included in the package's manifest, but are
# removed by sage-spkg-uninstall
INSTALLED_SCRIPTS_DEST="$SAGE_SPKG_SCRIPTS/$PKG_BASE"
for script in $INSTALLED_SCRIPTS; do
script="spkg-$script"

if [ -f "$script" ]; then
mkdir -p "$INSTALLED_SCRIPTS_DEST"
if [ $? -ne 0 ]; then
error_msg "Error creating the spkg scripts directory $INSTALLED_SCRIPTS_DEST."
exit 1
fi

cp -a "$script" "$INSTALLED_SCRIPTS_DEST"
if [ $? -ne 0 ]; then
error_msg "Error copying the $script script to $INSTALLED_SCRIPTS_DEST."
exit 1
fi
fi
done


# Run the post-install script, if any
if [ -f spkg-postinst ]; then
echo "Running post-install script for $PKG_NAME."
time $SAGE_SUDO ./spkg-postinst
if [ $? -ne 0 ]; then
error_msg "Error running the postinst script for $PKG_BASE."
error_msg "Error running the postinst script for $PKG_NAME."
exit 1
fi
fi
Expand Down
25 changes: 25 additions & 0 deletions build/bin/sage-spkg-uninstall
@@ -0,0 +1,25 @@
#!/usr/bin/env python

# usage: sage-spkg-uninstall [-h] PKG [SAGE_LOCAL]
#
# Uninstall a Sage spkg installed in SAGE_LOCAL by removing all files
# associated with that package.
#
# positional arguments:
# PKG the name of the package to uninstall
# FILE the path to SAGE_LOCAL (default: value of the $SAGE_LOCAL
# environment variable if set; exits otherwise)
#
# optional arguments:
# -h, --help show this help message and exit


try:
import sage_bootstrap
except ImportError:
import os, sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import sage_bootstrap

from sage_bootstrap.uninstall import run
run()
6 changes: 3 additions & 3 deletions build/make/Makefile.in
Expand Up @@ -63,7 +63,6 @@ OPTIONAL_INSTALLED_PACKAGE_INSTS = \

# All packages which should be downloaded
SDIST_PACKAGES = @SAGE_SDIST_PACKAGES@
SDIST_PACKAGE_INSTS = $(foreach pkgname,$(SDIST_PACKAGES),$(inst_$(pkgname)))

SCRIPTS = @SAGE_SCRIPTS@

Expand Down Expand Up @@ -145,7 +144,7 @@ pkg_deps = \
# <pkgname>: $(INST)/<pkgname>-<pkgvers>
#
# <pkgname>-clean:
# rm -rf $(INST)/<pkgname>-<pkgvers>
# sage-spkg-uninstall <pkgname> '$(SAGE_LOCAL)'
#
# For example, for python2 this will expand to:
#
Expand All @@ -155,7 +154,7 @@ pkg_deps = \
# python2: $(INST)/python2-2.7.14
#
# python2-clean:
# rm -rf $(INST)/python2-2.7.14
# sage-spkg-uninstall python2 '$(SAGE_LOCAL)'
#
# Note: In these rules the $(INST)/<pkgname>-<pkgvers> target is used
# explicitly, rather than expanding the $(inst_<pkgname>) variable, since
Expand All @@ -174,6 +173,7 @@ $$(INST)/$(1)-$(2): $(3)
$(1): $$(INST)/$(1)-$(2)

$(1)-clean:
sage-spkg-uninstall $(1) '$$(SAGE_LOCAL)'
rm -rf $$(INST)/$(1)-$(2)

endef
Expand Down
4 changes: 2 additions & 2 deletions build/make/deps
Expand Up @@ -60,9 +60,9 @@ all-sage: \

# Download all packages which should be inside an sdist tarball (the -B
# option to make forces all targets to be built unconditionally)
download-for-sdist: base
download-for-sdist:
env SAGE_INSTALL_FETCH_ONLY=yes $(MAKE) -B SAGERUNTIME= \
$(SDIST_PACKAGE_INSTS)
$(SDIST_PACKAGES)

# TOOLCHAIN consists of dependencies determined by configure.
# These are built after the "base" target but before anything else.
Expand Down
3 changes: 2 additions & 1 deletion build/make/install
Expand Up @@ -19,7 +19,8 @@ export SAGE_SHARE="$SAGE_LOCAL/share"
export SAGE_EXTCODE="$SAGE_SHARE/sage/ext"
export SAGE_LOGS="$SAGE_ROOT/logs/pkgs"
export SAGE_SPKG_INST="$SAGE_LOCAL/var/lib/sage/installed"
export SAGE_VERSION=`cat $SAGE_ROOT/VERSION.txt | sed 's+.*\ \(.*\),.*+\1+'`
. "$SAGE_SRC"/bin/sage-version.sh
export SAGE_VERSION

if [ -z "${SAGE_ORIG_PATH_SET}" ]; then
SAGE_ORIG_PATH=$PATH && export SAGE_ORIG_PATH
Expand Down
59 changes: 27 additions & 32 deletions build/pkgs/atlas/patches/atlas-config
Expand Up @@ -22,7 +22,7 @@ def pid_exists(pid):
return False
try:
os.kill(pid, 0)
except OSError, e:
except OSError as e:
return e.errno == errno.EPERM
else:
return True
Expand All @@ -39,11 +39,11 @@ def unthrottle_posix(pid):
f.write('performance')

def signal_handler(signum, frame):
print 'Signal hanadler called with signal', signum
print('Signal handler called with signal', signum)
for cpu, governor in zip(cpus, scaling_governor):
with open(cpu, 'w') as f:
f.write(governor)
print 'Reverted throttling to the previous behaviour.'
print('Reverted throttling to the previous behaviour.')
sys.exit(0)

signal.signal(signal.SIGPIPE, signal_handler)
Expand All @@ -63,7 +63,8 @@ def unthrottle(pid):
if os.name == 'posix':
unthrottle_posix(pid)
else:
print 'I don\'t know how to unthrottle your system ('+platform.system()+')'
print('I don\'t know how to unthrottle your system (' +
platform.system() + ')')
sys.exit(3)


Expand All @@ -81,29 +82,30 @@ def is_throttled():
if os.name == 'posix':
return is_throttled_posix()
else:
print 'I don\'t know how to unthrottle your system ('+platform.system()+')'
print('I don\'t know how to unthrottle your system (' +
platform.system() + ')')
sys.exit(3)


def check_root():
if os.name == 'posix':
if os.getuid() == 0:
return
print '\nError: You need to be root to (un)throttle the CPU.\n'
print('\nError: You need to be root to (un)throttle the CPU.\n')
sys.exit(1)
else:
print 'I don\'t know how to probe administrator rights on your system ('+platform.system()+')'
print('I don\'t know how to probe administrator rights on your system ('+platform.system()+')')
sys.exit(3)


def check_nonroot():
if os.name == 'posix':
if os.getuid() > 0:
return
print '\nError: You are crazy to run this as root, exiting.\n'
print('\nError: You are crazy to run this as root, exiting.\n')
sys.exit(2)
else:
print 'I don\'t know how to probe administrator rights on your system ('+platform.system()+')'
print('I don\'t know how to probe administrator rights on your system ('+platform.system()+')')
sys.exit(3)


Expand All @@ -123,14 +125,14 @@ atexit.register(wait_for_command)
def unthrottle_self():
if os.name == 'posix':
global command
print 'Running sudo atlas-config --unthrottle to turn CPU throttling off.'
print('Running sudo atlas-config --unthrottle to turn CPU throttling off.')
command = subprocess.Popen(['sudo', os.path.abspath( __file__ ),
'--unthrottle', str(os.getpid())])
else:
print 'I don\'t know how to unthrottle your system ('+platform.system()+')'
print('I don\'t know how to unthrottle your system ('+platform.system()+')')
sys.exit(2)

print 'Waiting for CPU throttling to be turned off...'
print('Waiting for CPU throttling to be turned off...')
while is_throttled():
time.sleep(1)

Expand All @@ -147,35 +149,28 @@ if __name__ == '__main__':
unthrottle_self()
print
if os.environ.get('SAGE_FAT_BINARY', 'no') == 'yes':
print 'Building ATLAS with SAGE_FAT_BINARY (generic archdefs).'
elif os.environ.has_key('SAGE_ATLAS_ARCH'):
print 'Building ATLAS with SAGE_ATLAS_ARCH =', os.environ['SAGE_ATLAS_ARCH']
print('Building ATLAS with SAGE_FAT_BINARY (generic archdefs).')
elif 'SAGE_ATLAS_ARCH' in os.environ:
print('Building ATLAS with SAGE_ATLAS_ARCH =', os.environ['SAGE_ATLAS_ARCH'])
else:
print 'Building ATLAS without specifying architecture.'
print 'This may take many hours during which you should leave the computer otherwise'
print 'idle to obtain accurate timings.'
print('Building ATLAS without specifying architecture.')
print('This may take many hours during which you should leave the computer otherwise')
print('idle to obtain accurate timings.')
if args.archdef:
os.environ['SAGE_ATLAS_SAVE_ARCHDEF'] = os.getcwd()
print 'The resulting <archdef>.tar.bz2 will be saved in '+os.getcwd()
print
print 'You have 5 seconds to interrupt...'
print('The resulting <archdef>.tar.bz2 will be saved in ' + os.getcwd())
print()
print('You have 5 seconds to interrupt...')
time.sleep(1)
print 'You have 4 seconds to interrupt...'
print('You have 4 seconds to interrupt...')
time.sleep(1)
print 'You have 3 seconds to interrupt...'
print('You have 3 seconds to interrupt...')
time.sleep(1)
print 'You have 2 seconds to interrupt...'
print('You have 2 seconds to interrupt...')
time.sleep(1)
print 'You have 1 second to interrupt...'
print('You have 1 second to interrupt...')
time.sleep(1)

sys.stdout.flush()
sys.stderr.flush()
os.system('sage -f atlas')







2 changes: 1 addition & 1 deletion build/pkgs/brial/dependencies
@@ -1,4 +1,4 @@
boost_cropped m4ri libpng pkgconf $(PYTHON) | pip
boost_cropped m4ri libpng $(PYTHON) | pip pkgconf

----------
All lines of this file are ignored except the first.
Expand Down

0 comments on commit add11fa

Please sign in to comment.