Initial commit of the scripts

This commit is contained in:
Henry
2014-12-31 18:49:45 +00:00
parent b67294566b
commit f786872892
20 changed files with 4483 additions and 0 deletions

62
Allclean Executable file
View File

@ -0,0 +1,62 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# AllClean
#
# Description
# Clean script for third-party applications and libraries
#
#------------------------------------------------------------------------------
# run from third-party directory only
cd ${0%/*} || exit 1
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
# . etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# clean various packages via 'distclean'
for i in openmpi-*
do
[ -d "$i" ] && ( set -x; cd $i && make distclean )
done
# clean various packages via 'realclean'
for i in scotch*/src
do
[ -d "$i" ] && ( set -x; cd $i && make realclean )
done
# clean out-of-source build directories
[ -d platforms ] && ( set -x; rm -rf platforms/* )
# ----------------------------------------------------------------- end-of-file

364
Allwmake Executable file
View File

@ -0,0 +1,364 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# Allwmake
#
# Description
# Build script for ThirdParty
#
#------------------------------------------------------------------------------
# run from third-party directory only
cd ${0%/*} || exit 1
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
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
#------------------------------------------------------------------------------
# export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
echo
echo ========================================
echo Start ThirdParty Allwmake
echo ========================================
echo
echo ========================================
echo Build MPI libraries if required
echo
case "$WM_MPLIB" in
OPENMPI)
if [ -r $MPI_ARCH_PATH/lib${WM_COMPILER_LIB_ARCH}/libmpi.so ]
then
echo " have $WM_MPLIB shared library ($FOAM_MPI)"
echo
elif [ -r $MPI_ARCH_PATH/lib${WM_COMPILER_LIB_ARCH}/libmpi.a ]
then
echo " have $WM_MPLIB static library ($FOAM_MPI)"
echo
else
(
set -x
cd "${MPI_ARCH_PATH##*/}" || exit 1 # change to openmpi-VERSION
make distclean 2>/dev/null
rm -rf $MPI_ARCH_PATH
# start with GridEngine support,
# it can be built without external libraries
configOpt="--with-sge"
# Infiniband support
# if [ -d /usr/local/ofed -a -d /usr/local/ofed/lib64 ]
# then
# configOpt="$configOpt --with-openib=/usr/local/ofed"
# configOpt="$configOpt --with-openib-libdir=/usr/local/ofed/lib64"
# fi
./configure \
--prefix=$MPI_ARCH_PATH \
--disable-orterun-prefix-by-default \
--enable-shared --disable-static \
--libdir=$MPI_ARCH_PATH/lib${WM_COMPILER_LIB_ARCH} \
--disable-mpi-f77 \
--disable-mpi-f90 \
--disable-mpi-cxx \
--disable-mpi-profile \
$configOpt \
;
make -j $WM_NCOMPPROCS && make install
make distclean
)
fi
;;
MPICH)
if [ -r $MPI_ARCH_PATH/lib/libmpich.so ]
then
echo " have $WM_MPLIB shared library ($FOAM_MPI)"
echo
echo
elif [ -r $MPI_ARCH_PATH/lib/libmpich.a ]
then
echo " have $WM_MPLIB static library ($FOAM_MPI)"
echo
else
(
set -x
cd $MPI_HOME || exit 1 # change to mpich-VERSION
make distclean 2>/dev/null
rm -rf $MPI_ARCH_PATH
rm util/machines/machines.*
./configure \
--prefix=$MPI_ARCH_PATH \
--without-mpe \
--disable-f77 \
--disable-f90 \
--disable-f90modules \
--disable-c++ \
--disable-mpedbg \
--disable-devdebug \
--disable-debug \
--enable-sharedlib=$MPI_ARCH_PATH/lib \
--with-device=ch_p4 \
;
make -j $WM_NCOMPPROCS && make install
make distclean
if [ -r $MPI_ARCH_PATH ]
then
cd $MPI_ARCH_PATH/bin
for file in *
do
sed s%$MPI_ARCH_PATH%'$MPI_ARCH_PATH'%g $file > temp.$$
mv temp.$$ $file
chmod 0755 $file
done
cd $MPI_ARCH_PATH/lib
if [ -r libmpich.so.1.0 ]
then
rm *.so
ln -s libmpich.so.1.0 libmpich.so
fi
fi
)
fi
;;
esac
# get SCOTCH_VERSION, SCOTCH_ARCH_PATH
if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config/scotch.sh`
then
. $settings
else
echo
echo "Error: no config/scotch.sh settings"
echo
fi
# building scotch is still a bit of a pain
echo ========================================
echo "Build Scotch decomposition library $SCOTCH_VERSION"
echo " $SCOTCH_ARCH_PATH"
# this needs generalizing
scotchMakefile=../../etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM-$WM_ARCH_OPTION$WM_LABEL_OPTION
if [ -f $SCOTCH_ARCH_PATH/include/scotch.h \
-a -r $FOAM_EXT_LIBBIN/libscotch.so \
-a -r $FOAM_EXT_LIBBIN/libscotcherrexit.so ]
then
echo " scotch header in $SCOTCH_ARCH_PATH/include"
echo " scotch libs in $FOAM_EXT_LIBBIN"
echo
else
(
set -x
cd $SCOTCH_VERSION/src || exit 1
prefixDIR=$SCOTCH_ARCH_PATH
libDIR=$FOAM_EXT_LIBBIN
mkdir -p $prefixDIR 2>/dev/null
mkdir -p $libDIR 2>/dev/null
configOpt="prefix=$prefixDIR libdir=$libDIR"
if [ -f $scotchMakefile ]
then
rm -f Makefile.inc
ln -s $scotchMakefile Makefile.inc
fi
[ -f Makefile.inc ] || {
echo " Error: scotch needs an appropriate Makefile.inc"
exit 1
}
# handle non-gcc compilers
unset configEnv
[ "${WM_CC:-gcc}" != gcc ] && configEnv="CC=$WM_CC CCS=$WM_CC"
make realclean 2>/dev/null # for safety
make -j $WM_NCOMPPROCS $configEnv scotch \
&& make $configOpt install
# cleanup, could also remove Makefile.inc
make realclean 2>/dev/null
)
fi
# verify existence of scotch include
[ -f $SCOTCH_ARCH_PATH/include/scotch.h ] || {
echo
echo " WARNING: required include file 'scotch.h' not found!"
echo
}
# build ptscotch if MPI (ThirdParty or system) is available
if [ "${FOAM_MPI:-dummy}" != dummy ]
then
echo ========================================
echo "Build PTScotch decomposition library $SCOTCH_VERSION (uses MPI)"
echo " $SCOTCH_ARCH_PATH"
echo
if [ -f $SCOTCH_ARCH_PATH/include/$FOAM_MPI/ptscotch.h \
-a -r $FOAM_EXT_LIBBIN/$FOAM_MPI/libptscotch.so \
-a -r $FOAM_EXT_LIBBIN/$FOAM_MPI/libptscotcherrexit.so ]
then
echo " ptscotch header in $SCOTCH_ARCH_PATH/include/$FOAM_MPI"
echo " ptscotch libs in $FOAM_EXT_LIBBIN/$FOAM_MPI"
echo
else
(
set -x
cd $SCOTCH_VERSION/src || exit 1
prefixDIR=$SCOTCH_ARCH_PATH
libDIR=$FOAM_EXT_LIBBIN/$FOAM_MPI
incDIR=$SCOTCH_ARCH_PATH/include/$FOAM_MPI
mkdir -p $prefixDIR 2>/dev/null
mkdir -p $libDIR 2>/dev/null
configOpt="prefix=$prefixDIR libdir=$libDIR includedir=$incDIR"
if [ -f $scotchMakefile ]
then
rm -f Makefile.inc
ln -s $scotchMakefile Makefile.inc
fi
[ -f Makefile.inc ] || {
echo " Error: scotch needs an appropriate Makefile.inc"
exit 1
}
# handle non-gcc compilers
unset configEnv
[ "${WM_CC:-gcc}" != gcc ] && configEnv="CC=$WM_CC CCS=$WM_CC"
make realclean 2>/dev/null # for safety
make -j $WM_NCOMPPROCS $configEnv ptscotch \
&& make $configOpt install
# cleanup, could also remove Makefile.inc
make realclean 2>/dev/null
)
fi
# verify existence of scotch include
[ -f $SCOTCH_ARCH_PATH/include/$FOAM_MPI/ptscotch.h ] || {
echo
echo " WARNING: required include file 'ptscotch.h' not found!"
echo
}
fi
# -----------------------------------------------------------------------------
# Metis is optional
echo ========================================
echo Build Metis decomposition
# get METIS_VERSION, METIS_ARCH_PATH
if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config/metis.sh`
then
. $settings
fi
if [ -d "$METIS_VERSION" ]
then
if [ -f $METIS_ARCH_PATH/include/metis.h \
-a -r $FOAM_EXT_LIBBIN/libmetis.so ]
then
echo " metis header in $METIS_ARCH_PATH/include"
echo " metis libs in $FOAM_EXT_LIBBIN"
echo
else
set -x
cd $METIS_VERSION || exit 1
make config shared=1 prefix=$METIS_ARCH_PATH
make -j $WM_NCOMPPROCS install
cp $METIS_ARCH_PATH/lib/libmetis.so $FOAM_EXT_LIBBIN
fi
else
echo " optional component Metis was not found"
fi
# CGAL is optional
echo ========================================
echo Build CGAL
if [ -n "$CGAL_ARCH_PATH" ]
then
(
if [ -r $CGAL_ARCH_PATH/lib/libCGAL.so ]
then
echo " CGAL headers in $CGAL_ARCH_PATH/include"
echo " CGAL libs in $CGAL_ARCH_PATH/lib"
else
./makeCGAL
fi
)
else
echo " optional component was not found"
fi
echo
echo ========================================
echo Done ThirdParty Allwmake
echo ========================================
echo
# ----------------------------------------------------------------- end-of-file

85
AllwmakeLibccmio Executable file
View File

@ -0,0 +1,85 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# AllwmakeLibccmio
#
# Description
# Get and build CD-adapco's ccmio library
#
#------------------------------------------------------------------------------
packageDir=libccmio-2.6.1
#------------------------------------------------------------------------------
# run from third-party directory only
cd ${0%/*} || exit 1
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage()
{
cat<<USAGE
* The license of the libccmio library is proprietary:
Users wishing to make use of its functionality should contact CD-Adapco
for possible download and terms of use.
Usage: ${0##*/}
* This script will install the libccmio library
* After obtaining the $packageDir library, place in folder
$WM_THIRD_PARTY_DIR/$packageDir/
USAGE
exit 1
}
# get tar.gz file if required
if [ ! -d ${packageDir} ]
then
usage
fi
set -x
# make libccmio
(
cd $packageDir || exit 1
cpMakeFiles libccmio
wmake libso
)
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,497 @@
#---------------------------------*- sh -*-------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/tools/ParaViewFunctions
#
# Description
# ParaView make/install helper functions
#
#------------------------------------------------------------------------------
# buildBASE, installBASE defined from tools/ThirdPartyFunctions
#
# where things are or should be put
# ParaView_VERSION and ParaView_MAJOR should already have been set
#
# ParaView_SOURCE_DIR : location of the original sources
# ParaView_BINARY_DIR : location of the build
# ParaView_DIR : location of the installed program
#
setDirs()
{
ParaView_SOURCE_DIR=$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
[ -d "$ParaView_SOURCE_DIR" ] || {
echo "did not find ParaView-$ParaView_VERSION in these directories:"
echo " WM_THIRD_PARTY_DIR=$WM_THIRD_PARTY_DIR"
echo
echo "abort build"
exit 1
}
# ParaView_BINARY_DIR=$buildBASE/ParaView-$ParaView_VERSION-$OBJ_ADD
ParaView_BINARY_DIR=$buildBASE/ParaView-$ParaView_VERSION
# ParaView_DIR=$installBASE/ParaView-$ParaView_VERSION-$OBJ_ADD
ParaView_DIR=$installBASE/ParaView-$ParaView_VERSION
export ParaView_SOURCE_DIR ParaView_BINARY_DIR ParaView_DIR
echo
echo "ParaView_SOURCE_DIR=$ParaView_SOURCE_DIR"
echo "ParaView_BINARY_DIR=$ParaView_BINARY_DIR"
echo "ParaView_DIR=$ParaView_DIR"
}
#
# set ParaView_VERSION and adjust ParaView_MAJOR accordingly
#
setVersion()
{
[ "$#" -ge 1 ] && ParaView_VERSION="${1##paraview-}"
# the major version is "<digits>.<digits>"
ParaView_MAJOR=$(echo $ParaView_VERSION | \
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/')
export ParaView_VERSION ParaView_MAJOR
}
#------------------------------------------------------------------------------
#
# extract and echo date stamp information from
# VTK/Utilities/kwsys/kwsysDateStamp.cmake
# since the order of the entries is already correct, can use simple sed script
#
echoDateStamp()
{
(
set -- $(
sed -ne 's/^SET(KWSYS_DATE_STAMP_[A-Z]*\([ 0-9]*\)).*$/\1/p' \
$ParaView_SOURCE_DIR/VTK/Utilities/kwsys/kwsysDateStamp.cmake
)
IFS='-'
echo "date-stamp: $*"
)
}
#
# extract version information from
# CMakeLists.txt
# since the order of the entries is already correct, can use simple sed script
#
getVersion()
{
(
set -- $(
sed -ne 's/^SET(PARAVIEW_VERSION_[A-Z]*\([ 0-9]*\)).*$/\1/p' \
$ParaView_SOURCE_DIR/CMakeLists.txt
)
IFS='.'
echo "$*"
)
}
#
# compare version information
#
checkVersion()
{
local ver=$(getVersion)
if [ "$ParaView_VERSION" != "$ver" ]
then
echo "MISMATCH!"
echo " specified $ParaView_VERSION"
echo " found $ver"
fi
}
#
# set CMake cache variables
#
addCMakeVariable()
{
while [ -n "$1" ]
do
CMAKE_VARIABLES="$CMAKE_VARIABLES -D$1"
shift
done
}
#
# verbose makefiles
#
addVerbosity()
{
[ "$withVERBOSE" = true ] && addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE"
}
#
# define options for mpi support
#
addMpiSupport()
{
[ "${withMPI:=false}" = true ] || return
OBJ_ADD="$OBJ_ADD-mpi"
addCMakeVariable "PARAVIEW_USE_MPI=ON VTK_USE_MPI=ON"
addCMakeVariable "MPI_INCLUDE_PATH=$MPI_ARCH_PATH/include"
addCMakeVariable "MPI_LIBRARY=$MPI_ARCH_PATH/lib/libmpi.so"
if [ -e $MPI_ARCH_PATH/lib/libmpi_cxx.so ]
then
addCMakeVariable "MPI_EXTRA_LIBRARY=$MPI_ARCH_PATH/lib/libmpi_cxx.so"
fi
addCMakeVariable "VTK_MPIRUN_EXE=$MPI_ARCH_PATH/bin/mpirun"
addCMakeVariable "VTK_MPI_MAX_NUMPROCS=$MPI_MAX_PROCS"
}
#
# define options for python support
#
addPythonSupport()
{
[ "${withPYTHON:=false}" = true ] || return
OBJ_ADD="$OBJ_ADD-py"
if pythonBin=$(which python 2>/dev/null)
then
if [ -n "$PYTHON_LIBRARY" ]
then
# check $PYTHON_LIBRARY if it has been set
if [ ! -e "$PYTHON_LIBRARY" ]
then
echo "*** Error: libpython not found at location specified " \
"by -pythnon-lib input: PYTHON_LIBRARY=$PYTHON_LIBRARY"
fi
else
# Try to get $PYTHON_LIBRARY from dynamically linked binary
PYTHON_LIBRARY=$(ldd $pythonBin | \
sed -ne '/libpython/s/.* => \(.*\) (.*/\1/p')
[ -e "$PYTHON_LIBRARY" ] || {
echo "*** Error: Unable to determine path to python library."
}
fi
[ -e "$PYTHON_LIBRARY" ] || {
echo " Please set the full path to the python library "
echo " (including libpython) using the -python-lib option, "
echo " or deactivate python support by not using the -python "
echo " option"
exit 1
}
pythonMajor=$(echo $PYTHON_LIBRARY | sed 's/.*libpython\(.*\)\.so.*/\1/')
pythonInclude=/usr/include/python$pythonMajor
# note - we could also allow for a PYTHON_INCLUDE variable ...
[ -d "$pythonInclude" ] || {
echo " No python headers found in $pythonInclude/"
echo " Please install python headers or deactivate "
echo " python support by not using the -python option"
exit 1
}
addCMakeVariable "PARAVIEW_ENABLE_PYTHON=ON"
addCMakeVariable "PYTHON_INCLUDE_PATH=$pythonInclude"
addCMakeVariable "PYTHON_LIBRARY=$PYTHON_LIBRARY"
echo "----"
echo "Python information:"
echo " executable : $pythonBin"
echo " version : $pythonMajor"
echo " include path : $pythonInclude"
echo " library : $PYTHON_LIBRARY"
unset pythonBin pythonInclude pythonMajor
else
echo "*** Error: python not found"
echo "*** Deactivate python support by not using the -python "
echo "*** option"
exit 1
fi
}
#
# define options for mesa support
#
addMesaSupport()
{
[ "${withMESA:=false}" = true ] || return
if [ -d "$MESA_INCLUDE" -a -f "$MESA_LIBRARY" ]
then
OBJ_ADD="$OBJ_ADD-mesa"
addCMakeVariable "VTK_OPENGL_HAS_OSMESA=ON"
addCMakeVariable "OSMESA_INCLUDE_DIR=$MESA_INCLUDE"
addCMakeVariable "OSMESA_LIBRARY=$MESA_LIBRARY"
else
echo "*** Error: no MESA information found"
echo "*** Deactivate MESA support by not using the -mesa option, "
echo "*** or set the correct paths for:"
echo "*** -mesa-include ($MESA_INCLUDE)"
echo "*** -mesa-lib ($MESA_LIBRARY)"
exit 1
fi
}
addQtSupport()
{
QtVersion=none
[ "${withQT:=false}" = true ] || return
addCMakeVariable "PARAVIEW_BUILD_QT_GUI=ON"
unset qmakeExe
if [ -n "$QMAKE_PATH" ]
then
if [ -d "$QMAKE_PATH" ]
then
if [ -x "$QMAKE_PATH/qmake" ]
then
qmakeExe=$QMAKE_PATH/qmake
elif [ -x "$QMAKE_PATH/bin/qmake" ]
then
qmakeExe=$QMAKE_PATH/bin/qmake
fi
elif [ -x "$QMAKE_PATH" ]
then
qmakeExe=$QMAKE_PATH
fi
if [ -n "$qmakeExe" ]
then
# use absolute path
if [ "${qmakeExe#/}" = "$qmakeExe" ]
then
qmakeExe="$(cd ${qmakeExe%/qmake} 2>/dev/null && pwd)/qmake"
fi
else
echo
echo "qmake not found under specified QMAKE_PATH"
echo " QMAKE_PATH=$QMAKE_PATH"
echo "leaving unspecified"
echo
fi
fi
# default to using qmake from the path
if [ -n "$qmakeExe" ]
then
addCMakeVariable "QT_QMAKE_EXECUTABLE:FILEPATH=$qmakeExe"
else
qmakeExe=qmake
fi
# Check qmake can be found
if type $qmakeExe >/dev/null 2>&1
then
# Check the Qt version selected
# parse -> "Using Qt version X.Y.Z in ..."
QtVersion=$($qmakeExe -query QT_VERSION)
# split Major.Minor.Revision - could also use IFS hacking
set -- $(echo "$QtVersion" | sed -e 's/\./ /g')
QtMajor=$1
QtMinor=$2
if [ $QtMajor -lt 4 -o $QtMinor -lt 5 ]
then
echo "*** Error: Qt version provided < 4.5"
echo "*** Please use the -qmake option to specify the location of a version of Qt >= 4.3 "
echo "*** e.g."
echo "*** -qmake /usr/local/qt-4.6.2/bin/qmake"
echo "*** -qmake $installBASE/qt-4.6.2/bin/qmake"
exit 1
fi
else
echo "*** Error: cannot find qmake either at \$QMAKE_PATH or in current \$PATH"
exit 1
fi
}
#
# configure via cmake, but don't actually build anything
#
configParaView()
{
unset cmakeExe
if [ -n "$CMAKE_PATH" ]
then
if [ -d "$CMAKE_PATH" ]
then
if [ -x "$CMAKE_PATH/cmake" ]
then
cmakeExe=$CMAKE_PATH/cmake
elif [ -x "$CMAKE_PATH/bin/cmake" ]
then
cmakeExe=$CMAKE_PATH/bin/cmake
fi
elif [ -x "$CMAKE_PATH" ]
then
cmakeExe=$CMAKE_PATH
fi
if [ -n "$cmakeExe" ]
then
# use absolute path
if [ "${cmakeExe#/}" = "$cmakeExe" ]
then
cmakeExe="$(cd ${cmakeExe%/cmake} 2>/dev/null && pwd)/cmake"
fi
else
echo
echo "cmake not found under specified CMAKE_PATH"
echo " CMAKE_PATH=$CMAKE_PATH"
echo "leaving unspecified"
echo
fi
fi
# default to using cmake from the path
[ -n "$cmakeExe" ] || cmakeExe=cmake
# remove any existing build folder and recreate
if [ -d $ParaView_BINARY_DIR ]
then
echo "removing old build directory"
echo " $ParaView_BINARY_DIR"
rm -rf $ParaView_BINARY_DIR
fi
mkdir -p $ParaView_BINARY_DIR
addCMakeVariable "CMAKE_BUILD_TYPE:STRING=$buildType"
cd $ParaView_BINARY_DIR || exit 1 # change to build folder
echo "----"
echo "Configuring paraview-$ParaView_VERSION (major version: $ParaView_MAJOR)"
echo " MPI support : ${withMPI:-false}"
echo " Python support : ${withPYTHON:-false}"
echo " MESA support : ${withMESA:-false}"
echo " Qt dev support : ${withQT:-false}"
echo " Source : $ParaView_SOURCE_DIR"
echo " Build : $ParaView_BINARY_DIR"
echo " Target : $ParaView_DIR"
echo " Build type : $buildType"
echo "----"
echo
echo "$cmakeExe" \
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
$CMAKE_VARIABLES \
$ParaView_SOURCE_DIR
echo
echo "----"
echo
# run cmake to create Makefiles
$cmakeExe \
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
$CMAKE_VARIABLES \
$ParaView_SOURCE_DIR
}
#
# invoke make
# also link bin/ to lib/paraview-* for development without installation
#
makeParaView()
{
cd $ParaView_BINARY_DIR || exit 1 # change to build folder
echo " Starting make"
time make -j $WM_NCOMPPROCS
echo " Done make"
# remove lib if it is a link
# (how this was previously handled before 'make install' worked)
[ -L lib ] && rm lib 2>/dev/null
}
#
# install the program
#
installParaView()
{
cd $ParaView_BINARY_DIR || exit 1 # change to build folder
echo " Installing ParaView to $ParaView_DIR"
make install
cat<< INFO
---
Installation complete for paraview-$ParaView_VERSION
Set environment variables:
export ParaView_DIR=$ParaView_DIR
export PATH=\$ParaView_DIR/bin:\$PATH
export PV_PLUGIN_PATH=\$FOAM_LIBBIN/paraview-$ParaView_MAJOR
---
INFO
}
#------------------------------------------------------------------------------
# clear the referenced variables before using any of the functions
unset withMPI withVERBOSE
unset withQT QMAKE_PATH
unset withMESA MESA_INCLUDE MESA_LIBRARY
unset withPYTHON PYTHON_INCLUDE PYTHON_LIBRARY
unset CMAKE_VARIABLES
unset OBJ_ADD
unset buildType
# start with these general settings
addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON VTK_USE_RPATH:BOOL=OFF"
# include development files in "make install"
addCMakeVariable "PARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON"
# don't build test tree
addCMakeVariable "BUILD_TESTING:BOOL=OFF"
# remove dependency on WebKit
# addCMakeVariable VTK_QT_USE_WEBKIT:BOOL=OFF
# ----------------------------------------------------------------- end-of-file

508
etc/tools/ParaViewFunctions Normal file
View File

@ -0,0 +1,508 @@
#---------------------------------*- sh -*-------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/tools/ParaViewFunctions
#
# Description
# ParaView make/install helper functions
#
#------------------------------------------------------------------------------
# buildBASE, installBASE defined from tools/ThirdPartyFunctions
#
# where things are or should be put
# ParaView_VERSION and ParaView_MAJOR should already have been set
#
# ParaView_SOURCE_DIR : location of the original sources
# ParaView_BINARY_DIR : location of the build
# ParaView_DIR : location of the installed program
#
setDirs()
{
ParaView_SOURCE_DIR=$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
[ -d "$ParaView_SOURCE_DIR" ] || {
echo "did not find ParaView-$ParaView_VERSION in these directories:"
echo " WM_THIRD_PARTY_DIR=$WM_THIRD_PARTY_DIR"
echo
echo "abort build"
exit 1
}
# ParaView_BINARY_DIR=$buildBASE/ParaView-$ParaView_VERSION-$OBJ_ADD
ParaView_BINARY_DIR=$buildBASE/ParaView-$ParaView_VERSION
# ParaView_DIR=$installBASE/ParaView-$ParaView_VERSION-$OBJ_ADD
ParaView_DIR=$installBASE/ParaView-$ParaView_VERSION
export ParaView_SOURCE_DIR ParaView_BINARY_DIR ParaView_DIR
echo
echo "ParaView_SOURCE_DIR=$ParaView_SOURCE_DIR"
echo "ParaView_BINARY_DIR=$ParaView_BINARY_DIR"
echo "ParaView_DIR=$ParaView_DIR"
}
#
# set ParaView_VERSION and adjust ParaView_MAJOR accordingly
#
setVersion()
{
[ "$#" -ge 1 ] && ParaView_VERSION="${1##paraview-}"
# the major version is "<digits>.<digits>"
ParaView_MAJOR=$(echo $ParaView_VERSION | \
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/')
export ParaView_VERSION ParaView_MAJOR
}
#------------------------------------------------------------------------------
#
# extract and echo date stamp information from
# VTK/Utilities/kwsys/kwsysDateStamp.cmake
# since the order of the entries is already correct, can use simple sed script
#
echoDateStamp()
{
(
set -- $(
sed -ne 's/^SET(KWSYS_DATE_STAMP_[A-Z]*\([ 0-9]*\)).*$/\1/p' \
$ParaView_SOURCE_DIR/VTK/Utilities/kwsys/kwsysDateStamp.cmake
)
IFS='-'
echo "date-stamp: $*"
)
}
#
# extract version information from
# CMakeLists.txt
# since the order of the entries is already correct, can use simple sed script
#
getVersion()
{
(
set -- $(
sed -ne 's/^SET(PARAVIEW_VERSION_[A-Z]*\([ 0-9]*\)).*$/\1/p' \
$ParaView_SOURCE_DIR/CMakeLists.txt
)
IFS='.'
echo "$*"
)
}
#
# compare version information
#
checkVersion()
{
local ver=$(getVersion)
if [ "$ParaView_VERSION" != "$ver" ]
then
echo "MISMATCH!"
echo " specified $ParaView_VERSION"
echo " found $ver"
fi
}
#
# set CMake cache variables
#
addCMakeVariable()
{
while [ -n "$1" ]
do
CMAKE_VARIABLES="$CMAKE_VARIABLES -D$1"
shift
done
}
#
# verbose makefiles
#
addVerbosity()
{
[ "$withVERBOSE" = true ] && addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE"
}
#
# define options for mpi support
#
addMpiSupport()
{
[ "${withMPI:=false}" = true ] || return
OBJ_ADD="$OBJ_ADD-mpi"
addCMakeVariable "PARAVIEW_USE_MPI=ON VTK_USE_MPI=ON"
addCMakeVariable "MPI_INCLUDE_PATH=$MPI_ARCH_PATH/include"
addCMakeVariable "MPI_LIBRARY=$MPI_ARCH_PATH/lib/libmpi.so"
if [ -e $MPI_ARCH_PATH/lib/libmpi_cxx.so ]
then
addCMakeVariable "MPI_EXTRA_LIBRARY=$MPI_ARCH_PATH/lib/libmpi_cxx.so"
fi
addCMakeVariable "VTK_MPIRUN_EXE=$MPI_ARCH_PATH/bin/mpirun"
addCMakeVariable "VTK_MPI_MAX_NUMPROCS=$MPI_MAX_PROCS"
}
#
# define options for python support
#
addPythonSupport()
{
[ "${withPYTHON:=false}" = true ] || return
OBJ_ADD="$OBJ_ADD-py"
if pythonBin=$(which python 2>/dev/null)
then
if [ -n "$PYTHON_LIBRARY" ]
then
# check $PYTHON_LIBRARY if it has been set
if [ ! -e "$PYTHON_LIBRARY" ]
then
echo "*** Error: libpython not found at location specified " \
"by -pythnon-lib input: PYTHON_LIBRARY=$PYTHON_LIBRARY"
fi
else
# Try to get $PYTHON_LIBRARY from dynamically linked binary
PYTHON_LIBRARY=$(ldd $pythonBin | \
sed -ne '/libpython/s/.* => \(.*\) (.*/\1/p')
[ -e "$PYTHON_LIBRARY" ] || {
echo "*** Error: Unable to determine path to python library."
}
fi
[ -e "$PYTHON_LIBRARY" ] || {
echo " Please set the full path to the python library "
echo " (including libpython) using the -python-lib option, "
echo " or deactivate python support by not using the -python "
echo " option"
exit 1
}
pythonMajor=$(echo $PYTHON_LIBRARY | sed 's/.*libpython\(.*\)\.so.*/\1/')
pythonInclude=/usr/include/python$pythonMajor
# note - we could also allow for a PYTHON_INCLUDE variable ...
[ -d "$pythonInclude" ] || {
echo " No python headers found in $pythonInclude/"
echo " Please install python headers or deactivate "
echo " python support by not using the -python option"
exit 1
}
addCMakeVariable "PARAVIEW_ENABLE_PYTHON=ON"
addCMakeVariable "PYTHON_INCLUDE_PATH=$pythonInclude"
addCMakeVariable "PYTHON_LIBRARY=$PYTHON_LIBRARY"
echo "----"
echo "Python information:"
echo " executable : $pythonBin"
echo " version : $pythonMajor"
echo " include path : $pythonInclude"
echo " library : $PYTHON_LIBRARY"
unset pythonBin pythonInclude pythonMajor
else
echo "*** Error: python not found"
echo "*** Deactivate python support by not using the -python "
echo "*** option"
exit 1
fi
}
#
# define options for mesa support
#
addMesaSupport()
{
[ "${withMESA:=false}" = true ] || return
if [ -d "$MESA_INCLUDE" -a -f "$MESA_LIBRARY" ]
then
OBJ_ADD="$OBJ_ADD-mesa"
addCMakeVariable "VTK_OPENGL_HAS_OSMESA=ON"
addCMakeVariable "OSMESA_INCLUDE_DIR=$MESA_INCLUDE"
addCMakeVariable "OSMESA_LIBRARY=$MESA_LIBRARY"
else
echo "*** Error: no MESA information found"
echo "*** Deactivate MESA support by not using the -mesa option, "
echo "*** or set the correct paths for:"
echo "*** -mesa-include ($MESA_INCLUDE)"
echo "*** -mesa-lib ($MESA_LIBRARY)"
exit 1
fi
}
addQtSupport()
{
QtVersion=none
[ "${withQT:=false}" = true ] || return
addCMakeVariable "PARAVIEW_BUILD_QT_GUI=ON"
unset qmakeExe
if [ -n "$QMAKE_PATH" ]
then
if [ -d "$QMAKE_PATH" ]
then
if [ -x "$QMAKE_PATH/qmake" ]
then
qmakeExe=$QMAKE_PATH/qmake
elif [ -x "$QMAKE_PATH/bin/qmake" ]
then
qmakeExe=$QMAKE_PATH/bin/qmake
fi
elif [ -x "$QMAKE_PATH" ]
then
qmakeExe=$QMAKE_PATH
fi
if [ -n "$qmakeExe" ]
then
# use absolute path
if [ "${qmakeExe#/}" = "$qmakeExe" ]
then
qmakeExe="$(cd ${qmakeExe%/qmake} 2>/dev/null && pwd)/qmake"
fi
else
echo
echo "qmake not found under specified QMAKE_PATH"
echo " QMAKE_PATH=$QMAKE_PATH"
echo "leaving unspecified"
echo
fi
fi
# default to using qmake from the path
if [ -n "$qmakeExe" ]
then
addCMakeVariable "QT_QMAKE_EXECUTABLE:FILEPATH=$qmakeExe"
else
qmakeExe=qmake
fi
# Check qmake can be found
if type $qmakeExe >/dev/null 2>&1
then
# Check the Qt version selected
# parse -> "Using Qt version X.Y.Z in ..."
QtVersion=$($qmakeExe -query QT_VERSION)
# split Major.Minor.Revision - could also use IFS hacking
set -- $(echo "$QtVersion" | sed -e 's/\./ /g')
QtMajor=$1
QtMinor=$2
if [ $QtMajor -lt 4 -o $QtMinor -lt 5 ]
then
echo "*** Error: Qt version provided < 4.5"
echo "*** Please use the -qmake option to specify the location of a version of Qt >= 4.3 "
echo "*** e.g."
echo "*** -qmake /usr/local/qt-4.6.2/bin/qmake"
echo "*** -qmake $installBASE/qt-4.6.2/bin/qmake"
exit 1
fi
else
echo "*** Error: cannot find qmake either at \$QMAKE_PATH or in current \$PATH"
exit 1
fi
}
#
# configure via cmake, but don't actually build anything
#
configParaView()
{
unset cmakeExe
if [ -n "$CMAKE_PATH" ]
then
if [ -d "$CMAKE_PATH" ]
then
if [ -x "$CMAKE_PATH/cmake" ]
then
cmakeExe=$CMAKE_PATH/cmake
elif [ -x "$CMAKE_PATH/bin/cmake" ]
then
cmakeExe=$CMAKE_PATH/bin/cmake
fi
elif [ -x "$CMAKE_PATH" ]
then
cmakeExe=$CMAKE_PATH
fi
if [ -n "$cmakeExe" ]
then
# use absolute path
if [ "${cmakeExe#/}" = "$cmakeExe" ]
then
cmakeExe="$(cd ${cmakeExe%/cmake} 2>/dev/null && pwd)/cmake"
fi
else
echo
echo "cmake not found under specified CMAKE_PATH"
echo " CMAKE_PATH=$CMAKE_PATH"
echo "leaving unspecified"
echo
fi
fi
# default to using cmake from the path
[ -n "$cmakeExe" ] || cmakeExe=cmake
# remove any existing build folder and recreate
if [ -d $ParaView_BINARY_DIR ]
then
echo "removing old build directory"
echo " $ParaView_BINARY_DIR"
rm -rf $ParaView_BINARY_DIR
fi
mkdir -p $ParaView_BINARY_DIR
cd $ParaView_BINARY_DIR || exit 1 # change to build folder
echo "----"
echo "Configuring paraview-$ParaView_VERSION (major version: $ParaView_MAJOR)"
echo " MPI support : ${withMPI:-false}"
echo " Python support : ${withPYTHON:-false}"
echo " MESA support : ${withMESA:-false}"
echo " Qt dev support : ${withQT:-false}"
echo " Source : $ParaView_SOURCE_DIR"
echo " Build : $ParaView_BINARY_DIR"
echo " Target : $ParaView_DIR"
echo "----"
echo
echo "$cmakeExe" \
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
$CMAKE_VARIABLES \
$ParaView_SOURCE_DIR
echo
echo "----"
echo
# run cmake to create Makefiles
$cmakeExe \
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
$CMAKE_VARIABLES \
$ParaView_SOURCE_DIR
}
#
# invoke make
# also link bin/ to lib/paraview-* for development without installation
#
makeParaView()
{
cd $ParaView_BINARY_DIR || exit 1 # change to build folder
echo " Starting make"
time make -j $WM_NCOMPPROCS
echo " Done make"
# remove lib if it is a link
# (how this was previously handled before 'make install' worked)
[ -L lib ] && rm lib 2>/dev/null
}
#
# install the program
#
installParaView()
{
cd $ParaView_BINARY_DIR || exit 1 # change to build folder
echo " Installing ParaView to $ParaView_DIR"
make install
# hack for missing files after install of version 3.14.1
echo "Copying missing files to install folder"
CMAKE_SRC_DIR=$ParaView_SOURCE_DIR/CMake
CMAKE_INSTALL_DIR=$ParaView_DIR/lib/paraview-$ParaView_MAJOR/CMake
cp -f $ParaView_SOURCE_DIR/ParaViewUse.cmake $CMAKE_INSTALL_DIR
cp -f $CMAKE_SRC_DIR/generate_proxydocumentation.cmake $CMAKE_INSTALL_DIR
cp -f $CMAKE_SRC_DIR/smxml_to_xml.xsl $CMAKE_INSTALL_DIR
cp -f $CMAKE_SRC_DIR/xml_to_html.xsl $CMAKE_INSTALL_DIR
cp -f $CMAKE_SRC_DIR/xml_to_wiki.xsl.in $CMAKE_INSTALL_DIR
cp -f $CMAKE_SRC_DIR/generate_qhp.cmake $CMAKE_INSTALL_DIR
unset CMAKE_SRC_DIR CMAKE_INSTALL_DIR
# --- end hack
cat<< INFO
---
Installation complete for paraview-$ParaView_VERSION
Set environment variables:
export ParaView_DIR=$ParaView_DIR
export PATH=\$ParaView_DIR/bin:\$PATH
export PV_PLUGIN_PATH=\$FOAM_LIBBIN/paraview-$ParaView_MAJOR
---
INFO
}
#------------------------------------------------------------------------------
# clear the referenced variables before using any of the functions
unset withMPI withVERBOSE
unset withQT QMAKE_PATH
unset withMESA MESA_INCLUDE MESA_LIBRARY
unset withPYTHON PYTHON_INCLUDE PYTHON_LIBRARY
unset CMAKE_VARIABLES
unset OBJ_ADD
# start with these general settings
addCMakeVariable "VTK_USE_TK:BOOL=OFF"
addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON VTK_USE_RPATH:BOOL=OFF"
addCMakeVariable "CMAKE_BUILD_TYPE:STRING=Release"
# include development files in "make install"
addCMakeVariable "PARAVIEW_INSTALL_DEVELOPMENT:BOOL=ON"
# don't build test tree
addCMakeVariable "BUILD_TESTING:BOOL=OFF"
# remove dependency on WebKit
# addCMakeVariable VTK_QT_USE_WEBKIT:BOOL=OFF
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,122 @@
#---------------------------------*- sh -*-------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/tools/ThirdPartyFunctions
#
# Description
# Functions for managing the third-party packages
#
# Define the standard buildBASE and installBASE for the platform
# Define WM_NCOMPPROCS always.
#------------------------------------------------------------------------------
# define the normal build and prefix directories
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER
#
# mostly building without wmake
# - disable wmakeScheduler variables
# - restrict WM_NCOMPPROCS to local number of cores
#
unset WM_HOSTS WM_SCHEDULER
export WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo 2>/dev/null | wc -l)
if [ $WM_NCOMPPROCS -le 1 ]
then
WM_NCOMPPROCS=1
elif [ $WM_NCOMPPROCS -ge 8 ]
then
WM_NCOMPPROCS=8
fi
# echo "Building on $WM_NCOMPPROCS cores"
#
# download file $1 from url $2 into download/ directory
#
downloadFile()
{
[ "$#" -eq 2 ] || {
echo "downloadFile called with incorrect number of arguments $@"
return 1
}
file="$1"
url="$2"
if [ ! -e download/$file ]
then
mkdir -p download
echo "downloading $tarFile from $url"
( cd download && wget --no-check-certificate $url -O $file )
fi
}
#
# copy Make/{files,options} from wmakeFiles/PACKAGE
#
# $1 = PACKAGE
# $2 (optional) TARGET DIRECTORY
cpMakeFiles()
{
set +x
[ "$#" -eq 1 -o "$#" -eq 2 ] || {
echo "cpMakeFiles called with incorrect number of arguments $@"
return 1
}
pkg=$1
dst=${2:-.}
echo "cpMakeFiles" $pkg $dst
wmakeFiles=$WM_THIRD_PARTY_DIR/etc/wmakeFiles/$pkg
for i in $(cd $wmakeFiles && find . -type f)
do
d=${i%/*} # dirname
b=${i##*/} # basename
mkdir -p $dst/$d/Make 2>/dev/null
# NOTE the behaviour of '-nt' can cause problems
#
# - bash, ksh, /usr/bin/test
# True, if file1 exists and file2 does not
#
# - dash, zsh (and maybe others)
# False, if file1 or file2 does not exist
#
if [ ! -e $dst/$d/Make/$b -o $wmakeFiles/$i -nt $dst/$d/Make/$b ]
then
cp $wmakeFiles/$i $dst/$d/Make/$b
fi
done
set -x
}
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,21 @@
EXE =
LIB = .so
OBJ = .o
MAKE = make
AR = gcc
ARFLAGS = -m32 -shared -o
CAT = cat
CCS = gcc
CCP = mpicc
CCD = mpicc
CFLAGS = -m32 -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -Drestrict=__restrict
CLIBFLAGS = -shared -fPIC
LDFLAGS = -Xlinker --no-as-needed -L$MPI_ARCH_PATH/lib -m32 -lz -lm -lrt
CP = cp
LEX = flex -Pscotchyy -olex.yy.c
LN = ln
MKDIR = mkdir
MV = mv
RANLIB = echo
YACC = bison -pscotchyy -y -b y

View File

@ -0,0 +1,21 @@
EXE =
LIB = .so
OBJ = .o
MAKE = make
AR = gcc
ARFLAGS = -shared -o
CAT = cat
CCS = gcc
CCP = mpicc
CCD = mpicc
CFLAGS = -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -Drestrict=__restrict
CLIBFLAGS = -shared -fPIC
LDFLAGS = -Xlinker --no-as-needed -lz -lm -lrt
CP = cp
LEX = flex -Pscotchyy -olex.yy.c
LN = ln
MKDIR = mkdir
MV = mv
RANLIB = echo
YACC = bison -pscotchyy -y -b y

View File

@ -0,0 +1,21 @@
EXE =
LIB = .so
OBJ = .o
MAKE = make
AR = gcc
ARFLAGS = -shared -o
CAT = cat
CCS = gcc
CCP = mpicc
CCD = mpicc
CFLAGS = -O3 -DINTSIZE64 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -Drestrict=__restrict
CLIBFLAGS = -shared -fPIC
LDFLAGS = -Xlinker --no-as-needed -lz -lm -lrt
CP = cp
LEX = flex -Pscotchyy -olex.yy.c
LN = ln
MKDIR = mkdir
MV = mv
RANLIB = echo
YACC = bison -pscotchyy -y -b y

290
makeCGAL Executable file
View File

@ -0,0 +1,290 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# 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
#
# Mixing system and ThirdParty for gmp/mpfr is not supported.
#
#------------------------------------------------------------------------------
set -x
cgalPACKAGE=CGAL-4.5.1
boostPACKAGE=boost-system
gmpPACKAGE=gmp-system
mpfrPACKAGE=mpfr-system
#------------------------------------------------------------------------------
# run from third-party directory only
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [CGAL-VERSION] [boost-VERSION] [gmp-VERSION] [mpfr-VERSION]
options:
-gcc force g++ instead of the value from \$WM_CXX
-help
* build CGAL with
$cgalPACKAGE
$boostPACKAGE
$gmpPACKAGE
$mpfrPACKAGE
Normally builds against ThirdParty boost and gmp/mpfr when possible.
To override this behaviour (and use the system boost and/o gmp/mpfr),
simply specify a 'system' version. For example,
${0##*/} boost-system gmp-system
Note: mixing system and ThirdParty for gmp/mpfr is not supported.
USAGE
exit 1
}
# ensure CMake gets the correct C++ compiler
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CXX=g++ # use g++
shift
;;
gmp-[4-9]* | gmp-sys*)
gmpPACKAGE="${1%%/}"
shift
;;
mpfr-[2-9]* | mpfr-sys*)
mpfrPACKAGE="${1%%/}"
shift
;;
CGAL-[0-9]*)
cgalPACKAGE="${1%%/}"
shift
;;
boost-[0-9]* | boost_[0-9]* | boost-sys* )
boostPACKAGE="${1%%/}"
shift
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
#------------------------------------------------------------------------------
#
# Build Boost
#
# 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 [ -d "$BOOST_SOURCE_DIR" ]
then
boostInc="$BOOST_ARCH_PATH/include"
boostLib="$BOOST_ARCH_PATH/lib"
echo "Starting build: boost"
(
cd $BOOST_SOURCE_DIR || exit 1
rm -rf $BOOST_ARCH_PATH
./bootstrap.sh \
--prefix=$BOOST_ARCH_PATH \
--with-libraries=thread \
--with-libraries=system \
&& ./bjam toolset=$WM_CC -j $WM_NCOMPPROCS install \
&& echo "Built: boost"
) || {
echo "Error building: boost"
exit 1
}
else
boostInc="/usr/include"
# for completeness:
# 64-bit needs lib64, but 32-bit needs lib (not lib32)
if [ "$WM_ARCH_OPTION" = 64 ]
then
boostLib="/usr/lib$WM_ARCH_OPTION"
else
boostLib="/usr/lib"
fi
fi
# retrieve boost version:
if [ -f "$boostInc/boost/version.hpp" ]
then
BOOST_VERSION_NO=`sed -ne 's/^#define *BOOST_VERSION *\([0-9][0-9]*\).*$/\1/p' $boostInc/boost/version.hpp`
else
echo "Boost does not appear to be installed"
echo "stopping build"
exit 1
fi
#
# Build CGAL
#
# CGAL_SOURCE_DIR : location of the original sources
# CGAL_BINARY_DIR : location of the build
# CGAL_DIR : location of the installed program
CGAL_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$cgalPACKAGE
CGAL_BINARY_DIR=$buildBASE/$cgalPACKAGE
CGAL_ARCH_PATH=$installBASE/$cgalPACKAGE
CGAL_DIR=$CGAL_ARCH_PATH
#
# gmp/mpfr installed without compiler name
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE
(
# remove any existing build folder and recreate
if [ -d $CGAL_BINARY_DIR ]
then
echo "removing old build directory"
echo " $CGAL_BINARY_DIR"
rm -rf $CGAL_BINARY_DIR
fi
mkdir -p $CGAL_BINARY_DIR
cd $CGAL_BINARY_DIR || exit 1
unset configBoost configGmpMpfr
echo "----"
echo "Configuring $cgalPACKAGE with boost $BOOST_VERSION_NO"
echo " Source : $CGAL_SOURCE_DIR"
echo " Build : $CGAL_BINARY_DIR"
echo " Target : $CGAL_DIR"
if [ -d "$BOOST_ARCH_PATH" ]
then
echo " ThirdParty : boost"
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
-DBoost_VERSION=$BOOST_VERSION_NO
CMAKE_OPTIONS
)
else
echo " system : boost"
configBoost=$(cat <<CMAKE_OPTIONS
-DBOOST_LIBRARYDIR=$boostLib
CMAKE_OPTIONS
)
fi
if [ -d "$GMP_ARCH_PATH" -a -d "$MPFR_ARCH_PATH" ]
then
echo " ThirdParty : gmp/mpfr"
configGmpMpfr=$(cat <<CMAKE_OPTIONS
-DGMP_INCLUDE_DIR=$GMP_ARCH_PATH/include
-DGMP_LIBRARIES_DIR=$GMP_ARCH_PATH/lib
-DGMP_LIBRARIES=$GMP_ARCH_PATH/lib/libgmp.so
-DGMPXX_INCLUDE_DIR=$GMP_ARCH_PATH/include
-DGMPXX_LIBRARIES=$GMP_ARCH_PATH/lib/libgmpxx.so
-DMPFR_INCLUDE_DIR=$MPFR_ARCH_PATH/include
-DMPFR_LIBRARIES_DIR=$MPFR_ARCH_PATH/lib
-DMPFR_LIBRARIES=$MPFR_ARCH_PATH/lib/libmpfr.so
CMAKE_OPTIONS
)
else
echo " system : gmp/mpfr"
fi
echo "----"
set -x
cmake \
-DCMAKE_INSTALL_PREFIX=$CGAL_ARCH_PATH \
-DCMAKE_BUILD_TYPE=Release \
$configBoost $configGmpMpfr \
$CGAL_SOURCE_DIR \
&& 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
echo "Done CGAL"
)
# ----------------------------------------------------------------- end-of-file

