Commit 7623d184 authored by mark's avatar mark
Browse files

CONFIG: build boost, CGAL into lib64/ (issue #8)

- On 64-bit systems, the library locations for boost, CGAL are changing.

* Boost 1_62_0 and older build into 'lib/'.
* CGAL-4.9 builds into 'lib64/', older versions into 'lib/'.

Future-proof things by using lib$WM_COMPILER_LIB_ARCH for boost and
CGAL targets.
parent 1fd3d5ab
......@@ -146,31 +146,32 @@ fi
#------------------------------------------------------------------------------
#
# Build Boost
# For 64-bit
# - Third-Party builds into 'lib'
# For 64-bit:
# - system is normally built into 'lib64'
# - use Third-Party 'lib64' for consistency.
# Boost 1_62_0 and older normally build into 'lib'.
#
# BOOST_SOURCE_DIR : location of the original sources
BOOST_ARCH_PATH=$installBASE/$boostPACKAGE
BOOST_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$boostPACKAGE
if [ -d "$BOOST_ARCH_PATH" ]
then
boostInc="$BOOST_ARCH_PATH/include"
boostLib="$BOOST_ARCH_PATH/lib"
elif _foamIsSystem $BOOST_ARCH_PATH
boostInc="$BOOST_ARCH_PATH/include"
boostLib="$BOOST_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
if _foamIsSystem $BOOST_ARCH_PATH
then
echo "Using boost-system (skip ThirdParty build of BOOST)"
boostInc="/usr/include"
boostLib="/usr/lib$WM_COMPILER_LIB_ARCH"
elif [ -f "$boostInc/boost/version.hpp" -a -d "$boostLib" ]
then
echo "Using $boostPACKAGE"
else
echo "Starting build: boost"
echo "Starting build: $boostPACKAGE"
echo
boostInc="$BOOST_ARCH_PATH/include"
boostLib="$BOOST_ARCH_PATH/lib"
# Absolute path for --libdir
(
cd $BOOST_SOURCE_DIR || exit 1
......@@ -179,6 +180,7 @@ else
./bootstrap.sh \
--prefix=$BOOST_ARCH_PATH \
--libdir=$boostLib \
--with-libraries=thread \
--with-libraries=system \
&& ./bjam toolset=$WM_CC -j $WM_NCOMPPROCS install \
......@@ -225,9 +227,10 @@ SUMMARY
#------------------------------------------------------------------------------
#
# Build CGAL
# For 64-bit
# - Third-Party builds into 'lib'
# For 64-bit:
# - system is normally built into 'lib64'
# - use Third-Party 'lib64' for consistency.
# CGAL-4.9 normally builds into 'lib64', older versions into 'lib'.
#
# CGAL_SOURCE_DIR : location of the original sources
# CGAL_BINARY_DIR : location of the build
......@@ -255,12 +258,17 @@ 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
# Information from OpenFOAM build on '$(date)'
#
CGAL=${CGAL_ARCH_PATH##*/}
BOOST=${BOOST_ARCH_PATH##*/}
GMP=${GMP_ARCH_PATH##*/}
MPFR=${MPFR_ARCH_PATH##*/}
CGAL_VERSION=$CGAL_VERSION
BOOST_VERSION=$BOOST_VERSION
CGAL_lib=lib$WM_COMPILER_LIB_ARCH
BOOST_lib=lib$WM_COMPILER_LIB_ARCH
BUILD_INFO
}
......@@ -287,6 +295,8 @@ cgalIsCurrent()
local info=$(cat $buildInfoFile 2>/dev/null)
[ -n "$info" ] || return 1
local libDirName="lib$WM_COMPILER_LIB_ARCH"
echo "checking information from existing build ..."
echo " ${CGAL_ARCH_PATH}"
......@@ -295,6 +305,8 @@ cgalIsCurrent()
infoValueEq GMP "${GMP_ARCH_PATH##*/}" "$info" || return 1
infoValueEq MPFR "${MPFR_ARCH_PATH##*/}" "$info" || return 1
infoValueEq BOOST_VERSION "${BOOST_VERSION}" "$info" || return 1
infoValueEq CGAL_lib "$libDirName" "$info" || return 1
infoValueEq BOOST_lib "$libDirName" "$info" || return 1
return 0
}
......@@ -375,16 +387,20 @@ CMAKE_OPTIONS
echo " system : mpfr"
fi
# For CGAL < 4.9, for installation into lib64/, not lib/
# Name only (not path) for CGAL_INSTALL_LIB_DIR
echo "----"
set -x
cmake \
-DCMAKE_INSTALL_PREFIX=$CGAL_ARCH_PATH \
-DCGAL_INSTALL_LIB_DIR=lib$WM_COMPILER_LIB_ARCH \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_CGAL_Qt5=OFF \
$configBoost $configGmp $configMpfr \
$CGAL_SOURCE_DIR \
&& make -j $WM_NCOMPPROCS \
&& make install || exit 1
set +x
echo "----"
echo "create '\$CGAL_ARCH_PATH/share/files'"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment