Commit f2e5aba3 authored by mark's avatar mark
Browse files

ENH: adjust build options for third-party IO libraries

- support building static libraries
parent 6c13263e
......@@ -9,14 +9,14 @@
* Description
Scripts for building third-party packages.
* Order of execution:
* Build Order:
+ makeGcc (recommended if the system gcc is < 4.7)
+ Allwmake (Builds OpenMPI, Scotch etc.)
+ makeCmake (if the system cmake version is < 2.8.8)
+ makeParaView
*** Optional
+ AllwmakeLibccmio (Only required for conversion of STAR-CCM+ meshes)
+ Allclean (Only required to save disk space)
*** Optional Build Components:
+ makeCCMIO (Only required for conversion of STAR-CCM+ meshes)
+ Allclean (Only required to save disk space)
* Versions and locations to download the third party packages
*** Gcc C++ Compiler
The minimum version of gcc required is 4.5.0
......
/* NOTE: make any changes to this file in etc/wmakeFiles/ */
adf = libadf
$(adf)/ADF_fortran_2_c.c
$(adf)/ADF_interface.c
$(adf)/ADF_internals.c
ccmio = libccmio
$(ccmio)/ccmio.c
$(ccmio)/ccmiocore.c
$(ccmio)/ccmioprivate.c
$(ccmio)/ccmioutility.c
$(ccmio)/ccmioversion.c
/*
* the cgns library is not used by ccmio
* retain for documentation purposes only
*
cgns = libcgns
$(cgns)/adf_cond.c
$(cgns)/adf_ftoc.c
$(cgns)/cgns_error.c
$(cgns)/cgns_internals.c
$(cgns)/cgnslib.c
*/
LIB = $(FOAM_EXT_LIBBIN)/libccmio
/* NOTE: make any changes to this file in etc/wmakeFiles/ */
/* EXE_INC = */
......@@ -23,13 +23,19 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# AllwmakeLibccmio
# makeCCMIO
#
# Description
# Build CD-adapco's ccmio library
#
#------------------------------------------------------------------------------
packageDir=libccmio-2.6.1
# Get version info
. $WM_PROJECT_DIR/etc/config.sh/functions
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/libccmio)
ccmio_version=${ccmio_version:-libccmio-2.6.1}
targetType=libso
#------------------------------------------------------------------------------
# run from third-party directory only
......@@ -40,45 +46,97 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
[ -n "$FOAM_EXT_LIBBIN" ] || {
echo "Error: FOAM_EXT_LIBBIN not set"
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage()
{
cat<<USAGE
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
/bin/cat<<USAGE
* The license of the libccmio library is proprietary:
Usage: ${0##*/} [OPTION] [lib|libso] [libccmio-VERSION]
options:
-help
Users wishing to make use of its functionality should contact CD-Adapco
for possible download and terms of use.
* Compile the proprietary libccmio library
$ccmio_version
Users wishing to make use of the library should contact cd-adapco
(Siemens PLM) for possible download and terms of use.
Usage: ${0##*/}
After obtaining the $ccmio_version library, place in folder
* This script will install the libccmio library
* After obtaining the $packageDir library, place in folder
$WM_THIRD_PARTY_DIR/$ccmio_version/
$WM_THIRD_PARTY_DIR/$packageDir/
prior to running this script.
USAGE
exit 1
}
# get tar.gz file if required
if [ ! -d ${packageDir} ]
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
lib|libso)
targetType="$1"
shift
;;
libccmio-[1-9]*)
ccmio_version="${1%%/}"
shift
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
# warn if unavailable
if [ ! -d ${ccmio_version} ]
then
usage
usage "missing source directory '$ccmio_version'"
fi
set -x
# make libccmio
(
cd $packageDir || exit 1
cpMakeFiles libccmio
#------------------------------------------------------------------------------
CCMIO_ARCH_PATH=$installBASE/$ccmio_version
wmake libso
#
# Build LIBCCMIO
#
echo "---------------"
(
cd $ccmio_version || exit 1
incDIR=$CCMIO_ARCH_PATH/include/libccmio
libDIR=$CCMIO_ARCH_PATH/lib
mkdir -p $incDIR 2>/dev/null
mkdir -p $libDIR 2>/dev/null
cpMakeFiles libccmio 2>/dev/null
set +x
if wmake $targetType
then
# make headers available:
/bin/cp -pv libccmio/ccmio*.h $incDIR
# relocate static libraries to sub-directory:
if [ "$targetType" = lib ]
then
/bin/mv -v $FOAM_EXT_LIBBIN/libccmio.a $libDIR
fi
fi
)
......
Markdown is supported
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