123
makeCmake Executable file
View File

@ -0,0 +1,123 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# makeCmake
#
# Description
# Build script for cmake
#
#------------------------------------------------------------------------------
cmakePACKAGE=cmake-2.8.12.1
#------------------------------------------------------------------------------
# run from third-party directory only
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [cmake-VERSION]
options:
-gcc force g++ instead of the value from \$WM_CXX
-help
* build cmake
$cmakePACKAGE
USAGE
exit 1
}
# ensure CMake gets the correct C++ compiler
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CC" ] && export CC="$WM_CC"
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CC=gcc # use gcc
export CXX=g++ # use g++
shift
;;
cmake-[1-9]*)
cmakePACKAGE="${1%%/}"
shift
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
#------------------------------------------------------------------------------
prefixDIR=$installBASE/$cmakePACKAGE
#
# Build CMAKE
#
echo "---------------"
if [ -d "$prefixDIR" -a -r "$prefixDIR/bin/cmake" ]
then
echo "Already built: $cmakePACKAGE"
else
echo "Starting build: $cmakePACKAGE"
(
sourceDIR=$WM_THIRD_PARTY_DIR/$cmakePACKAGE
buildDIR=$buildBASE/$cmakePACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
$sourceDIR/bootstrap --prefix=$prefixDIR \
&& time make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $cmakePACKAGE"
) || {
echo "Error building: $cmakePACKAGE"
exit 1
}
fi
# ----------------------------------------------------------------- end-of-file

