ENH: remove reliance on OpenFOAM etc/config.sh/functions file.

- similar functionality in etc/tools/ThirdPartyFunctions to improve
  the independence of ThirdParty while reducing clutter in the callers.

- add useGcc function for convenience
- mask seeing our own git-repo when building

STYLE: various items

- eliminate old user-editable configuration in files - now command-line only.
- use *_BUILD_DIR instead of *_BINARY_DIR for more clarity of the purpose
- drop use of '-q' option for wmakeCheckPwd (already has stderr redirect)
- drop checkVersion for makeParaView since it stopped working properly
  with newer paraview version

CONFIG: update list of versions
This commit is contained in:
mark
2017-03-14 15:37:21 +01:00
parent 5d592841fd
commit 59be96faed
26 changed files with 437 additions and 472 deletions

View File

@ -32,7 +32,7 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
@ -66,7 +66,10 @@ fi
#------------------------------------------------------------------------------
# Clean various packages via 'distclean'
for i in openmpi-* metis-* adios-* ADIOS-*
for i in \
openmpi-* metis-* adios-* ADIOS-* gperftools-* qt-* \
gmp-* mpfr-* mpc-* gcc-* llvm-* \
;
do
[ -d "$i" ] && (
echo

View File

@ -32,7 +32,7 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
@ -44,7 +44,7 @@ cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# Export WM settings in a form that GNU configure recognizes
# Compiler/linker settings for CMake/configure
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
@ -105,7 +105,7 @@ echo " $SCOTCH_ARCH_PATH"
SCOTCH_SOURCE_DIR=$sourceBASE/$SCOTCH_VERSION
# This needs generalizing, but works fairly well
# Needs generalizing, but works fairly well
scotchMakefile=../../etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM
if [ -f $SCOTCH_ARCH_PATH/include/scotch.h \
@ -118,53 +118,56 @@ elif [ -d "$SCOTCH_SOURCE_DIR" ]
then
(
cd $SCOTCH_SOURCE_DIR/src || exit 1
export GIT_DIR=$SCOTCH_SOURCE_DIR/.git # Mask seeing our own git-repo
rm -rf $SCOTCH_ARCH_PATH
applyPatch $SCOTCH_VERSION .. # patch at parent-level
prefixDIR=$SCOTCH_ARCH_PATH
incDIR=$SCOTCH_ARCH_PATH/include
libDIR=$FOAM_EXT_LIBBIN
mkdir -p $prefixDIR 2>/dev/null
mkdir -p $libDIR 2>/dev/null
mkdir -p $incDIR 2>/dev/null
mkdir -p $libDIR 2>/dev/null
configOpt="prefix=$prefixDIR libdir=$libDIR"
# 'CC' already set (eg, from WM_CC) - set scotch-specific 'CCS' too
[ -n "$CC" ] && export CCS="$CC"
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 # Extra safety
make realclean 2>/dev/null # for safety
make -j $WM_NCOMPPROCS scotch \
&& make \
prefix=$prefixDIR \
includedir=$incDIR \
libdir=$libDIR \
install
make -j $WM_NCOMPPROCS $configEnv scotch \
&& make $configOpt install
# cleanup, could also remove Makefile.inc
make realclean 2>/dev/null
make realclean 2>/dev/null || true # Failed cleanup is uncritical
) || warnBuildIssues SCOTCH
else
warnNotFound SCOTCH
fi
# Build ptscotch if MPI (ThirdParty or system) is available
# and normal scotch was build (has include and library)
# and normal scotch was built (has include and library)
if [ "${FOAM_MPI:-dummy}" != dummy ] && \
[ -f $SCOTCH_ARCH_PATH/include/scotch.h \
-a -r $FOAM_EXT_LIBBIN/libscotch.so ] || \
{
# Report that the above tests failed and pass-through the failure
echo
echo " WARNING: skipping pt-scotch - 'scotch.h' include file not found!"
echo " WARNING: skipping pt-scotch - no mpi or <scotch.h> not found"
false
}
then
@ -182,6 +185,7 @@ then
else
(
cd $SCOTCH_SOURCE_DIR/src || exit 1
export GIT_DIR=$SCOTCH_SOURCE_DIR/.git # Mask seeing our own git-repo
echo
prefixDIR=$SCOTCH_ARCH_PATH
@ -189,42 +193,44 @@ then
libDIR=$FOAM_EXT_LIBBIN/$FOAM_MPI
mkdir -p $prefixDIR 2>/dev/null
mkdir -p $libDIR 2>/dev/null
mkdir -p $incDIR 2>/dev/null
mkdir -p $libDIR 2>/dev/null
configOpt="prefix=$prefixDIR includedir=$incDIR libdir=$libDIR"
# 'CC' already set (eg, from WM_CC) - set scotch-specific 'CCS' too
[ -n "$CC" ] && export CCS="$CC"
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"
echo " Error: ptscotch 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 # Extra safety
make realclean 2>/dev/null # for safety
make -j $WM_NCOMPPROCS ptscotch \
&& make \
prefix=$prefixDIR \
includedir=$incDIR \
libdir=$libDIR \
install
make -j $WM_NCOMPPROCS $configEnv ptscotch \
&& make $configOpt install
# cleanup, could also remove Makefile.inc
make realclean 2>/dev/null
)
make realclean 2>/dev/null || true # Failed cleanup is uncritical
) || warnBuildIssues PTSCOTCH
fi
# verify existence of ptscotch include
# Verify existence of ptscotch include
[ -f $SCOTCH_ARCH_PATH/include/$FOAM_MPI/ptscotch.h ] || {
echo
echo " WARNING: required include file 'ptscotch.h' not found!"
}
fi
# Could now remove $SCOTCH_SOURCE_DIR/src/Makefile.inc
#------------------------------------------------------------------------------
@ -233,7 +239,7 @@ echo
echo ========================================
echo Build Metis decomposition
# get METIS_VERSION, METIS_ARCH_PATH
# Get METIS_VERSION, METIS_ARCH_PATH
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis)
then
. $settings
@ -250,6 +256,7 @@ elif [ -d "$METIS_SOURCE_DIR" ]
then
(
cd $METIS_SOURCE_DIR || exit 1
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
rm -rf $METIS_ARCH_PATH
# Adjust metis integer size to match OpenFOAM label-size
@ -260,10 +267,10 @@ then
# - build normally and use mv to relocate it
make config shared=1 prefix=$METIS_ARCH_PATH \
&& make -j $WM_NCOMPPROCS install \
&& mv $METIS_ARCH_PATH/lib/libmetis.so $FOAM_EXT_LIBBIN
&& make -j $WM_NCOMPPROCS install \
&& mv $METIS_ARCH_PATH/lib/libmetis.so $FOAM_EXT_LIBBIN
rmdir $METIS_ARCH_PATH/lib 2>/dev/null || true # failure is not critical
rmdir $METIS_ARCH_PATH/lib 2>/dev/null || true # Failed rmdir is uncritical
) || warnBuildIssues METIS
else
warnNotFound METIS

View File

