Files
ThirdParty-common/Allwmake
mark 376a2b66f4 GIT: Merge in foundation/master with cleanup (2016-06-14)
The ThirdParty repository from the Foundation now includes some
3rd-party source code (paraview, scotch) as well.

To avoid this bloat (ca. 50MB), now and in the future, it is
unfortunately necessary to break the linear history and the direct
connection with the Foundation repository.

This commit is a squashed merge of the current Foundation master branch
with some minor adjustments.

Stop tracking of the derived README.html file.

===========================================================================
Changes prior to merge:

commit 3cb21d12be069561fbe13461440cbdf1c8b188d5
Author: mark <mark@opencfd>
Date:   Tue Jun 14 17:18:40 2016 +0200

    GIT: rationalize .gitignore

    - do not track derived content.
    - do track wmake files etc. (re-instates some content)

commit d1bf108bea922bf60a1002c4641770b91f09f226
Author: Henry Weller <http://cfd.direct>
Date:   Sat Nov 7 21:44:27 2015 +0000

    Reinstated Qt build scripts
    Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1905

commit 7302adf5d0a7bafe635c5d0470f00a6fe78a57f6
Author: mark <mark@opencfd>
Date:   Tue Jun 14 17:15:27 2016 +0200

    Revert "scotch_6.0.3: Added to the source tree to simplify building OpenFOAM"

    This reverts commit 1cce60aa78540bf96783684523e1cac4b6a78043.

commit fbe0018d5fd4d5f94f00f8e7efd3ae11b6ab41b5
Author: mark <mark@opencfd>
Date:   Tue Jun 14 17:15:03 2016 +0200

    Revert "ParaView-5.0.1: Added the source-tree to ThirdParty-dev and patched as described in the README file"

    This reverts commit eba760a6d6bb44860fc7d94d922be7215ee93c1f.

===========================================================================
All changes since NOV-2015 are included in the merge:

commit 17cafd35812493f9a39e56c7355f49c1d3eef2d0
Author: Henry Weller <http://cfd.direct>
Date:   Thu Jun 9 14:36:59 2016 +0100

    makeGcc, makeCGAL: lib -> lib64 on 64bit OSs
    Patch contributed by Bruno Santos
    Resolves patch request http://bugs.openfoam.org/view.php?id=2114

commit ce4951579b8e01ce524ed6e465ea352e6a243f1b
Author: Henry Weller <http://cfd.direct>
Date:   Wed Jun 8 15:14:47 2016 +0100

    ThirdParty-dev/makeGcc: added "-no-multilib" option
    Patch contributed by Bruno Santos
    Resolves patch request http://bugs.openfoam.org/view.php?id=2113

commit f72ad1f0a66338e5c342efed47079347e1db16d0
Author: Henry Weller <http://cfd.direct>
Date:   Tue May 31 09:16:57 2016 +0100

    README: Updated download instructions

commit eba760a6d6bb44860fc7d94d922be7215ee93c1f
Author: Henry Weller <http://cfd.direct>
Date:   Mon May 30 21:20:56 2016 +0100

    ParaView-5.0.1: Added the source-tree to ThirdParty-dev and patched as described in the README file
    Resolves bug-report http://bugs.openfoam.org/view.php?id=2098

commit 1cce60aa78540bf96783684523e1cac4b6a78043
Author: Henry Weller <http://cfd.direct>
Date:   Mon May 30 21:17:14 2016 +0100

    scotch_6.0.3: Added to the source tree to simplify building OpenFOAM
    Recent versions of scotch are rarely available in packaged form for
    ready installation on GNU/Linux distributions and so the sources are
    generally required.

commit 08df75f4c7339520880fcf9dd243e9c414cbfe7e
Author: Henry Weller <http://cfd.direct>
Date:   Mon May 30 21:16:54 2016 +0100

    .gitignore: Simplified

commit ef2d69ba55076ba14ab0c771ac2981b94ab60f2e
Author: Henry Weller <http://cfd.direct>
Date:   Mon May 30 21:16:27 2016 +0100

    README: Updated instructions for compiling ParaView-5.0.1

commit 7cdc8b196acfa021c4ff23036714aaee5e1b9612
Author: Henry Weller <http://cfd.direct>
Date:   Mon May 30 12:30:17 2016 +0100

    README: Upgraded to CGAL-4.8

commit bc8ce83166a05db0dc197a7a203634aa6d25c96f
Author: Henry Weller <http://cfd.direct>
Date:   Mon May 30 12:28:27 2016 +0100

    makeCGAL: Updated to CGAL-4.8

commit c0afdcde7920538ceaf9e0c78827e3a3f18f541d
Author: Henry Weller <http://cfd.direct>
Date:   Mon May 23 18:46:27 2016 +0100

    etc/tools/ParaViewFunctions: Improve instructions for updating the environment after compiling ParaView

commit b627924a4bf104521b567d3aa3dc80c864325b1a
Author: Henry Weller <http://cfd.direct>
Date:   Tue May 10 11:38:00 2016 +0100

    Allwmake: Added scripted changes for REALTYPEWIDTH and IDXTYPEWIDTH
    Patch contributed by Bruno Santos
    Resolves bug-report http://bugs.openfoam.org/view.php?id=2085

commit 69dba76b3195420c71173a65b1c227b2650eaebf
Author: Henry Weller <http://cfd.direct>
Date:   Sun Apr 3 14:43:58 2016 +0100

    Further changes for http://www.openfoam.org/mantisbt/view.php?id=2040
    Patch provided by Bruno Santos