291
makeGcc Executable file
View File

@ -0,0 +1,291 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# makeGcc
#
# Description
# Build script for gmp, mpfr and gcc
#
# Note
# gcc 4.3.2 is known to miscompile GMP 4.3.x on 64-bit machines
#
#------------------------------------------------------------------------------
gmpPACKAGE=gmp-5.0.4
mpfrPACKAGE=mpfr-3.1.0
mpcPACKAGE=mpc-0.9
gccPACKAGE=gcc-4.6.2
#------------------------------------------------------------------------------
# run from third-party directory only
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [gmp-VERSION] [mpfr-VERSION] [mpc-VERSION] [gcc-VERSION]
* build combinations of gmp, mpfr, mpc and gcc
$gmpPACKAGE
$mpfrPACKAGE
$mpcPACKAGE
$gccPACKAGE
USAGE
exit 1
}
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
gmp-[4-9]*)
gmpPACKAGE="${1%%/}"
shift
;;
mpfr-[2-9]*)
mpfrPACKAGE="${1%%/}"
shift
;;
mpc-[0-9]*)
mpcPACKAGE="${1%%/}"
shift
;;
gcc-[4-9]*)
gccPACKAGE="${1%%/}"
shift
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
# set 32 or 64 bit ABI
case "$WM_ARCH_OPTION" in
32 | 64)
ABI=$WM_ARCH_OPTION
;;
*)
usage "Please set WM_ARCH_OPTION to either 32 or 64'$*'"
;;
esac
#------------------------------------------------------------------------------
# build/install without compiler name
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
GCC_ARCH_PATH=$installBASE/$gccPACKAGE
GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE
MPC_ARCH_PATH=$installBASE/$mpcPACKAGE
# mpc is not needed for gcc older than 4.5
case "$gccPACKAGE" in
gcc-4.[0-4].*)
mpcPACKAGE=false
;;
esac
#
# Build GMP
#
echo "---------------"
if [ -d $GMP_ARCH_PATH ]
then
echo "Already built: $gmpPACKAGE"
else
echo "Starting build: $gmpPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gmpPACKAGE
buildDIR=$buildBASE/$gmpPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$GMP_ARCH_PATH \
--enable-cxx \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gmpPACKAGE"
) || {
echo "Error building: $gmpPACKAGE"
exit 1
}
fi
export LD_LIBRARY_PATH="$GMP_ARCH_PATH/lib:$LD_LIBRARY_PATH"
#
# Build MPFR
#
echo "---------------"
if [ -d $MPFR_ARCH_PATH ]
then
echo "Already built: $mpfrPACKAGE"
else
echo "Starting build: $mpfrPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$mpfrPACKAGE
buildDIR=$buildBASE/$mpfrPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$MPFR_ARCH_PATH \
--with-gmp=$GMP_ARCH_PATH \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpfrPACKAGE"
) || {
echo "Error building: $mpfrPACKAGE"
exit 1
}
fi
export LD_LIBRARY_PATH="$MPFR_ARCH_PATH/lib:$LD_LIBRARY_PATH"
#
# Build mpc
#
echo "---------------"
if [ -d $MPC_ARCH_PATH ]
then
echo "Already built: $mpcPACKAGE"
elif [ "$mpcPACKAGE" = false ]
then
echo "Skip building mpc - not needed for older gcc versions"
else
echo "Starting build: $mpcPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$mpcPACKAGE
buildDIR=$buildBASE/$mpcPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$MPC_ARCH_PATH \
--with-gmp=$GMP_ARCH_PATH \
--with-mpfr=$MPFR_ARCH_PATH \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpcPACKAGE"
) || {
echo "Error building: $mpcPACKAGE"
exit 1
}
fi
if [ -d "$MPC_ARCH_PATH" ]
then
export LD_LIBRARY_PATH="$MPC_ARCH_PATH/lib:$LD_LIBRARY_PATH"
fi
#
# Build GCC
# might need 32-bit glibc-devel headers to compile
# E.g. on ubuntu install g++-multilib
#
echo "---------------"
if [ -d $GCC_ARCH_PATH ]
then
echo "Already built: $gccPACKAGE"
else
echo "Starting build: $gccPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gccPACKAGE
buildDIR=$buildBASE/$gccPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
unset withMpc
[ -d "$MPC_ARCH_PATH" ] && withMpc="--with-mpc=$MPC_ARCH_PATH"
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure \
--prefix=$GCC_ARCH_PATH \
--with-gmp=$GMP_ARCH_PATH \
--with-mpfr=$MPFR_ARCH_PATH \
$withMpc \
--with-pkgversion=OpenFOAM \
--enable-languages=c,c++ \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--with-system-zlib \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gccPACKAGE"
) || {
echo "Error building: $gccPACKAGE"
exit 1
}
fi
# ----------------------------------------------------------------- end-of-file