@ -184,13 +184,13 @@ and save some disk space.
sources that are bundled with ParaView.
For example, by using a symbolic link:
ln -s ParaView-5.0.1/VTK VTK-7.1.0
ln -s ParaView-v5.3.0/VTK VTK-7.1.0
The appropriate VTK version number can be found from the contents of
the `vtkVersion.cmake` file.
For example,
$ cat ParaView-5.0.1/VTK/CMake/vtkVersion.cmake
$ cat ParaView-v5.3.0/VTK/CMake/vtkVersion.cmake
# VTK version number components.
set(VTK_MAJOR_VERSION 7)
@ -198,18 +198,17 @@ and save some disk space.
set(VTK_BUILD_VERSION 0)
### ParaView
- **ParaView-5.0.1** is the last version for which the OpenFOAM reader
modules (eg, to visualize a `blockMeshDict`) work in their present form.
- Building ParaView requires CMake, qmake and a `qt` development files.
Use the `-cmake`, `-qmake` and `-qt-*` options for `makeParaView` as
required.
See additional notes below about [making Qt](#makeQt) if necessary.
#### 5.3.0
- Compiles without patching.
No known issues with the native OpenFOAM reader.
#### 5.2.0
- Compiles without patching, but the OpenFOAM reader modules
(eg, to visualize a `blockMeshDict`) have not yet been migrated
to this version. Note that the native OpenFOAM reader appears to be
- Compiles without patching, but the native OpenFOAM reader appears to be
partially broken in this version.
#### 4.4.0/5.0.0/5.0.1/5.1.2
@ -245,7 +244,7 @@ and save some disk space.
./makeParaView -qt-4.8.7 5.0.1
- ParaView does not yet support QT5 (Dec-2016, but this will soon change).
- ParaView versions prior to 5.3.0 do not properly support QT5.
- If you relocate the third-party directory to another location
(eg, you built in your home directory, but want to install it in a
@ -332,8 +331,8 @@ GNU *configure* can only be used prior to clang version 3.9.
| Name | Location
|-----------------------|------------------------
| [MESA][page mesa] | [download][link mesa] or [older][older mesa]
| [ParaView][page ParaView] | [download][link ParaView]. The reader modules do not yet work with the newest paraview versions.
| [Qt][page Qt] | [repo][repo Qt] or [download][link Qt]. The newer [Qt5][newer Qt5] is **not** currently supported by ParaView.
| [ParaView][page ParaView] | [download][link ParaView]
| [Qt][page Qt] | [repo][repo Qt] or [download][link Qt]. The newer [Qt5][newer Qt5] only works with ParaView-5.3.0 and later.
### CMake Minimum Requirements <a name="min-cmake"></a>
@ -348,7 +347,8 @@ The minimum CMake requirements for building various components.
2.8.4 cmake-3.6.0
3.3 ParaView-5.1.2
3.3 ParaView-5.2.0
3.4.3 llvm-3.9.0.src
3.3 ParaView-5.3.0
3.4.3 llvm-3.9.1
3.5 ParaView-5.1.0
@ -378,26 +378,26 @@ The minimum gcc/g++ requirements for building various components.
[page clang]: http://llvm.org/
[page llvm]: http://llvm.org/
[link clang]: http://llvm.org/releases/3.7.0/cfe-3.7.0.src.tar.xz
[link llvm]: http://llvm.org/releases/3.7.0/llvm-3.7.0.src.tar.xz
[link clang]: http://llvm.org/releases/3.7.1/cfe-3.7.1.src.tar.xz
[link llvm]: http://llvm.org/releases/3.7.1/llvm-3.7.1.src.tar.xz
[newer clang]: http://llvm.org/releases/3.9.0/cfe-3.9.0.src.tar.xz
[newer llvm]: http://llvm.org/releases/3.9.0/llvm-3.9.0.src.tar.xz
[newer clang]: http://llvm.org/releases/3.9.1/cfe-3.9.1.src.tar.xz
[newer llvm]: http://llvm.org/releases/3.9.1/llvm-3.9.1.src.tar.xz
<!-- parallel -->
[page adios]: https://www.olcf.ornl.gov/center-projects/adios/
[repo adios]: https://github.com/ornladios/ADIOS
[link adios]: https://github.com/ornladios/ADIOS/archive/v1.11.0.tar.gz
[altlink adios]: http://users.nccs.gov/%7Epnorbert/adios-1.11.0.tar.gz
[link adios]: https://github.com/ornladios/ADIOS/archive/v1.11.1.tar.gz
[altlink adios]: http://users.nccs.gov/%7Epnorbert/adios-1.11.1.tar.gz
[page zfp]: http://computation.llnl.gov/projects/floating-point-compression/zfp-versions
[page scotch]: https://www.labri.fr/perso/pelegrin/scotch/
[link scotch]: https://gforge.inria.fr/frs/download.php/file/34099/scotch_6.0.3.tar.gz
[page openmpi]: http://www.open-mpi.org/
[link openmpi]: http://www.open-mpi.org/software/ompi/v1.10/downloads/openmpi-1.10.4.tar.bz2
[newer openmpi]: https://www.open-mpi.org/software/ompi/v2.0/downloads/openmpi-2.0.1.tar.bz2
[older openmpi]: http://www.open-mpi.org/software/ompi/v1.10/downloads/openmpi-1.10.6.tar.bz2
[link openmpi]: https://www.open-mpi.org/software/ompi/v2.0/downloads/openmpi-2.0.2.tar.bz2
<!-- general -->
@ -412,7 +412,7 @@ The minimum gcc/g++ requirements for building various components.
[older CGAL]: https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.8.2/CGAL-4.8.2.tar.xz
[page FFTW]: http://www.fftw.org/
[link FFTW]: http://www.fftw.org/fftw-3.3.5.tar.gz
[link FFTW]: http://www.fftw.org/fftw-3.3.6-pl1.tar.gz
[page cgns]: http://cgns.github.io/
[link ccmio]: http://portal.nersc.gov/project/visit/third_party/libccmio-2.6.1.tar.gz (check usage conditions)
@ -428,11 +428,8 @@ The minimum gcc/g++ requirements for building various components.
<!-- Visualization -->
[page ParaView]: http://www.paraview.org/
[link ParaView]: http://www.paraview.org/files/v5.0/ParaView-v5.0.1-source.tar.gz
[older ParaView-44]: http://www.paraview.org/files/v4.4/ParaView-v4.4.0-source.tar.gz
[newer ParaView-51]: http://www.paraview.org/files/v5.1/ParaView-v5.1.2-source.tar.gz
[newer ParaView-52]: http://www.paraview.org/files/v5.2/ParaView-v5.2.0.tar.gz
[link ParaView]: http://www.paraview.org/files/v5.3/ParaView-v5.3.0.tar.gz
[older ParaView]: http://www.paraview.org/files/v5.0/ParaView-v5.0.1-source.tar.gz
[page mesa]: http://mesa3d.org/
[link mesa]: ftp://ftp.freedesktop.org/pub/mesa/13.0.3/mesa-13.0.3.tar.xz

View File

@ -46,7 +46,7 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party (parent) directory only
wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : current directory is not \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
@ -75,9 +75,9 @@ USAGE
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'') ;; # Ignore empty
-h | -help) usage ;;
*)
pkgconfigAdjust "$1"
;;

View File

@ -44,7 +44,7 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party (parent) directory only
wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : current directory is not \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
@ -72,9 +72,9 @@ USAGE
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'') ;; # Ignore empty
-h | -help) usage ;;
*)
pkgconfigNewPrefix "$1"
;;

View File

