makeCGAL 16.1 KB
Newer Older
Henry's avatar
Henry committed
1 2 3 4 5
#!/bin/sh
#------------------------------------------------------------------------------
# =========                 |
# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
#  \\    /   O peration     |
6
#   \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
7
#    \\/     M anipulation  | Copyright (C) 2016-2018 OpenCFD Ltd.
Henry's avatar
Henry committed
8 9
#------------------------------------------------------------------------------
# License
Mark Olesen's avatar
Mark Olesen committed
10 11
#     This file is part of OpenFOAM, licensed under GNU General Public License
#     <http://www.gnu.org/licenses/>.
Henry's avatar
Henry committed
12 13 14 15 16 17 18 19 20 21 22 23 24
#
# Script
#     makeCGAL
#
# Description
#     Build script for CGAL
#
# Note
#     Normally builds against ThirdParty boost and gmp/mpfr when possible.
#     To override this behaviour (and use the system boost and/or gmp/mpfr),
#     simply specify a 'system' version. For example,
#         makeCGAL boost-system gmp-system
#
25 26
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
Henry's avatar
Henry committed
27
#------------------------------------------------------------------------------
mark's avatar
mark committed
28 29 30 31 32 33 34
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
    [ "$#" -eq 3 ] || { echo "${0##*/} -test : needs 2 argument"; exit 1; }
    dir="$2" # <- CGAL_ARCH_PATH
    if [ -d "$dir/include" -a -r "$dir/lib$WM_COMPILER_LIB_ARCH/libCGAL.so" ]
    then
35 36
        echo "    CGAL  include: $dir/include"
        echo "    CGAL  library: $dir/lib$WM_COMPILER_LIB_ARCH"
mark's avatar
mark committed
37 38 39 40 41 42 43
        # Additional information about boost
        dir="$3" # <- BOOST_ARCH_PATH
        for root in "$dir" /usr
        do
            if [ -d "$root/include/boost" \
              -a -r "$root/lib$WM_COMPILER_LIB_ARCH/libboost_system.so" ]
            then
44 45
                echo "    boost include: $root/include"
                echo "    boost library: $root/lib$WM_COMPILER_LIB_ARCH"
mark's avatar
mark committed
46 47 48 49 50 51 52 53 54
                break
            fi
        done
        exit 0
    else
        exit 2
    fi
fi
#------------------------------------------------------------------------------
55
# Run from third-party directory only
56
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
57 58 59 60 61 62
    echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
    echo "    Check your OpenFOAM environment and installation"
    exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
63
unset BOOST_ARCH_PATH CGAL_ARCH_PATH GMP_ARCH_PATH MPFR_ARCH_PATH   # Purge old
64 65

# CGAL, boost and gmp/mpfr versions from OpenFOAM etc/config.sh files.
66
# Get compiler first and let CGAL config override GMP and MPFR
67 68
_foamEtc config.sh/compiler
_foamEtc config.sh/CGAL
69 70 71 72

boostPACKAGE=${boost_version:-boost-system}
gmpPACKAGE=${gmp_version:-gmp-system}
mpfrPACKAGE=${mpfr_version:-mpfr-system}
73
cgalPACKAGE=$cgal_version
74

Henry's avatar
Henry committed
75 76 77 78 79 80
#------------------------------------------------------------------------------
usage() {
    exec 1>&2
    while [ "$#" -ge 1 ]; do echo "$1"; shift; done
    cat<<USAGE

81
usage: ${0##*/} [OPTION] [CGAL-VERSION] [boost-VERSION] [gmp-VERSION] [mpfr-VERSION]
Henry's avatar
Henry committed
82
options:
83
  -cmake PATH       with cmake from the path given
84
  -gcc              force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
85
  -no-lib           compile CGAL for use in headers only mode (since CGAL 4.9)
86
  -system           use system versions for boost/gmp/mpfr
Henry's avatar
Henry committed
87 88 89
  -help

* build CGAL with
90
      ${cgalPACKAGE:-'unspecified CGAL version'}
Henry's avatar
Henry committed
91 92 93 94 95
      $boostPACKAGE
      $gmpPACKAGE
      $mpfrPACKAGE

Normally builds against ThirdParty boost and gmp/mpfr when possible.
96
To override this behaviour (and use the system boost and/or gmp/mpfr),
Henry's avatar
Henry committed
97
simply specify a 'system' version. For example,
98
    ${0##*/} boost-system gmp-system
Henry's avatar
Henry committed
99

100 101
Use gmp-none to disable use of gmp/mpfr (eg, not available)

Henry's avatar
Henry committed
102 103 104
USAGE
    exit 1
}
105
#------------------------------------------------------------------------------
106
exportCompiler          # Compiler info for CMake/configure
Henry's avatar
Henry committed
107

108
unset optHeadersOnly
109
# Parse options
Henry's avatar
Henry committed
110 111 112
while [ "$#" -gt 0 ]
do
    case "$1" in
113 114 115 116
    '') ;;      # Ignore empty
    -h | -help) usage   ;;
    -gcc)       useGcc  ;;

