mirror of
https://develop.openfoam.com/Development/ThirdParty-common.git
synced 2025-12-08 06:57:50 +00:00
ENH: add support of additional configure options to some make scripts - remove hard-coded --verbs from makeOPENMPI in favour of letting the user provide it via the command-line for makeOPENMPI. eg, makeOPENMPI openmpi-1.10.6 -- --with-verbs=DIRECTORY ...
147 lines
3.7 KiB
Bash
Executable File
147 lines
3.7 KiB
Bash
Executable File
#!/bin/sh
|
|
#------------------------------------------------------------------------------
|
|
# ========= |
|
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
# \\ / O peration |
|
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
|
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
|
#------------------------------------------------------------------------------
|
|
# License
|
|
# This file is part of OpenFOAM, licensed under GNU General Public License
|
|
# <http://www.gnu.org/licenses/>.
|
|
#
|
|
# Script
|
|
# makeCCMIO
|
|
#
|
|
# Description
|
|
# Build the libccmio library
|
|
#
|
|
# ----------------------------------------------
|
|
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
|
#------------------------------------------------------------------------------
|
|
# Run from third-party directory only
|
|
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
|
echo " Check your OpenFOAM environment and installation"
|
|
exit 1
|
|
}
|
|
[ -n "$FOAM_EXT_LIBBIN" ] || {
|
|
echo "Error (${0##*/}) : \$FOAM_EXT_LIBBIN not set"
|
|
echo " Check your OpenFOAM environment and installation"
|
|
exit 1
|
|
}
|
|
. etc/tools/ThirdPartyFunctions
|
|
#------------------------------------------------------------------------------
|
|
|
|
# libccmio version from OpenFOAM etc/config.sh file:
|
|
_foamEtc config.sh/ccmio
|
|
|
|
ccmioPACKAGE=${ccmio_version:-libccmio-2.6.1}
|
|
targetType=lib # Default is static linkage
|
|
|
|
#------------------------------------------------------------------------------
|
|
usage()
|
|
{
|
|
exec 1>&2
|
|
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
/bin/cat<<USAGE
|
|
|
|
Usage: ${0##*/} [OPTION] [lib|libso] [libccmio-VERSION]
|
|
options:
|
|
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
|
|
-help
|
|
|
|
* Compile the proprietary libccmio library
|
|
$ccmioPACKAGE
|
|
|
|
Users wishing to obtain the library should contact Siemens PLM (cd-adapco)
|
|
for terms of use.
|
|
|
|
After obtaining the $ccmioPACKAGE library, place in folder
|
|
|
|
$WM_THIRD_PARTY_DIR/$ccmioPACKAGE/
|
|
|
|
prior to running this script.
|
|
|
|
USAGE
|
|
exit 1
|
|
}
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Parse options
|
|
while [ "$#" -gt 0 ]
|
|
do
|
|
case "$1" in
|
|
'') ;; # Ignore empty
|
|
-h | -help) usage ;;
|
|
-gcc) useGcc ;;
|
|
|
|
lib|libso)
|
|
targetType="$1"
|
|
;;
|
|
libccmio-[1-9]*)
|
|
ccmioPACKAGE="${1%%/}"
|
|
;;
|
|
*)
|
|
die "unknown option/argument: '$1'"
|
|
;;
|
|
esac
|
|
shift
|
|
done
|
|
|
|
#------------------------------------------------------------------------------
|
|
#
|
|
# Build LIBCCMIO
|
|
#
|
|
CCMIO_SOURCE_DIR=$sourceBASE/$ccmioPACKAGE
|
|
CCMIO_ARCH_PATH=$installBASE/$ccmioPACKAGE
|
|
|
|
# Sources must be available
|
|
[ -d "$CCMIO_SOURCE_DIR" ] || die "Missing sources: '$ccmioPACKAGE'"
|
|
|
|
#
|
|
# Manual installation
|
|
#
|
|
install()
|
|
{
|
|
# Ensure a clean build next time
|
|
wclean
|
|
|
|
local incdir=$CCMIO_ARCH_PATH/include/libccmio
|
|
|
|
# Make headers available:
|
|
mkdir -m 0755 -p $incdir
|
|
|
|
/bin/cp -pv libccmio/ccmio*.h $incdir
|
|
}
|
|
|
|
echo "Starting build: $ccmioPACKAGE ($targetType)"
|
|
echo
|
|
(
|
|
cd $CCMIO_SOURCE_DIR || exit 1
|
|
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
|
|
|
|
rm -rf $CCMIO_ARCH_PATH
|
|
rm -f $FOAM_EXT_LIBBIN/libccmio.so
|
|
|
|
libdir=$CCMIO_ARCH_PATH/lib
|
|
|
|
cpMakeFiles libccmio 2>/dev/null
|
|
|
|
# Place static libraries in sub-directory:
|
|
if [ "$targetType" = lib ]
|
|
then
|
|
mkdir -m 0755 -p $libdir 2>/dev/null
|
|
export FOAM_EXT_LIBBIN=$libdir
|
|
fi
|
|
|
|
wmake -j $WM_NCOMPPROCS -s $targetType \
|
|
&& echo "Built: ccmio" \
|
|
&& install
|
|
) || {
|
|
echo "Error building: ccmio"
|
|
exit 1
|
|
}
|
|
|
|
#------------------------------------------------------------------------------
|