@ -32,7 +32,7 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party (parent) directory only
wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : current directory is not \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
@ -40,8 +40,6 @@ wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
. etc/tools/ThirdPartyFunctions
. etc/tools/QtFunctions
#------------------------------------------------------------------------------
unset qtVERSION # No default version
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
@ -61,17 +59,17 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
unset forceOpt
unset optForce
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-f | -force)
forceOpt=true
optForce=true
;;
-qt-[1-9]* | [1-9]* | qt-*)
# -qt-VERSION, VERSION, qt-VERSION, qt-everywhere-opensource-src-VERSION
@ -91,7 +89,7 @@ QT_ARCH_PATH=$installBASE/qt-$qtVERSION
[ -n "$qtVERSION" ] || die "No QT version specified"
[ -d "$QT_ARCH_PATH" ] || die "No QT installation"
if [ "${forceOpt:-false}" = true ]
if [ "${optForce:-false}" = true ]
then
# Create qt.conf and adjust locations to use '${prefix}' internally
finalizeQt

View File

@ -48,7 +48,7 @@ BUILD_TYPE=Release # The cmake build type
# 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_BUILD_DIR : location of the build
# ParaView_DIR : location of the installed program
#
setParaViewDirs()
@ -73,18 +73,17 @@ setParaViewDirs()
exit 1
}
ParaView_BINARY_DIR=$buildBASE/ParaView-$ParaView_VERSION$BUILD_SUFFIX
ParaView_BUILD_DIR=$buildBASE/ParaView-$ParaView_VERSION$BUILD_SUFFIX
ParaView_DIR=$installBASE/ParaView-$ParaView_VERSION$BUILD_SUFFIX
export ParaView_SOURCE_DIR ParaView_BINARY_DIR ParaView_DIR
export ParaView_SOURCE_DIR ParaView_BUILD_DIR ParaView_DIR
echo
echo "ParaView_SOURCE_DIR=$ParaView_SOURCE_DIR"
echo "ParaView_BINARY_DIR=$ParaView_BINARY_DIR"
echo "ParaView_BUILD_DIR=$ParaView_BUILD_DIR"
echo "ParaView_DIR=$ParaView_DIR"
# Prevent git queries from using the ThirdParty repository
export GIT_DIR=$ParaView_SOURCE_DIR/.git
export GIT_DIR=$ParaView_SOURCE_DIR/.git # Mask seeing our own git-repo
}
@ -112,27 +111,6 @@ setParaViewVersion()
#------------------------------------------------------------------------------
#
# Compare version information (specified vs what is found in CMakeLists.txt)
# Parse this type of content:
# set (PARAVIEW_VERSION_FULL "5.0.1")
#
checkVersion()
{
local ver=$(
sed -ne 's/^ *set *( *PARAVIEW_VERSION_FULL[ "]*\([.0-9]*\).*$/\1/ip' \
$ParaView_SOURCE_DIR/CMakeLists.txt
)
if [ "$ParaView_VERSION" != "$ver" ]
then
echo "(${ver:-none}) mismatch?"
else
echo "(${ver:-none})"
fi
}
#
# Set CMake cache variables
#
@ -375,17 +353,17 @@ configParaView()
local cmake=$(findCMake)
# Remove any existing build folder and recreate
if [ -d $ParaView_BINARY_DIR ]
if [ -d $ParaView_BUILD_DIR ]
then
echo "removing old build directory"
echo " $ParaView_BINARY_DIR"
rm -rf $ParaView_BINARY_DIR
echo " $ParaView_BUILD_DIR"
rm -rf $ParaView_BUILD_DIR
fi
mkdir -p $ParaView_BINARY_DIR
mkdir -p $ParaView_BUILD_DIR
addCMakeVariable "CMAKE_BUILD_TYPE=$BUILD_TYPE"
cd $ParaView_BINARY_DIR || exit 1 # Change to build folder
cd $ParaView_BUILD_DIR || exit 1 # Change to build folder
echo "----"
echo "Configuring paraview-$ParaView_VERSION (major version: $ParaView_MAJOR)"
@ -395,7 +373,7 @@ configParaView()
echo " GL2 rendering : ${withGL2:-false}"
echo " QT dev support : ${withQT:-true}"
echo " Source : $ParaView_SOURCE_DIR"
echo " Build : $ParaView_BINARY_DIR"
echo " Build : $ParaView_BUILD_DIR"
echo " Target : $ParaView_DIR"
echo " cmake : $cmake"
echo " Build suffix : ${BUILD_SUFFIX:-none}"
@ -423,7 +401,7 @@ configParaView()
#
makeParaView()
{
cd $ParaView_BINARY_DIR || exit 1 # Change to build folder
cd $ParaView_BUILD_DIR || exit 1 # Change to build folder
echo " Starting make"
time make -j $WM_NCOMPPROCS
echo " Done make"
@ -442,7 +420,7 @@ makeParaView()
#
installParaView()
{
cd $ParaView_BINARY_DIR || exit 1 # Change to build folder
cd $ParaView_BUILD_DIR || exit 1 # Change to build folder
echo " Installing ParaView to $ParaView_DIR"
make install
@ -468,7 +446,7 @@ INFO
# Non-system installation of QT?
if [ "$qmake" != /usr/bin/qmake -a -d "$qtLib" ]
then
cat<< INFO
/bin/cat<<INFO
And adjust your LD_LIBRARY_PATH to include the following:
$qtLib

View File

@ -30,6 +30,13 @@
#
#------------------------------------------------------------------------------
# Qt-related variables. Initialization at the end of the file.
qtTYPE=qt-everywhere-opensource-src
unset qtVERSION # No default version
#------------------------------------------------------------------------------
#
# Create a qt.conf file in the QT bin/
# - this can be modified easily if the qt installation is relocated

View File

@ -37,6 +37,30 @@ buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER
unset BUILD_SUFFIX
#------------------------------------------------------------------------------
# Force use of gcc/g++
useGcc()
{
export CC=gcc # Use gcc/g++
export CXX=g++
}
#------------------------------------------------------------------------------
# Some functions as per OpenFOAM etc/config.sh/functions
unset -f _foamAddLib _foamAddMan _foamAddPath # Get settings only
unset -f _foamEtc
# Source an etc file
_foamEtc()
{
local file
if [ $# -gt 0 ] && file=$($WM_PROJECT_DIR/bin/foamEtcFile "$@")
then
. $file
fi
}
#------------------------------------------------------------------------------
#

View File

@ -42,7 +42,7 @@ unset CMAKE_VARIABLES
# VTK_VERSION and VTK_MAJOR should already have been set
#
# VTK_SOURCE_DIR : location of the original sources
# VTK_BINARY_DIR : location of the build
# VTK_BUILD_DIR : location of the build
# VTK_DIR : location of the installed program
#
setVtkDirs()
@ -67,18 +67,17 @@ setVtkDirs()
exit 1
}
VTK_BINARY_DIR=$buildBASE/VTK-$VTK_VERSION$BUILD_SUFFIX
VTK_BUILD_DIR=$buildBASE/VTK-$VTK_VERSION$BUILD_SUFFIX
VTK_DIR=$installBASE/VTK-$VTK_VERSION$BUILD_SUFFIX
export VTK_SOURCE_DIR VTK_BINARY_DIR VTK_DIR
export VTK_SOURCE_DIR VTK_BUILD_DIR VTK_DIR
echo
echo "VTK_SOURCE_DIR=$VTK_SOURCE_DIR"
echo "VTK_BINARY_DIR=$VTK_BINARY_DIR"
echo "VTK_BUILD_DIR=$VTK_BUILD_DIR"
echo "VTK_DIR=$VTK_DIR"
# Prevent git queries from using the ThirdParty repository
export GIT_DIR=$VTK_SOURCE_DIR/.git
export GIT_DIR=$VTK_SOURCE_DIR/.git # Mask seeing our own git-repo
}
@ -123,23 +122,23 @@ configVTK()
local cmake=$(findCMake)
# Remove any existing build folder and recreate
if [ -d $VTK_BINARY_DIR ]
if [ -d $VTK_BUILD_DIR ]
then
echo "removing old build directory"
echo " $VTK_BINARY_DIR"
rm -rf $VTK_BINARY_DIR
echo " $VTK_BUILD_DIR"
rm -rf $VTK_BUILD_DIR
fi
mkdir -p $VTK_BINARY_DIR
mkdir -p $VTK_BUILD_DIR
addCMakeVariable "CMAKE_BUILD_TYPE=$BUILD_TYPE"
cd $VTK_BINARY_DIR || exit 1 # change to build folder
cd $VTK_BUILD_DIR || exit 1 # change to build folder
echo "----"
echo "Configuring VTK-$VTK_VERSION"
echo " MESA support : ${withMESA:-false}"
echo " Source : $VTK_SOURCE_DIR"
echo " Build : $VTK_BINARY_DIR"
echo " Build : $VTK_BUILD_DIR"
echo " Target : $VTK_DIR"
echo " cmake : $cmake"
echo " Build suffix : ${BUILD_SUFFIX:-none}"
@ -167,7 +166,7 @@ configVTK()
#
makeVTK()
{
cd $VTK_BINARY_DIR || exit 1 # Change to build folder
cd $VTK_BUILD_DIR || exit 1 # Change to build folder
echo " Starting make"
time make -j $WM_NCOMPPROCS
echo " Done make"
@ -183,7 +182,7 @@ makeVTK()
#
installVTK()
{
cd $VTK_BINARY_DIR || exit 1 # Change to build folder
cd $VTK_BUILD_DIR || exit 1 # Change to build folder
echo " Installing VTK to $VTK_DIR"
make install

View File

@ -32,19 +32,19 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# ADIOS version from OpenFOAM etc/config.sh file
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ADIOS)
# ADIOS version from OpenFOAM etc/config.sh file:
_foamEtc config.sh/ADIOS
adiosPACKAGE=${adios_version:-adios-none}
#------------------------------------------------------------------------------
usage() {
exec 1>&2
@ -64,7 +64,7 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# Export WM settings in a form that GNU configure recognizes
# Compiler settings for CMake/configure
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
@ -74,13 +74,10 @@ USAGE
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
CMAKE_PATH="${2%%/}"
@ -280,9 +277,9 @@ then
buildDIR=$buildBASE/$adiosPACKAGE
cd $ADIOS_SOURCE_DIR || exit 1
[ -e Makefile ] && make distclean 2>/dev/null
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
export GIT_DIR=$ADIOS_SOURCE_DIR/.git
[ -e Makefile ] && make distclean 2>/dev/null
applyPatch $adiosPACKAGE $ADIOS_SOURCE_DIR
@ -328,8 +325,7 @@ else
(
buildDIR=$buildBASE/$adiosPACKAGE
cd $ADIOS_SOURCE_DIR || exit 1
export GIT_DIR=$ADIOS_SOURCE_DIR/.git
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
applyPatch $adiosPACKAGE $ADIOS_SOURCE_DIR
@ -354,6 +350,7 @@ else
-DCMAKE_INSTALL_PREFIX=$ADIOS_ARCH_PATH \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_FORTRAN=FALSE \
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
$ADIOS_SOURCE_DIR \
&& make -j $WM_NCOMPPROCS all \
&& make install \

View File

@ -32,7 +32,7 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
@ -44,12 +44,13 @@ cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# libccmio version from OpenFOAM etc/config.sh file
. $WM_PROJECT_DIR/etc/config.sh/functions
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
# libccmio version from OpenFOAM etc/config.sh file:
_foamEtc config.sh/ccmio
ccmioPACKAGE=${ccmio_version:-libccmio-2.6.1}
targetType=lib
targetType=lib # Default is static linkage
#------------------------------------------------------------------------------
usage()
{
@ -59,6 +60,7 @@ usage()
Usage: ${0##*/} [OPTION] [lib|libso] [libccmio-VERSION]
options:
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-help
* Compile the proprietary libccmio library
@ -82,9 +84,10 @@ USAGE
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
lib|libso)
targetType="$1"
;;
@ -98,19 +101,20 @@ do
shift
done
# assert: directory must be available
[ -d "$ccmioPACKAGE" ] || die "missing source directory '$ccmioPACKAGE'"
#------------------------------------------------------------------------------
CCMIO_SOURCE_DIR=$sourceBASE/$ccmioPACKAGE
CCMIO_ARCH_PATH=$installBASE/$ccmioPACKAGE
#
# Build LIBCCMIO
#
echo "---------------"
CCMIO_SOURCE_DIR=$sourceBASE/$ccmioPACKAGE
CCMIO_ARCH_PATH=$installBASE/$ccmioPACKAGE
# Sources must be available
[ -d "$CCMIO_SOURCE_DIR" ] || die "Missing sources: '$ccmioPACKAGE'"
(
cd $CCMIO_SOURCE_DIR || exit 1
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
incDIR=$CCMIO_ARCH_PATH/include/libccmio
libDIR=$CCMIO_ARCH_PATH/lib
@ -118,16 +122,17 @@ echo "---------------"
mkdir -p $libDIR 2>/dev/null
cpMakeFiles libccmio 2>/dev/null
# Place static libraries in sub-directory:
if [ "$targetType" = lib ]
then
export FOAM_EXT_LIBBIN=$libDIR
fi
if wmake $targetType
then
# make headers available:
# Make headers available:
/bin/cp -pv libccmio/ccmio*.h $incDIR
# relocate static libraries to sub-directory:
if [ "$targetType" = lib ]
then
/bin/mv -v $FOAM_EXT_LIBBIN/libccmio.a $libDIR
fi
fi
)

View File

@ -65,26 +65,26 @@ then
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# CGAL, boost and gmp/mpfr versions from OpenFOAM etc/config.sh file
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only
unset BOOST_ARCH_PATH CGAL_ARCH_PATH # purge current values
# compiler first, let CGAL config override GMP (eg, when there is no GMP)
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler)
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL)
unset BOOST_ARCH_PATH CGAL_ARCH_PATH # Purge current values
# CGAL, boost and gmp/mpfr versions from OpenFOAM etc/config.sh files.
# Get compiler first and let CGAL config override GMP (eg, when there is no GMP)
_foamEtc config.sh/compiler
_foamEtc config.sh/CGAL
boostPACKAGE=${boost_version:-boost-system}
gmpPACKAGE=${gmp_version:-gmp-system}
mpfrPACKAGE=${mpfr_version:-mpfr-system}
cgalPACKAGE=$cgal_version
#------------------------------------------------------------------------------
usage() {
exec 1>&2
@ -116,7 +116,7 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# Ensure CMake gets the correct C/C++ compiler
# Compiler settings for CMake/configure
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
@ -126,16 +126,10 @@ unset optHeadersOnly
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'')
# discard empty arguments
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
CMAKE_PATH="${2%%/}"
@ -222,6 +216,7 @@ else
(
cd $BOOST_SOURCE_DIR || exit 1
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
rm -rf $BOOST_ARCH_PATH
@ -280,11 +275,11 @@ SUMMARY
# CGAL-4.9 normally builds into 'lib64', older versions into 'lib'.
#
# CGAL_SOURCE_DIR : location of the original sources
# CGAL_BINARY_DIR : location of the build
# CGAL_BUILD_DIR : location of the build
# CGAL_ARCH_PATH : installation directory
CGAL_SOURCE_DIR=$sourceBASE/$cgalPACKAGE
CGAL_BINARY_DIR=$buildBASE/$cgalPACKAGE
CGAL_BUILD_DIR=$buildBASE/$cgalPACKAGE
: ${CGAL_ARCH_PATH:=$installBASE/$cgalPACKAGE} # Fallback
# gmp/mpfr are installed without compiler name
@ -379,21 +374,22 @@ fi
(
# Remove any existing build folder and recreate
if [ -d $CGAL_BINARY_DIR ]
if [ -d $CGAL_BUILD_DIR ]
then
echo "removing old build directory"
echo " $CGAL_BINARY_DIR"
rm -rf $CGAL_BINARY_DIR
echo " $CGAL_BUILD_DIR"
rm -rf $CGAL_BUILD_DIR
fi
mkdir -p $CGAL_BINARY_DIR
mkdir -p $CGAL_BUILD_DIR
cd $CGAL_BINARY_DIR || exit 1
cd $CGAL_BUILD_DIR || exit 1
export GIT_DIR=$CGAL_SOURCE_DIR/.git # Mask seeing our own git-repo
unset configBoost configGmp configMpfr
echo "----"
echo "Configuring $cgalPACKAGE with boost $BOOST_VERSION"
echo " Source : $CGAL_SOURCE_DIR"
echo " Build : $CGAL_BINARY_DIR"
echo " Build : $CGAL_BUILD_DIR"
echo " Target : $CGAL_ARCH_PATH"
@ -479,6 +475,7 @@ CMAKE_OPTIONS
-DWITH_CGAL_Qt5=OFF \
${optHeadersOnly:+-DCGAL_HEADER_ONLY=TRUE} \
$configBoost $configGmp $configMpfr \
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
$CGAL_SOURCE_DIR \
&& set +x \
&& make -j $WM_NCOMPPROCS \

View File

@ -35,15 +35,17 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# Special purpose script - no default version.
unset cmakePACKAGE
#------------------------------------------------------------------------------
usage() {
exec 1>&2
@ -63,7 +65,7 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# Ensure CMake gets the correct C/CC++ compiler
# Compiler settings for CMake/configure
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
@ -72,13 +74,10 @@ unset optLink
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-link)
optLink=true
;;
@ -117,6 +116,7 @@ else
buildDIR=$buildBASE/$cmakePACKAGE
cd $CMAKE_SOURCE_DIR || exit 1
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
make distclean 2>/dev/null
rm -rf $buildDIR

View File

@ -47,20 +47,19 @@ then
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# FFTW version from OpenFOAM etc/config.sh file
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/FFTW)
# FFTW version from OpenFOAM etc/config.sh file:
_foamEtc config.sh/FFTW
fftwPACKAGE=${fftw_version:-fftw-system}
#------------------------------------------------------------------------------
usage() {
exec 1>&2
@ -79,7 +78,7 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# Ensure configure gets the correct C/C++ compiler
# Compiler settings for CMake/configure
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
@ -87,16 +86,10 @@ USAGE
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'')
# discard empty arguments
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
fftw-[0-9]* | fftw_[0-9]* | fftw-system )
fftwPACKAGE="${1%%/}"
;;
@ -146,6 +139,7 @@ else
buildDIR=$buildBASE/$fftwPACKAGE
cd $FFTW_SOURCE_DIR || exit 1
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
rm -rf $FFTW_ARCH_PATH
rm -rf $buildDIR

47
makeGcc
View File

@ -44,24 +44,25 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# Default GCC, mpfr, gmp and mpc versions from OpenFOAM etc/config.sh file
WM_COMPILER_TYPE=ThirdParty # ensure we get the correct compiler settings
: ${WM_COMPILER:=Gcc} # this will still fail if 'Clang' was set
. $WM_PROJECT_DIR/etc/config.sh/functions
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler)
[ "${WM_COMPILER#Gcc}" = "$WM_COMPILER" ] && WM_COMPILER=Gcc # Force gcc
WM_COMPILER_TYPE=ThirdParty # Ensure we get the correct settings
# Default GCC, mpfr, gmp and mpc versions from OpenFOAM etc/config.sh file:
_foamEtc config.sh/compiler
gmpPACKAGE=${gmp_version:-gmp-system}
mpfrPACKAGE=${mpfr_version:-mpfr-system}
mpcPACKAGE=${mpc_version:-mpc-system}
gccPACKAGE=$gcc_version
#------------------------------------------------------------------------------
usage() {
exec 1>&2
@ -94,9 +95,9 @@ unset optThreadSafe # unset=auto
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-multi*)
optMultilib=enable
;;
@ -163,6 +164,18 @@ GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE
MPC_ARCH_PATH=$installBASE/$mpcPACKAGE
# Prefix <dir> to LD_LIBRARY_PATH, if it exists. 0 on success, 1 on failure
addLib()
{
if [ -d "$1" ]
then
export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
return 0
else
return 1
fi
}
# ================
# Build GMP
@ -182,6 +195,7 @@ else
buildDIR=$buildBASE/$gmpPACKAGE
cd $sourceDIR || exit 1
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
make distclean 2>/dev/null
rm -rf $buildDIR
@ -203,10 +217,8 @@ else
}
fi
if [ -d "$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" ]
if addLib "$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
then
_foamAddLib "$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
configGMP=$(cat <<CONFIG_OPTIONS
--with-gmp-include=$GMP_ARCH_PATH/include
--with-gmp-lib=$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
@ -235,6 +247,7 @@ else
buildDIR=$buildBASE/$mpfrPACKAGE
cd $sourceDIR || exit 1
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
make distclean 2>/dev/null
rm -rf $buildDIR
@ -260,10 +273,8 @@ else
}
fi
if [ -d "$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" ]
if addLib "$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
then
_foamAddLib "$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
configMPFR=$(cat <<CONFIG_OPTIONS
--with-mpfr-include=$MPFR_ARCH_PATH/include \
--with-mpfr-lib=$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
@ -292,6 +303,7 @@ else
buildDIR=$buildBASE/$mpcPACKAGE
cd $sourceDIR || exit 1
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
make distclean 2>/dev/null
rm -rf $buildDIR
@ -313,10 +325,8 @@ else
}
fi
if [ -d "$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" ]
if addLib "$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
then
_foamAddLib "$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
configMPC=$(cat <<CONFIG_OPTIONS
--with-mpc-include=$MPC_ARCH_PATH/include \
--with-mpc-lib=$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
@ -349,6 +359,7 @@ else
buildDIR=$buildBASE/$gccPACKAGE
cd $sourceDIR || exit 1
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
make distclean 2>/dev/null
rm -rf $buildDIR

View File

@ -32,20 +32,19 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# Gperftools version from OpenFOAM etc/config.sh file
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/gperftools)
# Gperftools version from OpenFOAM etc/config.sh file:
_foamEtc config.sh/gperftools
gperftoolsPACKAGE=${gperftools_version:-gperftools-system}
#------------------------------------------------------------------------------
usage() {
exec 1>&2
@ -64,7 +63,7 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# Ensure configure gets the correct C/C++ compiler
# Compiler settings for CMake/configure
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
@ -72,13 +71,10 @@ USAGE
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
gperftools-[0-9]* | gperftools-svn* | gperftools-git)
gperftoolsPACKAGE="${1%%/}"
;;
@ -119,8 +115,8 @@ else
buildDIR=$buildBASE/$gperftoolsPACKAGE
cd $GPERFTOOLS_SOURCE_DIR || exit 1
make distclean 2>/dev/null
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
[ -e Makefile ] && make distclean 2>/dev/null
rm -rf $GPERFTOOLS_ARCH_PATH
rm -rf $buildDIR

View File

@ -46,21 +46,22 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# LLVM/Clang version from OpenFOAM etc/config.sh file
WM_COMPILER_TYPE=ThirdParty # ensure we get the correct compiler settings
WM_COMPILER=Clang # force values for 'clang'
. $WM_PROJECT_DIR/etc/config.sh/functions
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler)
[ "${WM_COMPILER#Clang}" = "$WM_COMPILER" ] && WM_COMPILER=Clang # Force clang
WM_COMPILER_TYPE=ThirdParty # Ensure we get the correct settings
# LLVM/Clang version from OpenFOAM etc/config.sh file:
_foamEtc config.sh/compiler
llvmPACKAGE=$clang_version
#------------------------------------------------------------------------------
usage() {
exec 1>&2
@ -80,7 +81,7 @@ USAGE
exit 1
}
#-----------------------------------------------------------------------------
# Ensure CMake gets the correct C/C++ compiler
# Compiler settings for CMake/configure
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
@ -88,13 +89,10 @@ USAGE
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
CMAKE_PATH="${2%%/}"
@ -119,12 +117,12 @@ installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
# Build LLVM (clang)
# LLVM_SOURCE_DIR : location of the original sources
# LLVM_BINARY_DIR : location of the build
# LLVM_BUILD_DIR : location of the build
# LLVM_ARCH_PATH : location of the installed program
# - Strip any trailing '.src' from the proper names
LLVM_SOURCE_DIR=$sourceBASE/$llvmPACKAGE
LLVM_BINARY_DIR=$buildBASE/${llvmPACKAGE%%.src}
LLVM_BUILD_DIR=$buildBASE/${llvmPACKAGE%%.src}
LLVM_ARCH_PATH=$installBASE/${llvmPACKAGE%%.src}
#
@ -143,11 +141,12 @@ then
echo
(
cd $LLVM_SOURCE_DIR || exit 1
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
make distclean 2>/dev/null
rm -rf $LLVM_BINARY_DIR
mkdir -p $LLVM_BINARY_DIR
cd $LLVM_BINARY_DIR
rm -rf $LLVM_BUILD_DIR
mkdir -p $LLVM_BUILD_DIR
cd $LLVM_BUILD_DIR
set -x
$LLVM_SOURCE_DIR/configure \
@ -171,10 +170,11 @@ else
echo
(
cd $LLVM_SOURCE_DIR || exit 1
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
rm -rf $LLVM_BINARY_DIR
mkdir -p $LLVM_BINARY_DIR
cd $LLVM_BINARY_DIR
rm -rf $LLVM_BUILD_DIR
mkdir -p $LLVM_BUILD_DIR
cd $LLVM_BUILD_DIR
cmake=$(findCMake)

View File

@ -51,27 +51,33 @@ then
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
# Transition
# ~~~~~~~~~~
_foamAddLib() { true; }
_foamAddMan() { true; }
_foamAddPath() { true; }
#------------------------------------------------------------------------------
# get mpich version
WM_MPLIB=MPICH # ensure we get the third-party settings
. $WM_PROJECT_DIR/etc/config.sh/functions
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/mpi)
WM_MPLIB=MPICH # Ensure we get the correct MPI
# mpich version from OpenFOAM etc/config.sh file:
_foamEtc config.sh/mpi
mpiPACKAGE=${FOAM_MPI:-mpich-system}
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [openmpi-VERSION]
usage: ${0##*/} [OPTION] [mpich-VERSION]
options:
-gcc force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-help
@ -83,7 +89,7 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# Ensure configure gets the correct C/C++ compiler
# Compiler settings for CMake/configure
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
@ -91,16 +97,10 @@ USAGE
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'')
# discard empty arguments
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
mpich*)
mpiPACKAGE="${1%%/}"
;;
@ -126,7 +126,7 @@ fi
#------------------------------------------------------------------------------
#
# Build openmpi
# Build mpich
#
# MPI_SOURCE_DIR : location of the original sources
# MPI_ARCH_PATH : installation directory
@ -151,6 +151,7 @@ else
# ----------------------------
cd $MPI_SOURCE_DIR || exit 1
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
[ -e Makefile ] && make distclean 2>/dev/null
rm -rf $MPI_ARCH_PATH