291
makeGcc46 Executable file
View File

@ -0,0 +1,291 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# makeGcc
#
# Description
# Build script for gmp, mpfr and gcc
#
# Note
# gcc 4.3.2 is known to miscompile GMP 4.3.x on 64-bit machines
#
#------------------------------------------------------------------------------
gmpPACKAGE=gmp-5.0.2
mpfrPACKAGE=mpfr-3.0.1
mpcPACKAGE=mpc-0.9
gccPACKAGE=gcc-4.6.1
#------------------------------------------------------------------------------
# run from third-party directory only
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [gmp-VERSION] [mpfr-VERSION] [mpc-VERSION] [gcc-VERSION]
* build combinations of gmp, mpfr, mpc and gcc
$gmpPACKAGE
$mpfrPACKAGE
$mpcPACKAGE
$gccPACKAGE
USAGE
exit 1
}
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
gmp-[4-9]*)
gmpPACKAGE="${1%%/}"
shift
;;
mpfr-[2-9]*)
mpfrPACKAGE="${1%%/}"
shift
;;
mpc-[0-9]*)
mpcPACKAGE="${1%%/}"
shift
;;
gcc-[4-9]*)
gccPACKAGE="${1%%/}"
shift
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
# set 32 or 64 bit ABI
case "$WM_ARCH_OPTION" in
32 | 64)
ABI=$WM_ARCH_OPTION
;;
*)
usage "Please set WM_ARCH_OPTION to either 32 or 64'$*'"
;;
esac
#------------------------------------------------------------------------------
# build/install without compiler name
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
GCC_ARCH_PATH=$installBASE/$gccPACKAGE
GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE
MPC_ARCH_PATH=$installBASE/$mpcPACKAGE
# mpc is not needed for gcc older than 4.5
case "$gccPACKAGE" in
gcc-4.[0-4].*)
mpcPACKAGE=false
;;
esac
#
# Build GMP
#
echo "---------------"
if [ -d $GMP_ARCH_PATH ]
then
echo "Already built: $gmpPACKAGE"
else
echo "Starting build: $gmpPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gmpPACKAGE
buildDIR=$buildBASE/$gmpPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$GMP_ARCH_PATH \
--enable-cxx \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gmpPACKAGE"
) || {
echo "Error building: $gmpPACKAGE"
exit 1
}
fi
export LD_LIBRARY_PATH="$GMP_ARCH_PATH/lib:$LD_LIBRARY_PATH"
#
# Build MPFR
#
echo "---------------"
if [ -d $MPFR_ARCH_PATH ]
then
echo "Already built: $mpfrPACKAGE"
else
echo "Starting build: $mpfrPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$mpfrPACKAGE
buildDIR=$buildBASE/$mpfrPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$MPFR_ARCH_PATH \
--with-gmp=$GMP_ARCH_PATH \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpfrPACKAGE"
) || {
echo "Error building: $mpfrPACKAGE"
exit 1
}
fi
export LD_LIBRARY_PATH="$MPFR_ARCH_PATH/lib:$LD_LIBRARY_PATH"
#
# Build mpc
#
echo "---------------"
if [ -d $MPC_ARCH_PATH ]
then
echo "Already built: $mpcPACKAGE"
elif [ "$mpcPACKAGE" = false ]
then
echo "Skip building mpc - not needed for older gcc versions"
else
echo "Starting build: $mpcPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$mpcPACKAGE
buildDIR=$buildBASE/$mpcPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$MPC_ARCH_PATH \
--with-gmp=$GMP_ARCH_PATH \
--with-mpfr=$MPFR_ARCH_PATH \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpcPACKAGE"
) || {
echo "Error building: $mpcPACKAGE"
exit 1
}
fi
if [ -d "$MPC_ARCH_PATH" ]
then
export LD_LIBRARY_PATH="$MPC_ARCH_PATH/lib:$LD_LIBRARY_PATH"
fi
#
# Build GCC
# might need 32-bit glibc-devel headers to compile
# E.g. on ubuntu install g++-multilib
#
echo "---------------"
if [ -d $GCC_ARCH_PATH ]
then
echo "Already built: $gccPACKAGE"
else
echo "Starting build: $gccPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gccPACKAGE
buildDIR=$buildBASE/$gccPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
unset withMpc
[ -d "$MPC_ARCH_PATH" ] && withMpc="--with-mpc=$MPC_ARCH_PATH"
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure \
--prefix=$GCC_ARCH_PATH \
--with-gmp=$GMP_ARCH_PATH \
--with-mpfr=$MPFR_ARCH_PATH \
$withMpc \
--with-pkgversion=OpenFOAM \
--enable-languages=c,c++ \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--with-system-zlib \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gccPACKAGE"
) || {
echo "Error building: $gccPACKAGE"
exit 1
}
fi
# ----------------------------------------------------------------- end-of-file

