Ticket #11959: trac_11959-root.patch

File trac_11959-root.patch, 8.2 KB (added by John Palmieri, 11 years ago)

root repo

  • .hgignore

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1319741907 25200
    # Node ID 30adf37635edff045a26af1d83e3ae56d67a9b7c
    # Parent  63ec78ff119b55fcee239ba2e1e5a3c3a06a09cc
    #11959: make Sage build spkgs in parallel by default:
    eliminate the variable SAGE_PARALLEL_SPKG_BUILD
    
    diff --git a/.hgignore b/.hgignore
    a b sage-python 
    2222Makefile.old
    2323VERSION.txt
    2424^spkg-install$
     25spkg/parallel_make.cfg
  • Makefile

    diff --git a/Makefile b/Makefile
    a b all: doc # (already) indirectly depends  
    4545build: $(PIPE)
    4646        cd spkg && "../$(PIPE)" "./install all 2>&1" "tee -a ../install.log"
    4747
     48build-serial: SAGE_PARALLEL_SPKG_BUILD = no
     49build-serial: build
     50
    4851# You can choose to have the built HTML version of the documentation link to
    4952# the PDF version. To do so, you need to build both the HTML and PDF versions.
    5053# To have the HTML version link to the PDF version, do
    install: 
    155158        cd $(DESTDIR)/bin/; ./sage -c
    156159
    157160
    158 .PHONY: all build doc doc-html doc-html-jsmath doc-pdf \
     161.PHONY: all build build-serial doc doc-html doc-html-jsmath doc-pdf \
    159162        doc-clean clean distclean \
    160163        test check testoptional testlong ptest ptestall ptestlong \
    161164        install testall ptestoptional
  • README.txt

    diff --git a/README.txt b/README.txt
    a b 2. Install build dependencies. 
    168168   installed when you install the programs listed above.
    169169
    1701703. Extract the Sage source tarball and cd into a directory with no
    171    spaces in it. If you have a machine with 4 processors, say, type the
    172    following to configure the build script to perform a parallel
     171   spaces in it. If you have a machine with 4 processors, say, type
     172   the following to configure the build script to perform a parallel
    173173   compilation of Sage using 4 jobs:
    174174
    175175       export MAKE="make -j4"
    176176
    177    By default the above will only parallelize a small part of the build
    178    process. To make the spkg build part of the installation process
    179    parallel do:
     177   (With 4 processors, you might also consider "-j5" or "-j6" --
     178   building with more jobs than CPU cores can speed things up.)
     179   You might in addition pass a "-l" flag to "make": this
     180   sets a load limit, so for example if you execute
    180181
    181        export SAGE_PARALLEL_SPKG_BUILD="yes"
     182       export MAKE="make -j4 -l2.5"
    182183
    183    The amount of processors used for the building of the spkg's is
    184    determined by what you assigned to MAKE. So the above is useless if
    185    you did export MAKE="make -j1".
     184   then "make" won't start more than one job at a time if the system
     185   load average is above 2.5.  See
     186   http://www.gnu.org/software/make/manual/make.html#Options-Summary
     187   and http://www.gnu.org/software/make/manual/make.html#Parallel.
    186188
    187189   If you want to run the test suite for each individual spkg as it is
    188190   installed, type:
    10. OPTIONAL: It is recommended that you 
    244246    plotting functionality benefits from it.
    245247
    246248
     249PROBLEMS
     250--------
     251
     252If you have problems building Sage, check the Sage Installation Guide,
     253and also note the following.  Each separate component of Sage is
     254contained in an spkg; these are stored in spkg/standard/.  As each one
     255is built, a build log is stored in spkg/logs/, so you can browse these
     256to find error messages.  If an spkg fails to build, the whole build
     257process will stop soon after, so check the most recent log files
     258first, or run
     259
     260   grep "An error occurred" spkg/logs/*
     261
     262from the top-level Sage directory to find log files with error
     263messages in them.  Send (a small part of) the relevant log file to the
     264sage-devel mailing list, making sure to include at least some of the
     265error messages; probably someone there will have some helpful
     266suggestions.
     267
     268
    247269SUPPORTED COMPILERS
    248270-------------------
    249271
  • spkg/install

    diff --git a/spkg/install b/spkg/install
    a b export ZNPOLY 
    430430
    431431
    432432# Skip the rest if nothing to do (i.e., to [re]build):
    433 # Note that we should use $MAKE here, but we currently don't use
    434 # it further below either unless SAGE_PARALLEL_SPKG_BUILD=yes, which
    435 # I consider a "bug". -- Leif Leonhardy
    436 # If "make" doesn't understand the -q option, it should exit with a
    437 # non-zero status which is not a problem.
    438 if make -q -f standard/deps $1; then
     433# If "make" doesn't understand the -q option (although we require
     434# GNU make, which supports it), it should exit with a non-zero status
     435# which is not a problem.
     436if ${MAKE:-make} -q -f standard/deps $1; then
    439437    echo "Nothing to (re)build / all up-to-date."
    440438    exit 0
    441439fi
    442440
    443 
    444441# Dump environment for debugging purposes:
    445442echo "*** ALL ENVIRONMENT VARIABLES BEFORE BUILD: ***"
    446 env
     443env | sort
    447444echo "***********************************************"
    448445
     446# If the user (or the Makefile) has set SAGE_PARALLEL_SPKG_BUILD=no,
     447# then turn off parallel building by writing .NOTPARALLEL to
     448# spkg/standard/parallel_make.cfg.  Otherwise clear that file.
     449if [[ ${SAGE_PARALLEL_SPKG_BUILD:-yes} = no ]]; then
     450    # Disable just building multiple packages at the same time; individual
     451    # spkgs still get built in parallel if they support it and '--jobs'
     452    # in $MAKE is greater than one (and at all specified):
     453    echo ".NOTPARALLEL:" > "$SAGE_ROOT"/spkg/parallel_make.cfg
     454else
     455    # Create an (almost) empty file, s.t. including it from spkg/standard/deps
     456    # doesn't raise an error, thereby also invalidating any previous setting:
     457    echo > "$SAGE_ROOT"/spkg/parallel_make.cfg
     458fi
    449459
    450460###############################################################################
    451461# NOW do the actual build:
    452462###############################################################################
    453 if [ "$SAGE_PARALLEL_SPKG_BUILD" = "yes" ] && [ -n "$MAKE" ]; then
    454     time $MAKE -f standard/deps $1
    455 else
    456     time make -f standard/deps $1
    457 fi
     463time ${MAKE:-make} -f standard/deps $1
    458464
    459 # added by Burcin Erocal, see trac #6295.
     465# Added by Burcin Erocal, see trac #6295:
    460466if [ $? -ne 0 ]; then
    461     echo "Error building Sage."
     467    echo >&2 "Error building Sage."
    462468    exit 1
    463469fi
    464470
    465471cd "$SAGE_ROOT"
    466472
    467 # Rename makefile to Makefile (see #10156)
     473# Rename makefile to Makefile (see #10156):
    468474if [ -f makefile ]; then
    469475    mv makefile Makefile
    470476    if [ $? -ne 0 ]; then
    if [ -f makefile ]; then 
    473479    fi
    474480fi
    475481
    476 # build succeeded
    477 if [ "$1" = "all" ]; then
    478     echo "To install gap, gp, singular, etc., scripts"
    479     echo "in a standard bin directory, start sage and"
    480     echo "type something like"
    481     echo "   sage: install_scripts('/usr/local/bin')"
    482     echo "at the Sage command prompt."
    483     echo ""
    484     echo "To build the documentation, run"
    485     echo "   make doc"
    486     echo ""
    487 fi
    488 
     482# Build succeeded.
    489483echo "Sage build/upgrade complete!"
    490484
     485if [ "$1" = "all" ]; then
     486    echo
     487    echo "To install small scripts to directly run Sage's versions of GAP,"
     488    echo "the PARI/GP interpreter, Maxima, or Singular etc. (by typing e.g."
     489    echo "just 'gap' or 'gp') into a standard 'bin' directory, start Sage"
     490    echo "by typing 'sage' (or './sage') and enter something like"
     491    echo
     492    echo "    install_scripts('/usr/local/bin')"
     493    echo
     494    echo "at the Sage command prompt ('sage:')."
     495    echo
     496    echo "If you issued 'make', 'make all', or a similar command, then the"
     497    echo "HTML version of the documentation will be built right now."
     498    echo "Otherwise, if you want to (re)build the HTML documentation,"
     499    echo "run 'make doc'.  To build the PDF version, run 'make doc-pdf'."
     500    echo
     501fi
  • spkg/standard/deps

    diff --git a/spkg/standard/deps b/spkg/standard/deps
    a b SAGE_SPKG = sage-spkg $${SAGE_SPKG_OPTS} 
    99INSTALL = $(SAGE_ROOT)/spkg/pipestatus
    1010
    1111###############################################################################
     12# The file parallel_make.cfg is either empty (build in parallel) or
     13# contains ".NOTPARALLEL:" (build serially).  This file is written
     14# by spkg/install.
     15###############################################################################
     16include parallel_make.cfg
     17
     18###############################################################################
    1219# The base system; required in order to run sage-spkg
    1320###############################################################################
    1421BASE = $(INST)/$(PREREQ) $(INST)/$(DIR) $(INST)/$(SAGE_BZIP2)