makeCGAL 16.2 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
#------------------------------------------------------------------------------
28 29 30
# Dynamic library endings (default is .so)
[ "$(uname -s)" = Darwin ] && SO=dylib || SO=so

mark's avatar
mark committed
31 32 33 34 35
# 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
36
    if [ -d "$dir/include" -a -r "$dir/lib$WM_COMPILER_LIB_ARCH/libCGAL.$SO" ]
mark's avatar
mark committed
37
    then
38 39
        echo "    CGAL  include: $dir/include"
        echo "    CGAL  library: $dir/lib$WM_COMPILER_LIB_ARCH"
mark's avatar
mark committed
40 41 42 43 44
        # Additional information about boost
        dir="$3" # <- BOOST_ARCH_PATH
        for root in "$dir" /usr
        do
            if [ -d "$root/include/boost" \
45
              -a -r "$root/lib$WM_COMPILER_LIB_ARCH/libboost_system.$SO" ]
mark's avatar
mark committed
46
            then
47 48
                echo "    boost include: $root/include"
                echo "    boost library: $root/lib$WM_COMPILER_LIB_ARCH"
mark's avatar
mark committed
49 50 51 52 53 54 55 56 57
                break
            fi
        done
        exit 0
    else
        exit 2
    fi
fi
#------------------------------------------------------------------------------
58
# Run from third-party directory only
59
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
60 61 62 63 64 65
    echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
    echo "    Check your OpenFOAM environment and installation"
    exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
66
unset BOOST_ARCH_PATH CGAL_ARCH_PATH GMP_ARCH_PATH MPFR_ARCH_PATH   # Purge old
67 68

# CGAL, boost and gmp/mpfr versions from OpenFOAM etc/config.sh files.
69
# Get compiler first and let CGAL config override GMP and MPFR
70 71
_foamConfig compiler
_foamConfig CGAL
72 73 74 75

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

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

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

* build CGAL with
93
      ${cgalPACKAGE:-'unspecified CGAL version'}
Henry's avatar
Henry committed
94 95 96 97 98
      $boostPACKAGE
      $gmpPACKAGE
      $mpfrPACKAGE

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

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

Henry's avatar
Henry committed
105 106 107
USAGE
    exit 1
}
108
#------------------------------------------------------------------------------
109
exportCompiler          # Compiler info for CMake/configure
Henry's avatar
Henry committed
110

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

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

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

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

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

182
BOOST_SOURCE_DIR=$sourceBASE/$boostPACKAGE
183
: ${BOOST_ARCH_PATH:=$installBASE/$boostPACKAGE}    # Fallback
Henry's avatar
Henry committed
184

185 186 187
boostInc="$BOOST_ARCH_PATH/include"
boostLib="$BOOST_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"

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

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

    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
207 208
        boostInc="/usr/include"
        boostLib="/usr/lib$WM_COMPILER_LIB_ARCH"
209 210 211 212 213
        libdir="/usr/lib"
    fi

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

elif [ -f "$boostInc/boost/version.hpp" ]
216 217
then
    echo "Using $boostPACKAGE"
218 219 220 221 222 223

    libdir="$BOOST_ARCH_PATH/lib"

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

224
else
225
    echo "Starting build: $boostPACKAGE"
226
    echo
227
    # Absolute path for --libdir
Henry's avatar
Henry committed
228 229 230

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

        rm -rf $BOOST_ARCH_PATH

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

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


256
# Retrieve boost version:
Henry's avatar
Henry committed
257 258
if [ -f "$boostInc/boost/version.hpp" ]
then
mark's avatar
mark committed
259
    BOOST_VERSION=$(sed -ne 's/^ *# *define *BOOST_VERSION *\([0-9][0-9]*\).*$/\1/p' $boostInc/boost/version.hpp)
Henry's avatar
Henry committed
260
else
mark's avatar
mark committed
261 262 263
    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
264
    echo "stopping build"
mark's avatar
mark committed
265
    echo
Henry's avatar
Henry committed
266 267 268
    exit 1
fi

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

281
CGAL_SOURCE_DIR=$sourceBASE/$cgalPACKAGE
282
CGAL_BUILD_DIR=$buildBASE/$cgalPACKAGE
283
: ${CGAL_ARCH_PATH:=$installBASE/$cgalPACKAGE}      # Fallback
Henry's avatar
Henry committed
284

285
# gmp/mpfr are installed without compiler name
286
mpfrBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
Henry's avatar
Henry committed
287

288 289 290 291 292
# Enable/disable gmp/mpfr together
if _foamIsNone $gmpPACKAGE || _foamIsNone $mpfrPACKAGE
then
    GMP_ARCH_PATH=none
    MPFR_ARCH_PATH=none
293
elif _foamIsSystem $gmpPACKAGE || _foamIsSystem $mpfrPACKAGE
294
then
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 325 326 327
    # 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
328 329
fi

330 331 332 333 334 335 336 337 338 339 340
#------------------------------------------------------------------------------

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