291
makeGcc47 Executable file
View File

@ -0,0 +1,291 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# makeGcc
#
# Description
# Build script for gmp, mpfr and gcc
#
# Note
# gcc 4.3.2 is known to miscompile GMP 4.3.x on 64-bit machines
#
#------------------------------------------------------------------------------
gmpPACKAGE=gmp-5.0.2
mpfrPACKAGE=mpfr-3.0.1
mpcPACKAGE=mpc-0.9
gccPACKAGE=gcc-4.7.2
#------------------------------------------------------------------------------
# run from third-party directory only
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [gmp-VERSION] [mpfr-VERSION] [mpc-VERSION] [gcc-VERSION]
* build combinations of gmp, mpfr, mpc and gcc
$gmpPACKAGE
$mpfrPACKAGE
$mpcPACKAGE
$gccPACKAGE
USAGE
exit 1
}
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
gmp-[4-9]*)
gmpPACKAGE="${1%%/}"
shift
;;
mpfr-[2-9]*)
mpfrPACKAGE="${1%%/}"
shift
;;
mpc-[0-9]*)
mpcPACKAGE="${1%%/}"
shift
;;
gcc-[4-9]*)
gccPACKAGE="${1%%/}"
shift
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
# set 32 or 64 bit ABI
case "$WM_ARCH_OPTION" in
32 | 64)
ABI=$WM_ARCH_OPTION
;;
*)
usage "Please set WM_ARCH_OPTION to either 32 or 64'$*'"
;;
esac
#------------------------------------------------------------------------------
# build/install without compiler name
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
GCC_ARCH_PATH=$installBASE/$gccPACKAGE
GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE
MPC_ARCH_PATH=$installBASE/$mpcPACKAGE
# mpc is not needed for gcc older than 4.5
case "$gccPACKAGE" in
gcc-4.[0-4].*)
mpcPACKAGE=false
;;
esac
#
# Build GMP
#
echo "---------------"
if [ -d $GMP_ARCH_PATH ]
then
echo "Already built: $gmpPACKAGE"
else
echo "Starting build: $gmpPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gmpPACKAGE
buildDIR=$buildBASE/$gmpPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$GMP_ARCH_PATH \
--enable-cxx \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gmpPACKAGE"
) || {
echo "Error building: $gmpPACKAGE"
exit 1
}
fi
export LD_LIBRARY_PATH="$GMP_ARCH_PATH/lib:$LD_LIBRARY_PATH"
#
# Build MPFR
#
echo "---------------"
if [ -d $MPFR_ARCH_PATH ]
then
echo "Already built: $mpfrPACKAGE"
else
echo "Starting build: $mpfrPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$mpfrPACKAGE
buildDIR=$buildBASE/$mpfrPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$MPFR_ARCH_PATH \
--with-gmp=$GMP_ARCH_PATH \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpfrPACKAGE"
) || {
echo "Error building: $mpfrPACKAGE"
exit 1
}
fi
export LD_LIBRARY_PATH="$MPFR_ARCH_PATH/lib:$LD_LIBRARY_PATH"
#
# Build mpc
#
echo "---------------"
if [ -d $MPC_ARCH_PATH ]
then
echo "Already built: $mpcPACKAGE"
elif [ "$mpcPACKAGE" = false ]
then
echo "Skip building mpc - not needed for older gcc versions"
else
echo "Starting build: $mpcPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$mpcPACKAGE
buildDIR=$buildBASE/$mpcPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$MPC_ARCH_PATH \
--with-gmp=$GMP_ARCH_PATH \
--with-mpfr=$MPFR_ARCH_PATH \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpcPACKAGE"
) || {
echo "Error building: $mpcPACKAGE"
exit 1
}
fi
if [ -d "$MPC_ARCH_PATH" ]
then
export LD_LIBRARY_PATH="$MPC_ARCH_PATH/lib:$LD_LIBRARY_PATH"
fi
#
# Build GCC
# might need 32-bit glibc-devel headers to compile
# E.g. on ubuntu install g++-multilib
#
echo "---------------"
if [ -d $GCC_ARCH_PATH ]
then
echo "Already built: $gccPACKAGE"
else
echo "Starting build: $gccPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gccPACKAGE
buildDIR=$buildBASE/$gccPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
unset withMpc
[ -d "$MPC_ARCH_PATH" ] && withMpc="--with-mpc=$MPC_ARCH_PATH"
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure \
--prefix=$GCC_ARCH_PATH \
--with-gmp=$GMP_ARCH_PATH \
--with-mpfr=$MPFR_ARCH_PATH \
$withMpc \
--with-pkgversion=OpenFOAM \
--enable-languages=c,c++ \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--with-system-zlib \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gccPACKAGE"
) || {
echo "Error building: $gccPACKAGE"
exit 1
}
fi
# ----------------------------------------------------------------- end-of-file

288
makeGcc48 Executable file
View File

@ -0,0 +1,288 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# makeGcc
#
# Description
# Build script for gmp, mpfr and gcc
#
#------------------------------------------------------------------------------
gmpPACKAGE=gmp-5.1.2
mpfrPACKAGE=mpfr-3.1.2
mpcPACKAGE=mpc-1.0.1
gccPACKAGE=gcc-4.8.3
#------------------------------------------------------------------------------
# run from third-party directory only
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [gmp-VERSION] [mpfr-VERSION] [mpc-VERSION] [gcc-VERSION]
* build combinations of gmp, mpfr, mpc and gcc
$gmpPACKAGE
$mpfrPACKAGE
$mpcPACKAGE
$gccPACKAGE
USAGE
exit 1
}
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
gmp-[4-9]*)
gmpPACKAGE="${1%%/}"
shift
;;
mpfr-[2-9]*)
mpfrPACKAGE="${1%%/}"
shift
;;
mpc-[0-9]*)
mpcPACKAGE="${1%%/}"
shift
;;
gcc-[4-9]*)
gccPACKAGE="${1%%/}"
shift
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
# set 32 or 64 bit ABI
case "$WM_ARCH_OPTION" in
32 | 64)
ABI=$WM_ARCH_OPTION
;;
*)
usage "Please set WM_ARCH_OPTION to either 32 or 64'$*'"
;;
esac
#------------------------------------------------------------------------------
# build/install without compiler name
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
GCC_ARCH_PATH=$installBASE/$gccPACKAGE
GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE
MPC_ARCH_PATH=$installBASE/$mpcPACKAGE
# mpc is not needed for gcc older than 4.5
case "$gccPACKAGE" in
gcc-4.[0-4].*)
mpcPACKAGE=false
;;
esac
#
# Build GMP
#
echo "---------------"
if [ -d $GMP_ARCH_PATH ]
then
echo "Already built: $gmpPACKAGE"
else
echo "Starting build: $gmpPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gmpPACKAGE
buildDIR=$buildBASE/$gmpPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$GMP_ARCH_PATH \
--enable-cxx \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gmpPACKAGE"
) || {
echo "Error building: $gmpPACKAGE"
exit 1
}
fi
export LD_LIBRARY_PATH="$GMP_ARCH_PATH/lib:$LD_LIBRARY_PATH"
#
# Build MPFR
#
echo "---------------"
if [ -d $MPFR_ARCH_PATH ]
then
echo "Already built: $mpfrPACKAGE"
else
echo "Starting build: $mpfrPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$mpfrPACKAGE
buildDIR=$buildBASE/$mpfrPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$MPFR_ARCH_PATH \
--with-gmp=$GMP_ARCH_PATH \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpfrPACKAGE"
) || {
echo "Error building: $mpfrPACKAGE"
exit 1
}
fi
export LD_LIBRARY_PATH="$MPFR_ARCH_PATH/lib:$LD_LIBRARY_PATH"
#
# Build mpc
#
echo "---------------"
if [ -d $MPC_ARCH_PATH ]
then
echo "Already built: $mpcPACKAGE"
elif [ "$mpcPACKAGE" = false ]
then
echo "Skip building mpc - not needed for older gcc versions"
else
echo "Starting build: $mpcPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$mpcPACKAGE
buildDIR=$buildBASE/$mpcPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$MPC_ARCH_PATH \
--with-gmp=$GMP_ARCH_PATH \
--with-mpfr=$MPFR_ARCH_PATH \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpcPACKAGE"
) || {
echo "Error building: $mpcPACKAGE"
exit 1
}
fi
if [ -d "$MPC_ARCH_PATH" ]
then
export LD_LIBRARY_PATH="$MPC_ARCH_PATH/lib:$LD_LIBRARY_PATH"
fi
#
# Build GCC
# might need 32-bit glibc-devel headers to compile
# E.g. on ubuntu install g++-multilib
#
echo "---------------"
if [ -d $GCC_ARCH_PATH ]
then
echo "Already built: $gccPACKAGE"
else
echo "Starting build: $gccPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gccPACKAGE
buildDIR=$buildBASE/$gccPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
unset withMpc
[ -d "$MPC_ARCH_PATH" ] && withMpc="--with-mpc=$MPC_ARCH_PATH"
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure \
--prefix=$GCC_ARCH_PATH \
--with-gmp=$GMP_ARCH_PATH \
--with-mpfr=$MPFR_ARCH_PATH \
$withMpc \
--with-pkgversion=OpenFOAM \
--enable-languages=c,c++ \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--with-system-zlib \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gccPACKAGE"
) || {
echo "Error building: $gccPACKAGE"
exit 1
}
fi
# ----------------------------------------------------------------- end-of-file