View File

@ -38,20 +38,21 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# MESA version from OpenFOAM etc/config.sh file
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib # get settings only
unset vtk_version mesa_version # purge current values
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/vtk)
unset vtk_version mesa_version # Purge current values
# mesa version from OpenFOAM etc/config.sh file:
_foamEtc config.sh/vtk
mesaPACKAGE=$mesa_version
#------------------------------------------------------------------------------
usage() {
exec 1>&2
@ -70,27 +71,28 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# Ensure configure gets the correct C/C++ compiler
# Compiler settings for CMake/configure
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
# Non-standard location for clang?
unset thirdPartyClang
if [ "$WM_COMPILER_TYPE" = ThirdParty -a "$WM_COMPILER" = Clang ]
then
case "$WM_COMPILER_TYPE-$WM_COMPILER" in
ThirdParty-Clang*)
thirdPartyClang=true
fi
;;
*)
unset thirdPartyClang
;;
esac
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
useGcc
unset thirdPartyClang
;;
mesa-*)
@ -171,6 +173,7 @@ adjustMESA()
buildDIR=$buildBASE/$mesaPACKAGE
cd $MESA_SOURCE_DIR || exit 1
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
# remove any existing build
rm -rf $MESA_ARCH_PATH

View File

@ -51,20 +51,26 @@ then
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
# Transition
# ~~~~~~~~~~
_foamAddLib() { true; }
_foamAddMan() { true; }
_foamAddPath() { true; }
#------------------------------------------------------------------------------
# get openmpi version
WM_MPLIB=OPENMPI # ensure we get the third-party settings
. $WM_PROJECT_DIR/etc/config.sh/functions
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/mpi)
WM_MPLIB=OPENMPI # Ensure we get the correct MPI
# openmpi version from OpenFOAM etc/config.sh file:
_foamEtc config.sh/mpi
mpiPACKAGE=${FOAM_MPI:-openmpi-system}
#------------------------------------------------------------------------------
usage() {
exec 1>&2
@ -83,7 +89,7 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# Ensure configure gets the correct C/C++ compiler
# Compiler settings for CMake/configure
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
@ -91,16 +97,10 @@ USAGE
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'')
# discard empty arguments
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
openmpi-[0-9]* | openmpi_[0-9]* | openmpi-system )
mpiPACKAGE="${1%%/}"
;;
@ -163,6 +163,7 @@ else
buildDIR=$buildBASE/$mpiPACKAGE
cd $MPI_SOURCE_DIR || exit 1
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
[ -e Makefile ] && make distclean 2>/dev/null
rm -rf $MPI_ARCH_PATH
@ -173,9 +174,9 @@ else
set -x
$MPI_SOURCE_DIR/configure \
--prefix=$MPI_ARCH_PATH \
--libdir=$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--disable-orterun-prefix-by-default \
--enable-shared --disable-static \
--libdir=$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--enable-mpi-fortran=none \
--disable-mpi-profile \
$configOpt \