117 118 119 120 121
    -cmake)
        [ "$#" -ge 2 ] || die "'$1' option requires an argument"
        CMAKE_PATH="${2%%/}"
        shift
        ;;
122 123 124 125
    -sys*)
        gmpPACKAGE="gmp-system"
        mpfrPACKAGE="mpfr-system"
        boostPACKAGE="boost-system"
126
        unset BOOST_ARCH_PATH GMP_ARCH_PATH MPFR_ARCH_PATH
127 128 129
        ;;
    -no-lib)
        optHeadersOnly=true
130
        ;;
131
    gmp-[4-9]* | gmp-system | gmp-none)
Henry's avatar
Henry committed
132
        gmpPACKAGE="${1%%/}"
133
        unset GMP_ARCH_PATH
Henry's avatar
Henry committed
134
        ;;
135
    mpfr-[2-9]* | mpfr-system | mpfr-none)
Henry's avatar
Henry committed
136
        mpfrPACKAGE="${1%%/}"
137
        unset MPFR_ARCH_PATH
Henry's avatar
Henry committed
138
        ;;
139
    boost-[0-9]* | boost_[0-9]* | boost-system )
Henry's avatar
Henry committed
140
        boostPACKAGE="${1%%/}"
141 142 143 144 145
        unset BOOST_ARCH_PATH
        ;;
    CGAL-[0-9]*)
        cgalPACKAGE="${1%%/}"
        unset CGAL_ARCH_PATH
Henry's avatar
Henry committed
146 147
        ;;
    *)
148
        die "unknown option/argument: '$1'"
Henry's avatar
Henry committed
149 150
        ;;
    esac
151
    shift
Henry's avatar
Henry committed
152 153
done

154
[ -n "$cgalPACKAGE" ] || die "The cgal-VERSION was not specified"
Henry's avatar
Henry committed
155

156 157
# Nothing to build
if _foamIsNone $boostPACKAGE
mark's avatar
mark committed
158 159 160 161
then
    echo "Using boost-none (skip ThirdParty build of BOOST/CGAL)"
    exit 0
fi
162
if _foamIsNone $cgalPACKAGE
mark's avatar
mark committed
163 164 165 166 167
then
    echo "Using cgal-none (skip ThirdParty build of CGAL)"
    exit 0
fi

Henry's avatar
Henry committed
168 169 170
#------------------------------------------------------------------------------
#
# Build Boost
171
# For 64-bit:
mark's avatar
mark committed
172
# - system is normally built into 'lib64'
173 174
# - use Third-Party 'lib64' for consistency.
# Boost 1_62_0 and older normally build into 'lib'.
Henry's avatar
Henry committed
175
#
176
#   BOOST_ARCH_PATH  : installation directory
Henry's avatar
Henry committed
177 178
#   BOOST_SOURCE_DIR : location of the original sources

179
BOOST_SOURCE_DIR=$sourceBASE/$boostPACKAGE
180
: ${BOOST_ARCH_PATH:=$installBASE/$boostPACKAGE}    # Fallback
Henry's avatar
Henry committed
181

182 183 184
boostInc="$BOOST_ARCH_PATH/include"
boostLib="$BOOST_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"

185
if _foamIsSystem $boostPACKAGE
Henry's avatar
Henry committed
186
then
mark's avatar
mark committed
187
    echo "Using boost-system (skip ThirdParty build of BOOST)"
188

189
    # Tagged as 'system' but could actually point to a central location
