Skip to content

Commit

Permalink
Trac #30351: Fix building html documentation on macOS
Browse files Browse the repository at this point in the history
Building html documentation fails on macOS for Sage 9.2.beta8.

Initial report:

- [https://groups.google.com/d/msg/sage-release/spalYgXKr-4/gXp_2tsNBwAJ
sage-release, 2020-08-13]

URL: https://trac.sagemath.org/30351
Reported by: slelievre
Ticket author(s): Dima Pasechnik
Reviewer(s): John Palmieri
  • Loading branch information
Release Manager committed Aug 26, 2020
2 parents 1b006e1 + 4b11a70 commit f9f2bfd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
7 changes: 7 additions & 0 deletions build/bin/sage-site
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ if [ "$1" = "-docbuild" -o "$1" = "--docbuild" ]; then
# cause the build to hang. If stdin is /dev/null, TeX just aborts.
shift
export LANG=C # to ensure it is possible to scrape out non-EN locale warnings

# See #30351: bugs in macOS implementations of openblas/libgopm can cause
# docbuild to hang if multiple OpenMP threads are allowed.
if [ `uname` = 'Darwin' ]; then
export OMP_NUM_THREADS=1
fi

exec sage-python -m sage_setup.docbuild "$@" </dev/null
fi

Expand Down
9 changes: 6 additions & 3 deletions src/bin/sage-runtests
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,13 @@ if __name__ == "__main__":
# cause us to run out of physical memory, leading to system
# instability (as opposed to virtual memory allocs failing)
options.memlimit = -1

# Limit the number of threads to 2 to save system resources.
# See Trac #23713 and #23892
os.environ["OMP_NUM_THREADS"] = "2"
# See Trac #23713, #23892, #30351
if sys.platform == 'darwin':
os.environ["OMP_NUM_THREADS"] = "1"
else:
os.environ["OMP_NUM_THREADS"] = "2"

os.environ["SAGE_NUM_THREADS"] = "2"

from sage.doctest.control import DocTestController
Expand Down
2 changes: 1 addition & 1 deletion src/sage_setup/docbuild/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def build_many(target, args, processes=None):
WorkerDiedException: worker for 4 died with non-zero exit code -9
"""
from multiprocessing import Process, Queue, cpu_count
from six.moves.queue import Empty
from queue import Empty

if processes is None:
processes = cpu_count()
Expand Down

0 comments on commit f9f2bfd

Please sign in to comment.