View File

@ -33,11 +33,11 @@
#
# Note the capitalization of ParaView in the directory names.
#
# ------------------------------------------------
# SOME USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
@ -45,41 +45,24 @@ cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
. etc/tools/ThirdPartyFunctions
. etc/tools/ParaViewFunctions
#------------------------------------------------------------------------------
# ParaView_VERSION from OpenFOAM etc/config.sh file
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib # get settings only
unset ParaView_VERSION # purge current values
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/paraview)
: ${ParaView_VERSION##*-}
#------------------------------------------------------------------------------
#
# USER DEFAULTS:
# ~~~~~~~~~~~~~~
unset ParaView_VERSION # Purge current values
# MESA graphics support:
withMESA=false
MESA_INCLUDE="/usr/include/GL"
MESA_LIBRARY="/usr/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so"
# ParaView_VERSION from etc/config.sh file:
_foamEtc config.sh/paraview
# Python support:
# - The script will try to determine the appropriate python library.
# If that fails, specify the path using the PYTHON_LIBRARY variable below.
withPYTHON=false
PYTHON_LIBRARY=""
# PYTHON_LIBRARY="/usr/lib$WM_COMPILER_LIB_ARCH/libpython2.7.so.1.0"
ParaView_VERSION="${ParaView_VERSION##*-}" # Without prefix
# Set initial ParaView_MAJOR based on current value of ParaView_VERSION
setParaViewVersion ${ParaView_VERSION:-none}
# New rendering backend (starting with paraview 5.0).
# Default to auto-config based on paraview version
withGL2=auto
withGL2=auto # auto-config based on version
#
# NO FURTHER EDITING BELOW THIS LINE
#
#-----------------------------------------------------------------------------
#------------------------------------------------------------------------------
usage() {
: ${ParaView_VERSION:=none} # some dummy value for usage information
exec 1>&2
: ${ParaView_VERSION:=none} # some dummy value for usage information
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
@ -87,22 +70,22 @@ usage: ${0##*/} [OPTION] [paraview-VERSION] [CMAKE-OPTION]
options:
-gcc force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-rebuild for repeated builds (-make -install) *use with caution*
-gl2 with new rendering backend (if not already enabled)
-mesa with mesa (if not already enabled)
-gl2 with new rendering backend (default: auto)
-mesa with mesa
-mesa-prefix DIR location of mesa installation (sets -mesa-include, -mesa-lib)
-mesa-include DIR location of mesa headers (current value: ${MESA_INCLUDE:-none})
-mesa-lib PATH path to mesa library (current value: ${MESA_LIBRARY:-none})
-mpi with mpi (if not already enabled)
-mesa-include DIR location of mesa headers (current: ${MESA_INCLUDE:-none})
-mesa-lib PATH path to mesa library (current: ${MESA_LIBRARY:-none})
-mpi with mpi
-mpi=N with max 'N' mpi processes. N=0 for no upper-limit.
-python with python (if not already enabled)
-python-lib PATH path to python library (current value: ${PYTHON_LIBRARY:-none})
-python with python
-python-lib PATH path to python library (current: ${PYTHON_LIBRARY:-none})
-cmake PATH with cmake from the 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
-verbose verbose output in Makefiles
-version VER specify an alternative version (current value: $ParaView_VERSION)
-version VER specify an alternative version (current: $ParaView_VERSION)
-major VER specify an alternative major version for special builds
-buildType NAME specify the build type (default: Release)
-suffix NAME specify a suffix to distinguish the build
@ -138,16 +121,11 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# Ensure CMake gets the correct C/C++ compiler
# Compiler settings for CMake/configure
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
# Set initial ParaView_MAJOR based on current value of ParaView_VERSION
setParaViewVersion ${ParaView_VERSION:-none}
#
# Various building stages
#
unset runPATCH runCONFIG runMAKE runINSTALL
runDEFAULT=true
@ -155,19 +133,16 @@ runDEFAULT=true
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
[0-9]* | paraview-[0-9]* | ParaView-[0-9]*) # paraview version
setParaViewVersion "${1%%/}"
;;
[A-Z]*=*) # cmake variables
addCMakeVariable "$1"
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
-patch) # stage 0: patch sources
runPATCH=true
unset runDEFAULT
@ -258,6 +233,7 @@ do
;;
-python-lib)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
withPYTHON=true
PYTHON_LIBRARY="${2%%/}"
shift
;;
@ -278,6 +254,7 @@ do
withQT=false
;;
-qt-[1-9]*)
withQT=true
QMAKE_PATH="$installBASE/${1##-}"
;;
-verbose)
@ -379,10 +356,10 @@ Features selected
qt ${withQT:-false}
---------------------
Version information
qt ${QT_VERSION:-none}
version ${ParaView_VERSION:-unknown} $(checkVersion)
paraview ${ParaView_VERSION:-unknown}
major ${ParaView_MAJOR:-unknown}
build ${BUILD_TYPE:-unknown}
qt ${QT_VERSION:-none}
---------------------
SUMMARY