190 191 192 193 194 195 196 197 198 199 200 201 202 203

    if [ -d "$boostInc" ]
    then
        if BOOST_ARCH_PATH=$(cd $BOOST_ARCH_PATH 2>/dev/null && pwd -P)
        then
            boostPACKAGE=${BOOST_ARCH_PATH##*/}
        else
            echo "ERROR: bad path for BOOST_ARCH_PATH"
            echo "stopping build"
            exit 1
        fi

        libdir="$BOOST_ARCH_PATH/lib"
    else
204 205
        boostInc="/usr/include"
        boostLib="/usr/lib$WM_COMPILER_LIB_ARCH"
206 207 208 209 210
        libdir="/usr/lib"
    fi

    # Use lib/ when lib64/ does not exist
    [ ! -d "$boostLib" -a -d "$libdir" ] && boostLib="$libdir"
211 212

elif [ -f "$boostInc/boost/version.hpp" ]
213 214
then
    echo "Using $boostPACKAGE"
215 216 217 218 219 220

    libdir="$BOOST_ARCH_PATH/lib"

    # Use lib when lib64 does not exist
    [ ! -d "$boostLib" -a -d "$libdir" ] && boostLib="$libdir"

221
else
222
    echo "Starting build: $boostPACKAGE"
223
    echo
224
    # Absolute path for --libdir
Henry's avatar
Henry committed
225 226 227

    (
        cd $BOOST_SOURCE_DIR || exit 1
228
        export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
Henry's avatar
Henry committed
229 230 231 232 233

        rm -rf $BOOST_ARCH_PATH

        ./bootstrap.sh \
            --prefix=$BOOST_ARCH_PATH \
234
            --libdir=$boostLib \
Henry's avatar
Henry committed
235 236 237 238 239 240 241 242
            --with-libraries=thread \
            --with-libraries=system \
        && ./bjam toolset=$WM_CC -j $WM_NCOMPPROCS install \
        && echo "Built: boost"
    ) || {
        echo "Error building: boost"
        exit 1
    }
243
fi
Henry's avatar
Henry committed
244

245
# Nothing left to build
246
if _foamIsSystem $cgalPACKAGE
247
then
mark's avatar
mark committed
248
    echo "Using cgal-system (skip ThirdParty build of CGAL)"
249
    exit 0
Henry's avatar
Henry committed
250 251 252
fi


253
# Retrieve boost version:
Henry's avatar
Henry committed
254 255
if [ -f "$boostInc/boost/version.hpp" ]
then
mark's avatar
mark committed
256
    BOOST_VERSION=$(sed -ne 's/^ *# *define *BOOST_VERSION *\([0-9][0-9]*\).*$/\1/p' $boostInc/boost/version.hpp)
Henry's avatar
Henry committed
257
else
mark's avatar
mark committed
258 259 260
    echo
    echo "ERROR: boost does not appear to be installed, but is required to build CGAL"
    echo "    Change your settings, or disable entirely (with cgal-system, cgal-none, boost-none)"
Henry's avatar
Henry committed
261
    echo "stopping build"
mark's avatar
mark committed
262
    echo
Henry's avatar
Henry committed
263 264 265
    exit 1
fi

266
#------------------------------------------------------------------------------
Henry's avatar
Henry committed
267 268
#
# Build CGAL
269
# For 64-bit:
mark's avatar
mark committed
270
# - system is normally built into 'lib64'
271 272
# - use Third-Party 'lib64' for consistency.
# CGAL-4.9 normally builds into 'lib64', older versions into 'lib'.
Henry's avatar
Henry committed
273 274
#
#   CGAL_SOURCE_DIR : location of the original sources
275
#   CGAL_BUILD_DIR  : location of the build
276
#   CGAL_ARCH_PATH  : installation directory
Henry's avatar
Henry committed
277

278
CGAL_SOURCE_DIR=$sourceBASE/$cgalPACKAGE
279
CGAL_BUILD_DIR=$buildBASE/$cgalPACKAGE
280
: ${CGAL_ARCH_PATH:=$installBASE/$cgalPACKAGE}      # Fallback
Henry's avatar
Henry committed
281

282
# gmp/mpfr are installed without compiler name
283
mpfrBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
Henry's avatar
Henry committed
284

285 286 287 288 289
# Enable/disable gmp/mpfr together
if _foamIsNone $gmpPACKAGE || _foamIsNone $mpfrPACKAGE
then
    GMP_ARCH_PATH=none
    MPFR_ARCH_PATH=none
290
elif _foamIsSystem $gmpPACKAGE || _foamIsSystem $mpfrPACKAGE
291
then
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
    # May really be system, but could also by a central installation
    # Ensure everything is accurately recorded. Resolve paths etc.

    if [ -d "$GMP_ARCH_PATH" ]
    then
        if GMP_ARCH_PATH=$(cd $GMP_ARCH_PATH 2>/dev/null && pwd -P)
        then
            gmpPACKAGE=${GMP_ARCH_PATH##*/}
        else
            echo "ERROR: bad path for GMP_ARCH_PATH"
            echo "stopping build"
            exit 1
        fi
    else
        GMP_ARCH_PATH=system
    fi

    if [ -d "$MPFR_ARCH_PATH" ]
    then
        if MPFR_ARCH_PATH=$(cd $MPFR_ARCH_PATH 2>/dev/null && pwd -P)
        then
            mpfrPACKAGE=${MPFR_ARCH_PATH##*/}
        else
            echo "ERROR: bad path for MPFR_ARCH_PATH"
            echo "stopping build"
            exit 1
        fi
    else
        MPFR_ARCH_PATH=system
    fi
else
    GMP_ARCH_PATH=$mpfrBASE/$gmpPACKAGE
    MPFR_ARCH_PATH=$mpfrBASE/$mpfrPACKAGE
325 326
fi

327 328 329 330 331 332 333 334 335 336 337
#------------------------------------------------------------------------------

cat<<SUMMARY
CGAL configuration
------------------
    CGAL    = $cgalPACKAGE
    BOOST   = $boostPACKAGE
    GMP     = $gmpPACKAGE
    MPFR    = $mpfrPACKAGE
------------------
SUMMARY
338

mark's avatar
mark committed
339 340 341 342 343 344 345 346 347 348
#
# build information recorded for later use
#
buildInfoFile=$CGAL_ARCH_PATH/share/openfoam-build

recordCGALinfo()
{
    CGAL_VERSION=$(sed -ne 's/^ *# *define *CGAL_VERSION_NR *\([0-9][0-9]*\).*$/\1/p' $CGAL_ARCH_PATH/include/CGAL/version.h 2>/dev/null)

    cat<<BUILD_INFO > $buildInfoFile
349 350
# Information from OpenFOAM build on '$(date)'
#
mark's avatar
mark committed
351 352 353 354 355 356
CGAL=${CGAL_ARCH_PATH##*/}
BOOST=${BOOST_ARCH_PATH##*/}
GMP=${GMP_ARCH_PATH##*/}
MPFR=${MPFR_ARCH_PATH##*/}
CGAL_VERSION=$CGAL_VERSION
BOOST_VERSION=$BOOST_VERSION
357 358 359

CGAL_lib=lib$WM_COMPILER_LIB_ARCH
BOOST_lib=lib$WM_COMPILER_LIB_ARCH
360
CGAL_HEADER_ONLY=${optHeadersOnly:-false}
mark's avatar
mark committed
361 362 363 364
BUILD_INFO
}


365
# Compare expected vs what is extracted as KEY=... in text
mark's avatar
mark committed
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380
# $1 = key
# $2 = expected
# $3 = text to extract from
infoValueEq()
{
    local val=$(echo "${3:-unset}" | sed -ne "s/^$1=//p")
    if [ "$2" = "$val" ]
    then
       :
    else
        echo "    $1=$2, previous build had $1='${val:-not-found}'"
        return 1
    fi
}

381
# Needs build
mark's avatar
mark committed
382 383
cgalIsCurrent()
{
384 385
    # Only need VAR=... (also avoids embedded '#' that bothers some shells)
    local info=$(sed -n -e '/^[A-Z]/p' $buildInfoFile 2>/dev/null)
mark's avatar
mark committed
386 387
    [ -n "$info" ] || return 1

388 389
    local libDirName="lib$WM_COMPILER_LIB_ARCH"

mark's avatar
mark committed
390 391 392 393 394 395 396 397
    echo "checking information from existing build ..."
    echo "  ${CGAL_ARCH_PATH}"

    infoValueEq CGAL  "${CGAL_ARCH_PATH##*/}"     "$info" || return 1
    infoValueEq BOOST "${BOOST_ARCH_PATH##*/}"    "$info" || return 1
    infoValueEq GMP   "${GMP_ARCH_PATH##*/}"      "$info" || return 1
    infoValueEq MPFR  "${MPFR_ARCH_PATH##*/}"     "$info" || return 1
    infoValueEq BOOST_VERSION "${BOOST_VERSION}"  "$info" || return 1
398 399
    infoValueEq CGAL_lib  "$libDirName"           "$info" || return 1
    infoValueEq BOOST_lib "$libDirName"           "$info" || return 1
mark's avatar
mark committed
400 401 402 403

    return 0
}

404

mark's avatar
mark committed
405 406 407 408 409 410 411
if cgalIsCurrent
then
    echo "    ${CGAL_ARCH_PATH##*/} build appears to be up-to-date - skipping"
    echo
    exit 0
fi

Henry's avatar
Henry committed
412
(
413
    # Remove any existing build folder and recreate
414
    if [ -d $CGAL_BUILD_DIR ]
Henry's avatar
Henry committed
415 416
    then
        echo "removing old build directory"
417 418
        echo "    $CGAL_BUILD_DIR"
        rm -rf $CGAL_BUILD_DIR
Henry's avatar
Henry committed
419
    fi
420
    mkdir -p $CGAL_BUILD_DIR
Henry's avatar
Henry committed
421

422 423
    cd $CGAL_BUILD_DIR || exit 1
    export GIT_DIR=$CGAL_SOURCE_DIR/.git # Mask seeing our own git-repo
Henry's avatar
Henry committed
424

425
    unset configBoost configGmp configMpfr
Henry's avatar
Henry committed
426
    echo "----"
mark's avatar
mark committed
427
    echo "Configuring $cgalPACKAGE with boost $BOOST_VERSION"
Henry's avatar
Henry committed
428
    echo "    Source         : $CGAL_SOURCE_DIR"
429
    echo "    Build          : $CGAL_BUILD_DIR"
430
    echo "    Target         : $CGAL_ARCH_PATH"
Henry's avatar
Henry committed
431 432


433 434 435 436 437 438
    # See http://doc.cgal.org/latest/Manual/installation.html
    if _foamIsSystem $boostPACKAGE
    then
        # Tagged as 'system' but could actually point to a central location
        if [ -d "$BOOST_ARCH_PATH/include" ]
        then
439
            echo "    boost          : ${BOOST_ARCH_PATH##*/}"
440
            configBoost="-DBOOST_ROOT=$BOOST_ARCH_PATH"
441 442
        else
            echo "    boost          : system"
443
        fi
444

445 446 447
        ## For system - possible that /usr/lib64 not being found?
        ## configBoost="-DBoost_LIBRARY_DIRS=$boostLib"
    elif [ -d "$BOOST_ARCH_PATH" ]
Henry's avatar
Henry committed
448
    then
449
        echo "    boost          : $boostPACKAGE"
Henry's avatar
Henry committed
450 451 452 453 454 455 456
        configBoost=$(cat <<CMAKE_OPTIONS
 -DBoost_INCLUDE_DIR=$boostInc
 -DBoost_LIBRARY_DIRS=$boostLib
 -DBoost_THREAD_LIBRARY=$boostLib/libboost_thread.so
 -DBoost_THREAD_LIBRARY_RELEASE=$boostLib/libboost_thread.so
 -DBoost_SYSTEM_LIBRARY=$boostLib/libboost_system.so
 -DBoost_SYSTEM_LIBRARY_RELEASE=$boostLib/libboost_system.so
mark's avatar
mark committed
457
 -DBoost_VERSION=$BOOST_VERSION
Henry's avatar
Henry committed
458 459 460 461
CMAKE_OPTIONS
)
    fi

462 463
    if _foamIsSystem $GMP_ARCH_PATH
    then
464
        echo "    gmp            : system"
465 466
    elif _foamIsNone $GMP_ARCH_PATH
    then
467
        echo "    gmp            : disabled"
468
        configGmp="-DCGAL_DISABLE_GMP=TRUE"  # Also used for mpfr
469
    elif [ -d "$GMP_ARCH_PATH" ]
Henry's avatar
Henry committed
470
    then
471 472 473 474 475 476 477 478 479 480
        echo "    gmp            : $gmpPACKAGE"

        for libdir in \
            $GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
            $GMP_ARCH_PATH/lib \
        ;
        do
            if [ -f "$libdir/libgmp.so" ]
            then
                configGmp=$(cat <<CMAKE_OPTIONS
Henry's avatar
Henry committed
481
 -DGMP_INCLUDE_DIR=$GMP_ARCH_PATH/include
482 483
 -DGMP_LIBRARIES_DIR=$libdir
 -DGMP_LIBRARIES=$libdir/libgmp.so
484 485
CMAKE_OPTIONS
)
486 487 488
                break
            fi
        done
489
    else
490
        echo "    system         : gmp (did not find $GMP_ARCH_PATH)"
491 492
    fi

493 494
    if _foamIsSystem $MPFR_ARCH_PATH
    then
495
        echo "    mpfr           : system"
496 497
    elif _foamIsNone $MPFR_ARCH_PATH
    then
498
        echo "    mpfr           : disabled"
499
        configGmp="-DCGAL_DISABLE_GMP=TRUE"  # Also used for mpfr
500
    elif [ -d "$MPFR_ARCH_PATH" ]
501
    then
502 503 504 505 506 507 508 509 510 511
        echo "    mpfr           : $mpfrPACKAGE"

        for libdir in \
            $MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
            $MPFR_ARCH_PATH/lib \
        ;
        do
            if [ -f "$libdir/libmpfr.so" ]
            then
                configMpfr=$(cat <<CMAKE_OPTIONS
Henry's avatar
Henry committed
512
 -DMPFR_INCLUDE_DIR=$MPFR_ARCH_PATH/include
513 514
 -DMPFR_LIBRARIES_DIR=$libdir
 -DMPFR_LIBRARIES=$libdir/libmpfr.so
Henry's avatar
Henry committed
515 516
CMAKE_OPTIONS
)
517 518 519
                break
            fi
        done
Henry's avatar
Henry committed
520
    else
521
        echo "    mpfr           : system (did not find $MPFR_ARCH_PATH)"
Henry's avatar
Henry committed
522 523
    fi

524 525
    cmake=$(findCMake)

526 527
    # For CGAL < 4.9, for installation into lib64/, not lib/
    # Name only (not path) for CGAL_INSTALL_LIB_DIR
Henry's avatar
Henry committed
528 529
    echo "----"
    set -x
530
    $cmake \
Henry's avatar
Henry committed
531
        -DCMAKE_INSTALL_PREFIX=$CGAL_ARCH_PATH \
532
        -DCGAL_INSTALL_LIB_DIR=lib$WM_COMPILER_LIB_ARCH \
Henry's avatar
Henry committed
533
        -DCMAKE_BUILD_TYPE=Release \
534
        -DWITH_CGAL_ImageIO=OFF \
535
        -DWITH_CGAL_Qt5=OFF \
536
        ${optHeadersOnly:+-DCGAL_HEADER_ONLY=TRUE} \
537
        $configBoost $configGmp $configMpfr \
538
        ${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
Henry's avatar
Henry committed
539
        $CGAL_SOURCE_DIR \
540
    && set +x \
Henry's avatar
Henry committed
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558
    && make -j $WM_NCOMPPROCS \
    && make install || exit 1

    echo "----"
    echo "create '\$CGAL_ARCH_PATH/share/files'"
    echo "----"
    mkdir -p $CGAL_ARCH_PATH/share/src
    rm -f $CGAL_ARCH_PATH/share/files

    for i in assertions.cpp io.cpp MP_Float.cpp Random.cpp
    do
        if [ -e "$CGAL_SOURCE_DIR/src/CGAL/$i" ]
        then
            \cp $CGAL_SOURCE_DIR/src/CGAL/$i $CGAL_ARCH_PATH/share/src/
            echo "\${CGAL_ARCH_PATH}/share/src/$i" >> $CGAL_ARCH_PATH/share/files
        fi
    done

559
    # Record our build-status
mark's avatar
mark committed
560 561
    recordCGALinfo

Henry's avatar
Henry committed
562 563 564
    echo "Done CGAL"
)

565
#------------------------------------------------------------------------------