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