commit 1379e08a39ef9e199307e9b6608e7ad97ed03b77
Author: Henry Weller <http://cfd.direct>
Date:   Sun Apr 3 10:30:43 2016 +0100

    Allwmake: Implement the default "stop on 1st error"
    Patch contributed by Bruno Santos
    Resolves tweak http://www.openfoam.org/mantisbt/view.php?id=2040

commit 8c9c235db686de2612c62112b37e132bfa773b16
Author: Henry Weller <http://cfd.direct>
Date:   Wed Mar 30 19:28:28 2016 +0100

    Updated handling of the ParaView installation path
    Patch contributed by Bruno Santos
    Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2034

commit d88b4ea88db7d35c7b7fe8d869d59be32a224144
Author: Henry Weller <http://cfd.direct>
Date:   Mon Mar 21 23:03:59 2016 +0000

    makeCGAL: Corrected typo
    Patch contributed by Bruno Santos
    Resolves report http://www.openfoam.org/mantisbt/view.php?id=1215

commit 578f8827fbc5f709595fc5ab5185053aaa8cf678
Author: Henry Weller <http://cfd.direct>
Date:   Mon Mar 14 11:13:23 2016 +0000

    Make scripts updated to use the new OpenFOAM-dev/ets/config.sh variables
    Contributed by Bruno Santos
    Resolves patch request http://www.openfoam.org/mantisbt/view.php?id=1215
    See also http://www.openfoam.org/mantisbt/view.php?id=1232

commit c8904e60d2c97ee3c4865bb34419758a10cb2a5a
Author: Henry Weller <http://cfd.direct>
Date:   Tue Feb 16 08:57:29 2016 +0000

    scripts: Reformat with consistent section separators

commit 43f2b369458ff87d0c85c493586d12b75855cf32
Author: Henry Weller <http://cfd.direct>
Date:   Tue Feb 16 08:56:26 2016 +0000

    ThirdParty-dev/etc/tools/ParaViewFunctions: Updated docs
    Including patch from Bruno Santos
    Resolves report http://www.openfoam.org/mantisbt/view.php?id=1997

commit dfe9e823de452f4c540aa4d02dcf5058e063dd44
Author: Henry Weller <http://cfd.direct>
Date:   Wed Feb 10 20:44:32 2016 +0000

    README.org: Upgrade OpenMPI link to openmpi-1.10.2

commit 99d158539e21a3a86d9ac9d5d6f67834142a1847
Author: Henry Weller <http://cfd.direct>
Date:   Wed Feb 10 20:21:34 2016 +0000

    Rename makeParaView4 makeParaView and update to support versions 4 and 5
    Rename makeParaView makeParaView3 specifically for ParaView version 3

commit 8219a109a24d0699f689cf29a6ce6b4190dc84f0
Author: Henry Weller <http://cfd.direct>
Date:   Wed Feb 10 16:21:23 2016 +0000

    Updates for changes to etc/config structure

commit c6474e672655864b784950b3bc12e245745ea64d
Author: Henry Weller <http://cfd.direct>
Date:   Sun Feb 7 10:30:22 2016 +0000

    README: Added download link for ParaView-5.0.0

commit 2da4d8ccea67b4d194161f03c2aca8f693789121
Author: Henry Weller <http://cfd.direct>
Date:   Sun Feb 7 10:27:46 2016 +0000

    README: Updated for ParaView-5.0.0

commit 730b8840f7a47e4807c5c239caf337b49960fc9b
Author: Henry Weller <http://cfd.direct>
Date:   Sun Feb 7 10:26:15 2016 +0000

    makeGcc: Removed support for gcc versions older the 4.5

commit 2500c120b9cd29b5b46d4ca118a60dfac78a8923
Author: Henry Weller <http://cfd.direct>
Date:   Mon Nov 2 20:00:59 2015 +0000

    README.org: Added patch instructions for ParaView-4.4.0 from
    http://www.openfoam.org/mantisbt/view.php?id=1887

===========================================================================
2016-06-14 18:24:31 +02:00

387 lines
11 KiB
Bash
Executable File

#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# 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
[ -e Makefile ] && 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} \
--enable-mpi-fortran=none \
--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
[ -e Makefile ] && 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-mpedbg \
--disable-devdebug \
--disable-debug \
--enable-sharedlib=$MPI_ARCH_PATH/lib \
--with-device=ch_p4 \
;
# For MPICH2 below 1.5a1 uncomment this line and comment next
# make && make install
# For MPICH2 1.5a1 or above
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.sh/scotch`
then
. $settings
else
echo
echo "Error: no config.sh/scotch 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.sh/metis`
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
if [ "$WM_PRECISION_OPTION" = "DP" ]
then
FLOAT_PRECISION=64
elif [ "$WM_PRECISION_OPTION" = "SP" ]
then
FLOAT_PRECISION=32
else
echo " Metis pre-configure error:"
echo " WM_PRECISION_OPTION is neither DP nor SP"
exit 1
fi
# Change user settings automatically
sed -i -e 's=\(#define IDXTYPEWIDTH\).*=\1 '$WM_LABEL_SIZE'=' \
-e 's=\(#define REALTYPEWIDTH\).*=\1 '$FLOAT_PRECISION'=' \
include/metis.h
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
#------------------------------------------------------------------------------