Commit 59be96fa authored by mark's avatar mark
Browse files

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
parent 5d592841
......@@ -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
......
......@@ -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 # for safety
make realclean 2>/dev/null # Extra safety
make -j $WM_NCOMPPROCS $configEnv scotch \
&& make $configOpt install
make -j $WM_NCOMPPROCS scotch \
&& make \
prefix=$prefixDIR \
includedir=$incDIR \
libdir=$libDIR \
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
......
......@@ -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
......
......@@ -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"
;;
......
......@@ -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"
;;
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
}
#------------------------------------------------------------------------------
#
......
......@@ -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"