scripts/build/companion_libs/ppl.sh
author Anthony Foiani <anthony.foiani@gmail.com>
Thu May 19 23:06:16 2011 +0200 (2011-05-19)
branch1.11
changeset 2464 4b844234d214
parent 2459 4f0c4fb572e2
permissions -rw-r--r--
complibs/ppl: build only C and C++ interfaces for PPL

By default, PPL wants to build interfaces for any of a variety of
langauges it finds on the local host (python, java, possibly perl, also
more esoteric languages such as ocaml and prolog).

These extra interfaces can double the compile time for the library. For
single-process builds, I found a savings of more than 40%:

default / j1: 716s total, 143.2s avg, 0.52s stdev
just_c / j1: 406s total, 81.2s avg, 0.33s stdev
just_c_cpp / j1: 413s total, 82.6s avg, 0.22s stdev

And for multi-process builds, it approached 50%:

default / j4: 625s total, 125.0s avg, 0.57s stdev
just_c / j4: 338s total, 67.6s avg, 1.25s stdev
just_c_cpp / j4: 327s total, 65.4s avg, 0.36s stdev

Since the PPL we build within ct-ng is only used by GCC, we only need to
build the C and C++ interfaces.

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
(transplanted from ec30b191f0e3fe9bc73199f0bcb8d789db17aa92)
     1 # This file adds the functions to build the PPL library
     2 # Copyright 2009 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 do_ppl_get() { :; }
     6 do_ppl_extract() { :; }
     7 do_ppl() { :; }
     8 
     9 # Overide functions depending on configuration
    10 if [ "${CT_PPL}" = "y" ]; then
    11 
    12 # Download PPL
    13 do_ppl_get() {
    14     CT_GetFile "ppl-${CT_PPL_VERSION}"                                      \
    15         http://www.cs.unipr.it/ppl/Download/ftp/releases/${CT_PPL_VERSION}  \
    16         ftp://ftp.cs.unipr.it/pub/ppl/releases/${CT_PPL_VERSION}            \
    17         ftp://gcc.gnu.org/pub/gcc/infrastructure
    18 }
    19 
    20 # Extract PPL
    21 do_ppl_extract() {
    22     CT_Extract "ppl-${CT_PPL_VERSION}"
    23     CT_Patch "ppl" "${CT_PPL_VERSION}"
    24 }
    25 
    26 do_ppl() {
    27     mkdir -p "${CT_BUILD_DIR}/build-ppl"
    28     cd "${CT_BUILD_DIR}/build-ppl"
    29 
    30     CT_DoStep INFO "Installing PPL"
    31 
    32     CT_DoLog EXTRA "Configuring PPL"
    33 
    34 
    35     CT_DoExecLog CFG                                \
    36     CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
    37     CXXFLAGS="${CT_CFLAGS_FOR_HOST}"                \
    38     "${CT_SRC_DIR}/ppl-${CT_PPL_VERSION}/configure" \
    39         --build=${CT_BUILD}                         \
    40         --host=${CT_HOST}                           \
    41         --prefix="${CT_COMPLIBS_DIR}"               \
    42         --with-libgmp-prefix="${CT_COMPLIBS_DIR}"   \
    43         --with-libgmpxx-prefix="${CT_COMPLIBS_DIR}" \
    44         --with-gmp-prefix="${CT_COMPLIBS_DIR}"      \
    45         --enable-cxx                                \
    46         --enable-watchdog                           \
    47         --disable-debugging                         \
    48         --disable-assertions                        \
    49         --disable-ppl_lcdd                          \
    50         --disable-ppl_lpsol                         \
    51         --disable-shared                            \
    52         --enable-interfaces='c c++'                 \
    53         --enable-static
    54 
    55     # Maybe-options:
    56     # --enable-optimization=speed  or sspeed (yes, with 2 's')
    57 
    58     CT_DoLog EXTRA "Building PPL"
    59     CT_DoExecLog ALL make ${JOBSFLAGS}
    60 
    61     if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
    62         CT_DoLog EXTRA "Checking PPL"
    63         CT_DoExecLog ALL make ${JOBSFLAGS} -s check
    64     fi
    65 
    66     CT_DoLog EXTRA "Installing PPL"
    67     CT_DoExecLog ALL make install
    68 
    69     # Remove spuriously installed file
    70     CT_DoExecLog ALL rm -f "${CT_PREFIX_DIR}/bin/ppl-config"
    71 
    72     CT_EndStep
    73 }
    74 
    75 fi # CT_PPL