19
makeQt
View File

@ -32,7 +32,7 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
@ -40,9 +40,6 @@ cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
. etc/tools/ThirdPartyFunctions
. etc/tools/QtFunctions
#------------------------------------------------------------------------------
qtTYPE=qt-everywhere-opensource-src
unset qtVERSION # No default version
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
@ -59,7 +56,7 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# Export WM settings in a form that GNU configure recognizes
# Compiler/linker settings for CMake/configure
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
@ -69,13 +66,10 @@ USAGE
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-qt-[1-9]* | [1-9]* | qt-*)
# -qt-VERSION, VERSION, qt-VERSION, qt-everywhere-opensource-src-VERSION
qtVERSION="${1%%/}";
@ -145,6 +139,7 @@ else
buildDIR=$buildBASE/$qtPACKAGE
cd $QT_SOURCE_DIR || exit 1
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
[ -e Makefile ] && make distclean 2>/dev/null
# Remove any existing build folder and recreate

View File

@ -32,7 +32,7 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
@ -44,15 +44,14 @@ cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# Boost version (headers only) from OpenFOAM etc/config.sh file
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL)
# Boost version (headers only) from OpenFOAM etc/config.sh file:
_foamEtc config.sh/CGAL
boostPACKAGE=${boost_version:-boost-system}
tecioPACKAGE=tecio
targetType=lib
#------------------------------------------------------------------------------
usage()
{
@ -66,7 +65,6 @@ options:
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-help
* Compile the proprietary libtecio library
$tecioPACKAGE
with $boostPACKAGE
@ -75,7 +73,7 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# Ensure CMake gets the correct C/C++ compiler
# Compiler settings for CMake/configure
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
@ -83,13 +81,10 @@ USAGE
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
CMAKE_PATH="${2%%/}"
@ -108,15 +103,23 @@ do
shift
done
# assert: directory must be available
[ -d "$tecioPACKAGE" ] || die "missing source directory '$tecioPACKAGE'"
#------------------------------------------------------------------------------
# Build TECIO library
#
# TECIO_SOURCE_DIR : location of the original sources
# TECIO_BUILD_DIR : location of the build
# TECIO_ARCH_PATH : location of the installed program
TECIO_SOURCE_DIR=$sourceBASE/$tecioPACKAGE/teciosrc
TECIO_BUILD_DIR=$buildBASE/$tecioPACKAGE
TECIO_ARCH_PATH=$installBASE/$tecioPACKAGE
# Sources must be available
[ -d "$TECIO_SOURCE_DIR" ] || die "Missing sources '$tecioPACKAGE'"
# Get Boost information
# - only headers are required
: ${BOOST_ARCH_PATH:=$installBASE/$boostPACKAGE} # Fallback
boostInc="$BOOST_ARCH_PATH/include"
@ -135,27 +138,17 @@ then
fi
# Build TECIO library
#
# TECIO_SOURCE_DIR : location of the original sources
# TECIO_BINARY_DIR : location of the build
# TECIO_ARCH_PATH : location of the installed program
TECIO_SOURCE_DIR=$sourceBASE/$tecioPACKAGE/teciosrc
TECIO_BINARY_DIR=$buildBASE/$tecioPACKAGE
TECIO_ARCH_PATH=$installBASE/$tecioPACKAGE
if [ -d "$TECIO_SOURCE_DIR" ]
then
(
# Remove any existing build folder and recreate
if [ -d $TECIO_BINARY_DIR ]
if [ -d $TECIO_BUILD_DIR ]
then
echo "removing old build directory"
echo " $TECIO_BINARY_DIR"
rm -rf $TECIO_BINARY_DIR
echo " $TECIO_BUILD_DIR"
rm -rf $TECIO_BUILD_DIR
fi
mkdir -p $TECIO_BINARY_DIR
mkdir -p $TECIO_BUILD_DIR
rm -rf $TECIO_ARCH_PATH
@ -163,7 +156,7 @@ then
echo "----"
echo "Configuring $tecioPACKAGE with boost $BOOST_VERSION"
echo " Source : $TECIO_SOURCE_DIR"
echo " Build : $TECIO_BINARY_DIR"
echo " Build : $TECIO_BUILD_DIR"
echo " Target : $TECIO_ARCH_PATH"
if [ -d "$BOOST_ARCH_PATH" ]
@ -177,9 +170,9 @@ then
echo "----"
set -x
cd $TECIO_BINARY_DIR && $cmake \
cd $TECIO_BUILD_DIR && $cmake \
-DCMAKE_INSTALL_PREFIX=$TECIO_ARCH_PATH \
-DCMAKE_BINARY_TYPE=Release \
-DCMAKE_BUILD_TYPE=Release \
-DBoost_INCLUDE_DIR=$boostInc \
$TECIO_SOURCE_DIR \
&& make -j $WM_NCOMPPROCS \
@ -189,7 +182,7 @@ then
mkdir -p $TECIO_ARCH_PATH 2>/dev/null
/bin/cp -pv \
$TECIO_BINARY_DIR/libtecio.a \
$TECIO_BUILD_DIR/libtecio.a \
$TECIO_SOURCE_DIR/TECIO.h \
$TECIO_SOURCE_DIR/tecio_Exports.h \
$TECIO_ARCH_PATH

62
makeVTK
View File

@ -33,13 +33,13 @@
# To use the VTK source from the ParaView source tree, simply make an
# appropriate link first. For example,
#
# (cd $WM_THIRD_PARTY_DIR && ln -s ParaView-v5.2.0/VTK VTK-7.1.0)
# ln -s ParaView-v5.3.0/VTK VTK-7.1.0
#
# ------------------------------------------------
# SOME USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
@ -48,31 +48,18 @@ cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
. etc/tools/ParaViewFunctions
. etc/tools/vtkFunctions
#------------------------------------------------------------------------------
# VTK version from OpenFOAM etc/config.sh file
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib # get settings only
unset vtk_version mesa_version # purge current values
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/vtk)
unset vtk_version mesa_version # Purge current values
# vtk version from OpenFOAM etc/config.sh file:
_foamEtc config.sh/vtk
VTK_VERSION=$vtk_version
#------------------------------------------------------------------------------
#
# USER DEFAULTS:
# ~~~~~~~~~~~~~~
# MESA graphics support:
withMESA=false
MESA_INCLUDE="/usr/include/GL"
MESA_LIBRARY="/usr/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so"
# New rendering backend (starting with vtk 7?).
# Default to auto-config based on VTK version
withGL2=auto
withGL2=auto # auto-config based on version
#
# NO FURTHER EDITING BELOW THIS LINE
#
#-----------------------------------------------------------------------------
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
@ -82,17 +69,17 @@ usage: ${0##*/} [OPTION] [vtk-VERSION] [CMAKE-OPTION]
options:
-gcc force g++ instead of the value from \$WM_CXX
-rebuild for repeated builds (-make -install) *use with caution*
-gl2 with new rendering backend (if not already enabled)
-gl2 with new rendering backend (default: auto)
-mesa with mesa (if not already enabled)
-mesa-prefix DIR location of mesa installation
-mesa-include DIR location of mesa headers (current value: ${MESA_INCLUDE:-none})
-mesa-lib PATH path to mesa library (current value: ${MESA_LIBRARY:-none})
-mesa-include DIR location of mesa headers (current: ${MESA_INCLUDE:-none})
-mesa-lib PATH path to mesa library (current: ${MESA_LIBRARY:-none})
-osmesa with off-screen mesa only
-mpi with mpi (if not already enabled)
-mpi with mpi
-mpi=N with max 'N' mpi processes. N=0 for no upper-limit.
-cmake PATH with cmake from the path given
-verbose verbose output in Makefiles
-version VER specify an alternative version (current value: $VTK_VERSION)
-version VER specify an alternative version (current: $VTK_VERSION)
-buildType NAME specify the build type (default: Release)
-suffix NAME specify a suffix to distinguish the build
-help
@ -120,13 +107,11 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# Ensure CMake gets the correct C/C++ compiler
# Compiler settings for CMake/configure
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
#
# Various building stages
#
unset runPATCH runCONFIG runMAKE runINSTALL
runDEFAULT=true
@ -134,19 +119,16 @@ runDEFAULT=true
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
[0-9]* | vtk-[0-9]* | VTK-[0-9]*) # VTK version
setVtkVersion "${1%%/}"
;;
[A-Z]*=*) # cmake variables
addCMakeVariable "$1"
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
-patch) # stage 0: patch sources
runPATCH=true
unset runDEFAULT
@ -316,7 +298,7 @@ Features selected
mpi ${withMPI:-false}
---------------------
Version information
version ${VTK_VERSION:-unknown}
vtk ${VTK_VERSION:-unknown}
build ${BUILD_TYPE:-unknown}
---------------------
SUMMARY

View File

@ -32,7 +32,7 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
@ -82,7 +82,7 @@ do
min=$(sed -n \
-e 's/^.*cmake_minimum.*VERSION *\([0-9.][0-9.]*\).*/\1/p' \
"$dir/CMakeLists.txt" \
2>/dev/null)
2>/dev/null | head -1)
if [ -n "$min" ]
then