288
makeGcc49 Executable file
View File

@ -0,0 +1,288 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# makeGcc
#
# Description
# Build script for gmp, mpfr and gcc
#
#------------------------------------------------------------------------------
gmpPACKAGE=gmp-5.1.2
mpfrPACKAGE=mpfr-3.1.2
mpcPACKAGE=mpc-1.0.1
gccPACKAGE=gcc-4.9.2
#------------------------------------------------------------------------------
# run from third-party directory only
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [gmp-VERSION] [mpfr-VERSION] [mpc-VERSION] [gcc-VERSION]
* build combinations of gmp, mpfr, mpc and gcc
$gmpPACKAGE
$mpfrPACKAGE
$mpcPACKAGE
$gccPACKAGE
USAGE
exit 1
}
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
gmp-[4-9]*)
gmpPACKAGE="${1%%/}"
shift
;;
mpfr-[2-9]*)
mpfrPACKAGE="${1%%/}"
shift
;;
mpc-[0-9]*)
mpcPACKAGE="${1%%/}"
shift
;;
gcc-[4-9]*)
gccPACKAGE="${1%%/}"
shift
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
# set 32 or 64 bit ABI
case "$WM_ARCH_OPTION" in
32 | 64)
ABI=$WM_ARCH_OPTION
;;
*)
usage "Please set WM_ARCH_OPTION to either 32 or 64'$*'"
;;
esac
#------------------------------------------------------------------------------
# build/install without compiler name
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
GCC_ARCH_PATH=$installBASE/$gccPACKAGE
GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE
MPC_ARCH_PATH=$installBASE/$mpcPACKAGE
# mpc is not needed for gcc older than 4.5
case "$gccPACKAGE" in
gcc-4.[0-4].*)
mpcPACKAGE=false
;;
esac
#
# Build GMP
#
echo "---------------"
if [ -d $GMP_ARCH_PATH ]
then
echo "Already built: $gmpPACKAGE"
else
echo "Starting build: $gmpPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gmpPACKAGE
buildDIR=$buildBASE/$gmpPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$GMP_ARCH_PATH \
--enable-cxx \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gmpPACKAGE"
) || {
echo "Error building: $gmpPACKAGE"
exit 1
}
fi
export LD_LIBRARY_PATH="$GMP_ARCH_PATH/lib:$LD_LIBRARY_PATH"
#
# Build MPFR
#
echo "---------------"
if [ -d $MPFR_ARCH_PATH ]
then
echo "Already built: $mpfrPACKAGE"
else
echo "Starting build: $mpfrPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$mpfrPACKAGE
buildDIR=$buildBASE/$mpfrPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$MPFR_ARCH_PATH \
--with-gmp=$GMP_ARCH_PATH \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpfrPACKAGE"
) || {
echo "Error building: $mpfrPACKAGE"
exit 1
}
fi
export LD_LIBRARY_PATH="$MPFR_ARCH_PATH/lib:$LD_LIBRARY_PATH"
#
# Build mpc
#
echo "---------------"
if [ -d $MPC_ARCH_PATH ]
then
echo "Already built: $mpcPACKAGE"
elif [ "$mpcPACKAGE" = false ]
then
echo "Skip building mpc - not needed for older gcc versions"
else
echo "Starting build: $mpcPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$mpcPACKAGE
buildDIR=$buildBASE/$mpcPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$MPC_ARCH_PATH \
--with-gmp=$GMP_ARCH_PATH \
--with-mpfr=$MPFR_ARCH_PATH \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpcPACKAGE"
) || {
echo "Error building: $mpcPACKAGE"
exit 1
}
fi
if [ -d "$MPC_ARCH_PATH" ]
then
export LD_LIBRARY_PATH="$MPC_ARCH_PATH/lib:$LD_LIBRARY_PATH"
fi
#
# Build GCC
# might need 32-bit glibc-devel headers to compile
# E.g. on ubuntu install g++-multilib
#
echo "---------------"
if [ -d $GCC_ARCH_PATH ]
then
echo "Already built: $gccPACKAGE"
else
echo "Starting build: $gccPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gccPACKAGE
buildDIR=$buildBASE/$gccPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
unset withMpc
[ -d "$MPC_ARCH_PATH" ] && withMpc="--with-mpc=$MPC_ARCH_PATH"
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure \
--prefix=$GCC_ARCH_PATH \
--with-gmp=$GMP_ARCH_PATH \
--with-mpfr=$MPFR_ARCH_PATH \
$withMpc \
--with-pkgversion=OpenFOAM \
--enable-languages=c,c++ \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--with-system-zlib \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gccPACKAGE"
) || {
echo "Error building: $gccPACKAGE"
exit 1
}
fi
# ----------------------------------------------------------------- end-of-file

118
makeGperftools Executable file
View File

@ -0,0 +1,118 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# makeGperftools
#
# Description
# Build script for gperftools
#
# Note
#
#------------------------------------------------------------------------------
gperftoolsPACKAGE=gperftools-svn
#------------------------------------------------------------------------------
# run from third-party directory only
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [gperftools-VERSION]
* build gperftools
$gperftoolsPACKAGE
USAGE
exit 1
}
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
gperftools-[0-9]* | gperftools-svn*)
gperftoolsPACKAGE="${1%%/}"
shift
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
#------------------------------------------------------------------------------
# build/install without compiler name
prefixDIR=$installBASE/$gperftoolsPACKAGE
#
# Build gperftools
#
echo "---------------"
if [ -d "$prefixDIR" ]
then
echo "Already built: $gperftoolsPACKAGE"
else
echo "Starting build: $gperftoolsPACKAGE"
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gperftoolsPACKAGE
buildDIR=$buildBASE/$gperftoolsPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
# remove old junk
rm -rf $prefixDIR
$sourceDIR/configure \
--prefix=$prefixDIR \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gperftoolsPACKAGE" \
) || {
echo "Error building: $gperftoolsPACKAGE"
exit 1
}
fi
# ----------------------------------------------------------------- end-of-file

134
makeLLVM Executable file
View File

@ -0,0 +1,134 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# makeLLVM
#
# Description
# Build script for llvm/clang etc.
#
# - Checkout LLVM:
# svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm-svn
#
# - Checkout Clang:
# cd llvm-svn/tools
# svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
# cd -
#
#------------------------------------------------------------------------------
llvmPACKAGE=llvm-3.5.0
#------------------------------------------------------------------------------
# run from third-party directory only
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [llvm-VERSION]
* build llvm/clang
$llvmPACKAGE
USAGE
exit 1
}
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
llvm-[0-9]* | llvm-svn*)
llvmPACKAGE="${1%%/}"
shift
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
#------------------------------------------------------------------------------
# build/install without compiler name
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
LLVM_ARCH_PATH=$installBASE/$llvmPACKAGE
# name of source directory
# - may have a llvm/ subdirectory, depending on how the sources were fetched
#
sourceDIR=$WM_THIRD_PARTY_DIR/$llvmPACKAGE
if [ -f $sourceDIR/llvm/configure ]
then
sourceDIR=$sourceDIR/llvm
fi
#
# Build LLVM
#
echo "---------------"
if [ -d $LLVM_ARCH_PATH ]
then
echo "Already built: $llvmPACKAGE"
else
echo "Starting build: $llvmPACKAGE"
echo
(
cd $sourceDIR || exit 1
make distclean 2>/dev/null
buildDIR=$buildBASE/$llvmPACKAGE
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure \
--prefix=$LLVM_ARCH_PATH \
--with-gcc-toolchain=`which gcc | sed s%/bin/gcc%%` \
--enable-optimized \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $llvmPACKAGE"
) || {
echo "Error building: $llvmPACKAGE"
exit 1
}
fi
# ----------------------------------------------------------------- end-of-file

331
makeParaView Executable file
View File

