scripts/build/companion_libs/cloog.sh
author Anthony Foiani <anthony.foiani@gmail.com>
Thu May 19 23:06:16 2011 +0200 (2011-05-19)
changeset 2461 ec30b191f0e3
parent 2349 ac32a31d30d7
child 2704 fcf5c43cf30f
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>
     1 # This file adds the functions to build the CLooG library
     2 # Copyright 2009 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 do_cloog_get() { :; }
     6 do_cloog_extract() { :; }
     7 do_cloog() { :; }
     8 
     9 # Overide functions depending on configuration
    10 if [ "${CT_CLOOG}" = "y" ]; then
    11 
    12 # Download CLooG
    13 do_cloog_get() {
    14     CT_GetFile "cloog-ppl-${CT_CLOOG_VERSION}"  \
    15         ftp://gcc.gnu.org/pub/gcc/infrastructure
    16 }
    17 
    18 # Extract CLooG
    19 do_cloog_extract() {
    20     local _t
    21 
    22     CT_Extract "cloog-ppl-${CT_CLOOG_VERSION}"
    23 
    24     # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
    25     # while versions 0.15.4 onward do have the version in the dirname.
    26     case "${CT_CLOOG_VERSION}" in
    27         0.15.3) _t="";;
    28         *)      _t="-${CT_CLOOG_VERSION}";;
    29     esac
    30     CT_Pushd "${CT_SRC_DIR}/cloog-ppl${_t}"
    31     CT_Patch nochdir "cloog-ppl" "${CT_CLOOG_VERSION}"
    32     if [ "${CT_CLOOG_VERSION}" = "0.15.10" ]; then
    33         ./autogen.sh
    34     fi
    35     CT_Popd
    36 }
    37 
    38 do_cloog() {
    39     local _t
    40 
    41     # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
    42     # while versions 0.15.4 onward do have the version in the dirname.
    43     case "${CT_CLOOG_VERSION}" in
    44         0.15.3) _t="";;
    45         *)      _t="-${CT_CLOOG_VERSION}";;
    46     esac
    47 
    48     mkdir -p "${CT_BUILD_DIR}/build-cloog-ppl"
    49     cd "${CT_BUILD_DIR}/build-cloog-ppl"
    50 
    51     CT_DoStep INFO "Installing CLooG/ppl"
    52 
    53     CT_DoLog EXTRA "Configuring CLooG/ppl"
    54 
    55     CT_DoExecLog CFG                            \
    56     CFLAGS="${CT_CFLAGS_FOR_HOST}"              \
    57     LDFLAGS="-lm"                               \
    58     "${CT_SRC_DIR}/cloog-ppl${_t}/configure"    \
    59         --build=${CT_BUILD}                     \
    60         --host=${CT_HOST}                       \
    61         --prefix="${CT_COMPLIBS_DIR}"           \
    62         --with-gmp="${CT_COMPLIBS_DIR}"         \
    63         --with-ppl="${CT_COMPLIBS_DIR}"         \
    64         --with-bits=gmp                         \
    65         --with-host-libstdcxx='-lstdc++'        \
    66         --disable-shared                        \
    67         --enable-static
    68 
    69     CT_DoLog EXTRA "Building CLooG/ppl"
    70     CT_DoExecLog ALL make ${JOBSFLAGS} libcloog.la
    71 
    72     if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
    73         CT_DoLog EXTRA "Checking CLooG/ppl"
    74         CT_DoExecLog ALL make ${JOBSFLAGS} -s check
    75     fi
    76 
    77     CT_DoLog EXTRA "Installing CLooG/ppl"
    78     CT_DoExecLog ALL make install-libLTLIBRARIES install-pkgincludeHEADERS
    79 
    80     CT_EndStep
    81 }
    82 
    83 fi # CT_CLOOG