mark's avatar
mark committed
342 343 344 345 346 347 348 349 350 351
#
# 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
352 353
# Information from OpenFOAM build on '$(date)'
#
mark's avatar
mark committed
354 355 356 357 358 359
CGAL=${CGAL_ARCH_PATH##*/}
BOOST=${BOOST_ARCH_PATH##*/}
GMP=${GMP_ARCH_PATH##*/}
MPFR=${MPFR_ARCH_PATH##*/}
CGAL_VERSION=$CGAL_VERSION
BOOST_VERSION=$BOOST_VERSION
360 361 362

CGAL_lib=lib$WM_COMPILER_LIB_ARCH
BOOST_lib=lib$WM_COMPILER_LIB_ARCH
363
CGAL_HEADER_ONLY=${optHeadersOnly:-false}
mark's avatar
mark committed
364 365 366 367
BUILD_INFO
}


368
# Compare expected vs what is extracted as KEY=... in text
mark's avatar
mark committed
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383
# $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
}

384
# Needs build
mark's avatar
mark committed
385 386
cgalIsCurrent()
{
387 388
    # 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
389 390
    [ -n "$info" ] || return 1

391 392
    local libDirName="lib$WM_COMPILER_LIB_ARCH"

mark's avatar
mark committed
393 394 395 396 397 398 399 400
    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
401 402
    infoValueEq CGAL_lib  "$libDirName"           "$info" || return 1
    infoValueEq BOOST_lib "$libDirName"           "$info" || return 1
mark's avatar
mark committed
403 404 405 406

    return 0
}

407

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

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

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

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


436 437 438 439 440 441
    # 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
442
            echo "    boost          : ${BOOST_ARCH_PATH##*/}"
443
            configBoost="-DBOOST_ROOT=$BOOST_ARCH_PATH"
444 445
        else
            echo "    boost          : system"
446
        fi
447

448 449 450
        ## For system - possible that /usr/lib64 not being found?
        ## configBoost="-DBoost_LIBRARY_DIRS=$boostLib"
    elif [ -d "$BOOST_ARCH_PATH" ]
Henry's avatar
Henry committed
451
    then
452
        echo "    boost          : $boostPACKAGE"
Henry's avatar
Henry committed
453 454 455
        configBoost=$(cat <<CMAKE_OPTIONS
 -DBoost_INCLUDE_DIR=$boostInc
 -DBoost_LIBRARY_DIRS=$boostLib
456 457 458 459
 -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
460
 -DBoost_VERSION=$BOOST_VERSION
Henry's avatar
Henry committed
461 462 463 464
CMAKE_OPTIONS
)
    fi

465 466
    if _foamIsSystem $GMP_ARCH_PATH
    then
467
        echo "    gmp            : system"
468 469
    elif _foamIsNone $GMP_ARCH_PATH
    then
470
        echo "    gmp            : disabled"
471
        configGmp="-DCGAL_DISABLE_GMP=TRUE"  # Also used for mpfr
472
    elif [ -d "$GMP_ARCH_PATH" ]
Henry's avatar
Henry committed
473
    then
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
481
            if [ -f "$libdir/libgmp.$SO" ]
482 483
            then
                configGmp=$(cat <<CMAKE_OPTIONS
Henry's avatar
Henry committed
484
 -DGMP_INCLUDE_DIR=$GMP_ARCH_PATH/include
485
 -DGMP_LIBRARIES_DIR=$libdir
486
 -DGMP_LIBRARIES=$libdir/libgmp.$SO
487 488
CMAKE_OPTIONS
)
489 490 491
                break
            fi
        done
492
    else
493
        echo "    system         : gmp (did not find $GMP_ARCH_PATH)"
494 495
    fi

496 497
    if _foamIsSystem $MPFR_ARCH_PATH
    then
498
        echo "    mpfr           : system"
499 500
    elif _foamIsNone $MPFR_ARCH_PATH
    then
501
        echo "    mpfr           : disabled"
502
        configGmp="-DCGAL_DISABLE_GMP=TRUE"  # Also used for mpfr
503
    elif [ -d "$MPFR_ARCH_PATH" ]
504
    then
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
512
            if [ -f "$libdir/libmpfr.$SO" ]
513 514
            then
                configMpfr=$(cat <<CMAKE_OPTIONS
Henry's avatar
Henry committed
515
 -DMPFR_INCLUDE_DIR=$MPFR_ARCH_PATH/include
516
 -DMPFR_LIBRARIES_DIR=$libdir
517
 -DMPFR_LIBRARIES=$libdir/libmpfr.$SO
Henry's avatar
Henry committed
518 519
CMAKE_OPTIONS
)
520 521 522
                break
            fi
        done
Henry's avatar
Henry committed
523
    else
524
        echo "    mpfr           : system (did not find $MPFR_ARCH_PATH)"
Henry's avatar
Henry committed
525 526
    fi

527 528
    cmake=$(findCMake)

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

562
    # Record our build-status
mark's avatar
mark committed
563 564
    recordCGALinfo

Henry's avatar
Henry committed
565 566 567
    echo "Done CGAL"
)

568
#------------------------------------------------------------------------------