Ticket #11959: trac_11959-root.v2.patch

File trac_11959-root.v2.patch, 8.7 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 6458bd7abc89467b4649329b2a4b6bda797b8a52
    # Parent  841c7bfafa5447a618f43eeb31b2d6050a135b0a
    #11959: make Sage build spkgs in parallel by default.
    Only build in serial if either SAGE_PARALLEL_SPKG_BUILD=no or if you
    run "make build-serial".
    
    In README.txt, highlight the presence of the files in spkg/logs/
    
    diff --git a/.hgignore b/.hgignore
    a b sage-python 
    2424Makefile.old
    2525VERSION.txt
    2626^spkg-install$
     27spkg/parallel_make.cfg
  • Makefile

    diff --git a/Makefile b/Makefile
    a b all: doc # (already) indirectly depends  
    4343#       test -x $@ # or make it executable if it exists; sanity check only anyway
    4444
    4545build: $(PIPE)
    46         cd spkg && "../$(PIPE)" "./install all 2>&1" "tee -a ../install.log"
     46        cd spkg && \
     47        "../$(PIPE)" \
     48                "env SAGE_PARALLEL_SPKG_BUILD='$(SAGE_PARALLEL_SPKG_BUILD)' ./install all 2>&1" \
     49                "tee -a ../install.log"
     50
     51build-serial: SAGE_PARALLEL_SPKG_BUILD = no
     52build-serial: build
    4753
    4854# You can choose to have the built HTML version of the documentation link to
    4955# the PDF version. To do so, you need to build both the HTML and PDF versions.
    install: 
    155161        cd $(DESTDIR)/bin/; ./sage -c
    156162
    157163
    158 .PHONY: all build doc doc-html doc-html-jsmath doc-pdf \
     164.PHONY: all build build-serial doc doc-html doc-html-jsmath doc-pdf \
    159165        doc-clean clean distclean \
    160166        test check testoptional testlong ptest ptestall ptestlong \
    161167        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 -l5.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 5.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 -li "An error" 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 ZODB 
    428428ZNPOLY=`$newest zn_poly`
    429429export ZNPOLY
    430430
     431# If the user (or the Makefile) has set SAGE_PARALLEL_SPKG_BUILD=no,
     432# then turn off parallel building by writing .NOTPARALLEL to
     433# spkg/standard/parallel_make.cfg.  Otherwise clear that file.
     434if [[ ${SAGE_PARALLEL_SPKG_BUILD:-yes} = no ]]; then
     435    # Disable just building multiple packages at the same time; individual
     436    # spkgs still get built in parallel if they support it and '--jobs'
     437    # in $MAKE is greater than one (and at all specified):
     438    echo ".NOTPARALLEL:" > "$SAGE_ROOT"/spkg/parallel_make.cfg
     439else
     440    # Create an (almost) empty file, s.t. including it from spkg/standard/deps
     441    # doesn't raise an error, thereby also invalidating any previous setting:
     442    echo > "$SAGE_ROOT"/spkg/parallel_make.cfg
     443fi
    431444
    432445# 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
     446# If "make" doesn't understand the -q option (although we require
     447# GNU make, which supports it), it should exit with a non-zero status
     448# which is not a problem.
     449if ${MAKE:-make} -q -f standard/deps $1; then
    439450    echo "Nothing to (re)build / all up-to-date."
    440451    exit 0
    441452fi
    442453
    443 
    444454# Dump environment for debugging purposes:
    445455echo "*** ALL ENVIRONMENT VARIABLES BEFORE BUILD: ***"
    446 env
     456env | sort
    447457echo "***********************************************"
    448458
    449 
    450459###############################################################################
    451460# NOW do the actual build:
    452461###############################################################################
    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
     462time ${MAKE:-make} -f standard/deps $1
    458463
    459 # added by Burcin Erocal, see trac #6295.
     464# Added by Burcin Erocal, see trac #6295:
    460465if [ $? -ne 0 ]; then
    461     echo "Error building Sage."
     466    echo >&2 "Error building Sage."
    462467    exit 1
    463468fi
    464469
    465470cd "$SAGE_ROOT"
    466471
    467 # Rename makefile to Makefile (see #10156)
     472# Rename makefile to Makefile (see #10156):
    468473if [ -f makefile ]; then
    469474    mv makefile Makefile
    470475    if [ $? -ne 0 ]; then
    if [ -f makefile ]; then 
    473478    fi
    474479fi
    475480
    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 
     481# Build succeeded.
    489482echo "Sage build/upgrade complete!"
    490483
     484if [ "$1" = "all" ]; then
     485    echo
     486    echo "To install small scripts to directly run Sage's versions of GAP,"
     487    echo "the PARI/GP interpreter, Maxima, or Singular etc. (by typing e.g."
     488    echo "just 'gap' or 'gp') into a standard 'bin' directory, start Sage"
     489    echo "by typing 'sage' (or './sage') and enter something like"
     490    echo
     491    echo "    install_scripts('/usr/local/bin')"
     492    echo
     493    echo "at the Sage command prompt ('sage:')."
     494    echo
     495    echo "If you issued 'make', 'make all', or a similar command, then the"
     496    echo "HTML version of the documentation will be built right now."
     497    echo "Otherwise, if you want to (re)build the HTML documentation,"
     498    echo "run 'make doc'.  To build the PDF version, run 'make doc-pdf'."
     499    echo
     500fi
  • 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.  This setting has no effect on sub-makes -- it
     15# only determines whether more than one spkg may be built at a time.
     16###############################################################################
     17include $(SAGE_ROOT)/spkg/parallel_make.cfg
     18
     19###############################################################################
    1220# The base system; required in order to run sage-spkg
    1321###############################################################################
    1422BASE = $(INST)/$(PREREQ) $(INST)/$(DIR) $(INST)/$(SAGE_BZIP2)