@ -0,0 +1,331 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# makeParaView
#
# Description
# Make and install paraview for version 3.14.1 and higher
# - place the paraview source under $WM_THIRD_PARTY_DIR/ParaView-VERSION
# (note capitalisation)
#
#------------------------------------------------------------------------------
# run from third-party directory only
cd ${0%/*} || exit 1
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
. etc/tools/ParaViewFunctions
#------------------------------------------------------------------------------
#
# USER OPTIONS:
# ~~~~~~~~~~~~~
# MPI support:
withMPI=false
MPI_MAX_PROCS=32
# Python support:
# note: script will try to determine the appropriate python library.
# If it fails, specify the path using the PYTHON_LIBRARY variable
withPYTHON=false
PYTHON_LIBRARY=""
# PYTHON_LIBRARY="/usr/lib64/libpython2.6.so.1.0"
# MESA graphics support:
withMESA=false
MESA_INCLUDE="/usr/include/GL"
MESA_LIBRARY="/usr/lib64/libOSMesa.so"
# extra QT gui support (useful for some third party apps)
withQT=true
# Set the path to the Qt-4.5 (or later) qmake if the system Qt is older
QMAKE_PATH=""
# Set the path to cmake
CMAKE_PATH=""
#
# NO FURTHER EDITING BELOW THIS LINE
#
#-----------------------------------------------------------------------------
Script=${0##*/}
usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: $Script [OPTION] [CMAKE-OPTION]
options:
-rebuild for repeated builds (-make -install) *use with caution*
-mesa with mesa (if not already enabled)
-mpi with mpi (if not already enabled)
-python with python (if not already enabled)
-cmake PATH with the cmake version corresponding to the cmake path given
-qmake PATH with the Qt version corresponding to the qmake path given
-qt with extra Qt gui support (if not already enabled)
-qt-VER with Qt version corresponding to
\$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/qt-VER/bin/qmake
-gcc force g++ instead of the value from \$WM_CXX
-verbose verbose output in Makefiles
-version VER specify an alternative version (current value: $ParaView_VERSION)
-major VER specify an alternative major version for special builds
-mesa-include DIR
location of mesa headers (current value: ${MESA_INCLUDE:-none})
-mesa-lib PATH path to mesa library (current value: ${MESA_LIBRARY:-none})
-python-lib PATH path to python library (current value: ${PYTHON_LIBRARY:-none})
-help
The -no-FEATURE option can be disable these features (if not already disabled):
mesa mpi python qt
CMake options start with a capital letter and contain an '='.
For example,
$Script BUILD_TESTING=ON PARAVIEW_GENERATE_PROXY_DOCUMENTATION=OFF
to add tests and avoid building documentation
For finer control, the build stages can be selected or deselected individually:
-config -no-config
-make -no-make
-install -no-install
* Make and install paraview-$ParaView_VERSION located under
\$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
-> \$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-$ParaView_VERSION
USAGE
exit 1
}
#------------------------------------------------------------------------------
# ensure CMake gets the correct C++ compiler
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CC" ] && export CC="$WM_CC"
#
# add options based on script name:
#
case "$Script" in *-mesa*) withMESA=true;; esac
case "$Script" in *-mpi*) withMPI=true;; esac
case "$Script" in *-python*) withPYTHON=true;; esac
case "$Script" in *-qt*) withQT=true;; esac
# set ParaView_MAJOR based on current value of ParaView_VERSION
setVersion
#
# various building stages
#
unset runCONFIG runMAKE runINSTALL
runDEFAULT=true
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
[A-Z]*=*) # cmake variables
addCMakeVariable "$1"
shift
;;
-gcc)
export CXX=g++ # use g++
shift
;;
-config) # stage 1: config only
runCONFIG=true
unset runDEFAULT
shift
;;
-no-config)
runCONFIG=false
shift
;;
-make) # stage 2: make only
runMAKE=true
unset runDEFAULT
shift
;;
-no-make)
runMAKE=false
shift
;;
-install) # stage 3: install only
runINSTALL=true
unset runDEFAULT
shift
;;
-no-install)
runINSTALL=false
shift
;;
-rebuild) # shortcut for rebuilding
runMAKE=true
runINSTALL=true
unset runDEFAULT
shift
;;
-mesa)
withMESA=true
shift
;;
-no-mesa)
withMESA=false
shift
;;
-mesa-include)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
MESA_INCLUDE="$2"
shift 2
;;
-mesa-lib)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
MESA_LIBRARY="$2"
shift 2
;;
-mpi)
withMPI=true
shift
;;
-no-mpi)
withMPI=false
shift
;;
-python)
withPYTHON=true
shift
;;
-no-python)
withPYTHON=false
shift
;;
-python-lib)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
PYTHON_LIBRARY="$2"
shift 2
;;
-cmake)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
CMAKE_PATH=$2
shift 2
;;
-qmake)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
QMAKE_PATH=$2
shift 2
;;
-qt)
withQT=true
shift
;;
-no-qt)
withQT=false
shift
;;
-qt-[1-9]*)
QMAKE_PATH="$installBASE/${1##-}"
shift
;;
-verbose)
withVERBOSE=true
shift
;;
-version)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
setVersion "$2"
shift 2
;;
-major)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
export ParaView_MAJOR="$2"
shift 2
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
if [ "$runDEFAULT" = true ]
then
: ${runCONFIG:=true}
: ${runMAKE:=true}
: ${runINSTALL:=true}
fi
# Set configure options
#~~~~~~~~~~~~~~~~~~~~~~
addVerbosity # verbose makefiles
addMpiSupport # set MPI-specific options
addPythonSupport # set Python-specific options
addMesaSupport # set MESA-specific options
addQtSupport # add extra Qt support
setDirs # where things are or should be put
echoDateStamp # report kitware source code date-stamp
# Build and install
# ~~~~~~~~~~~~~~~~~
cat<<SUMMARY
Build stages selected
---------------------
-config ${runCONFIG:-false}
-make ${runMAKE:-false}
-install ${runINSTALL:-false}
---------------------
Features selected
mesa ${withMESA:-false}
mpi ${withMPI:-false}
python ${withPYTHON:-false}
qt ${withQT:-false}
---------------------
Version information
qt ${QtVersion:-none}
version ${ParaView_VERSION:-unknown}
major ${ParaView_MAJOR:-unknown}
$(checkVersion)
---------------------
SUMMARY
[ "$runCONFIG" = true ] && configParaView
[ "$runMAKE" = true ] && makeParaView
[ "$runINSTALL" = true ] && installParaView
echo
echo Done
#------------------------------------------------------------------------------

337
makeParaView4 Executable file
View File

@ -0,0 +1,337 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# makeParaView
#
# Description
# Make and install paraview
# - place the paraview source under $WM_THIRD_PARTY_DIR/ParaView-VERSION
# (note capitalisation)
#
#------------------------------------------------------------------------------
# run from third-party directory only
cd ${0%/*} || exit 1
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
. etc/tools/ParaView4Functions
#------------------------------------------------------------------------------
#
# USER OPTIONS:
# ~~~~~~~~~~~~~
# MPI support:
withMPI=false
MPI_MAX_PROCS=32
# Python support:
# note: script will try to determine the appropriate python library.
# If it fails, specify the path using the PYTHON_LIBRARY variable
withPYTHON=false
PYTHON_LIBRARY=""
# PYTHON_LIBRARY="/usr/lib64/libpython2.6.so.1.0"
# MESA graphics support:
withMESA=false
MESA_INCLUDE="/usr/include/GL"
MESA_LIBRARY="/usr/lib64/libOSMesa.so"
# extra QT gui support (useful for some third party apps)
withQT=true
# Set the path to the Qt-4.5 (or later) qmake if the system Qt is older
QMAKE_PATH=""
# Set the path to cmake
CMAKE_PATH=""
#
# NO FURTHER EDITING BELOW THIS LINE
#
#-----------------------------------------------------------------------------
Script=${0##*/}
usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: $Script [OPTION] [CMAKE-OPTION]
options:
-rebuild for repeated builds (-make -install) *use with caution*
-mesa with mesa (if not already enabled)
-mpi with mpi (if not already enabled)
-python with python (if not already enabled)
-cmake PATH with the cmake version corresponding to the cmake path given
-qmake PATH with the Qt version corresponding to the qmake path given
-qt with extra Qt gui support (if not already enabled)
-qt-VER with Qt version corresponding to
\$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/qt-VER/bin/qmake
-gcc force g++ instead of the value from \$WM_CXX
-verbose verbose output in Makefiles
-version VER specify an alternative version (current value: $ParaView_VERSION)
-major VER specify an alternative major version for special builds
-mesa-include DIR
location of mesa headers (current value: ${MESA_INCLUDE:-none})
-mesa-lib PATH path to mesa library (current value: ${MESA_LIBRARY:-none})
-python-lib PATH path to python library (current value: ${PYTHON_LIBRARY:-none})
-help
The -no-FEATURE option can be disable these features (if not already disabled):
mesa mpi python qt
CMake options start with a capital letter and contain an '='.
For example,
$Script BUILD_TESTING=ON
to add tests
For finer control, the build stages can be selected or deselected individually:
-config -no-config
-make -no-make
-install -no-install
* Make and install paraview-$ParaView_VERSION located under
\$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
-> \$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-$ParaView_VERSION
USAGE
exit 1
}
#------------------------------------------------------------------------------
# ensure CMake gets the correct C++ compiler
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CC" ] && export CC="$WM_CC"
#
# add options based on script name:
#
case "$Script" in *-mesa*) withMESA=true;; esac
case "$Script" in *-mpi*) withMPI=true;; esac
case "$Script" in *-python*) withPYTHON=true;; esac
case "$Script" in *-qt*) withQT=true;; esac
# set ParaView_MAJOR based on current value of ParaView_VERSION
setVersion
#
# various building stages
#
unset runCONFIG runMAKE runINSTALL
runDEFAULT=true
buildType=Release
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
[A-Z]*=*) # cmake variables
addCMakeVariable "$1"
shift
;;
-gcc)
export CXX=g++ # use g++
shift
;;
-config) # stage 1: config only
runCONFIG=true
unset runDEFAULT
shift
;;
-no-config)
runCONFIG=false
shift
;;
-make) # stage 2: make only
runMAKE=true
unset runDEFAULT
shift
;;
-no-make)
runMAKE=false
shift
;;
-install) # stage 3: install only
runINSTALL=true
unset runDEFAULT
shift
;;
-no-install)
runINSTALL=false
shift
;;
-rebuild) # shortcut for rebuilding
runMAKE=true
runINSTALL=true
unset runDEFAULT
shift
;;
-mesa)
withMESA=true
shift
;;
-no-mesa)
withMESA=false
shift
;;
-mesa-include)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
MESA_INCLUDE="$2"
shift 2
;;
-mesa-lib)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
MESA_LIBRARY="$2"
shift 2
;;
-mpi)
withMPI=true
shift
;;
-no-mpi)
withMPI=false
shift
;;
-python)
withPYTHON=true
shift
;;
-no-python)
withPYTHON=false
shift
;;
-python-lib)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
PYTHON_LIBRARY="$2"
shift 2
;;
-cmake)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
CMAKE_PATH=$2
shift 2
;;
-qmake)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
QMAKE_PATH=$2
shift 2
;;
-qt)
withQT=true
shift
;;
-no-qt)
withQT=false
shift
;;
-qt-[1-9]*)
QMAKE_PATH="$installBASE/${1##-}"
shift
;;
-verbose)
withVERBOSE=true
shift
;;
-version)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
setVersion "$2"
shift 2
;;
-major)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
export ParaView_MAJOR="$2"
shift 2
;;
-buildType)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
buildType="$2"
shift 2
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
if [ "$runDEFAULT" = true ]
then
: ${runCONFIG:=true}
: ${runMAKE:=true}
: ${runINSTALL:=true}
fi
# Set configure options
#~~~~~~~~~~~~~~~~~~~~~~
addVerbosity # verbose makefiles
addMpiSupport # set MPI-specific options
addPythonSupport # set Python-specific options
addMesaSupport # set MESA-specific options
addQtSupport # add extra Qt support
setDirs # where things are or should be put
echoDateStamp # report kitware source code date-stamp
# Build and install
# ~~~~~~~~~~~~~~~~~
cat<<SUMMARY
Build stages selected
---------------------
-config ${runCONFIG:-false}
-make ${runMAKE:-false}
-install ${runINSTALL:-false}
---------------------
Features selected
mesa ${withMESA:-false}
mpi ${withMPI:-false}
python ${withPYTHON:-false}
qt ${withQT:-false}
---------------------
Version information
qt ${QtVersion:-none}
version ${ParaView_VERSION:-unknown}
major ${ParaView_MAJOR:-unknown}
build ${buildType:-Release}
$(checkVersion)
---------------------
SUMMARY
[ "$runCONFIG" = true ] && configParaView
[ "$runMAKE" = true ] && makeParaView
[ "$runINSTALL" = true ] && installParaView
echo
echo Done
#------------------------------------------------------------------------------