Files
openfoam/bin/tools/AllwmakeThirdParty
Mark Olesen b1a3bcc9a9 take control of Allwmake scripts for third-party sources
- this improves the chances of having a current version
2009-07-24 11:01:29 +02:00

195 lines
5.0 KiB
Bash
Executable File

#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
# \\/ 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 2 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, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# AllwmakeThirdParty
#
# Description
# Build script for ThirdParty sources
#
#------------------------------------------------------------------------------
[ -d "$WM_THIRD_PARTY_DIR" ] || {
echo "no \$WM_THIRD_PARTY_DIR=$WM_THIRD_PARTY_DIR"
exit 1
}
cd $WM_THIRD_PARTY_DIR || exit 1 # run from third-party directory
set -x
# 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"
wmake libso zlib-1.2.3
( cd malloc && ./Allwmake )
#
# compile specific mpi libraries
#
case "$WM_MPLIB" in
OPENMPI)
if [ -r $MPI_ARCH_PATH/lib/libmpi.so ]
then
echo "have $WM_MPLIB shared library"
elif [ -r $MPI_ARCH_PATH/lib/libmpi.a ]
then
echo "have $WM_MPLIB static library"
else
(
cd $MPI_HOME || exit
make distclean
rm -rf $MPI_ARCH_PATH
unset mpiWith
# as of version 1.3, enable GridEngine
if [ -n "$SGE_ROOT" ]
then
mpiWith="$mpiWith --with-sge"
fi
# Infiniband support
# if [ -d /usr/local/ofed -a -d /usr/local/ofed/lib64 ]
# then
# mpiWith="$mpiWith --with-openib=/usr/local/ofed"
# mpiWith="$mpiWith --with-openib-libdir=/usr/local/ofed/lib64"
# fi
./configure \
--prefix=$MPI_ARCH_PATH \
--disable-mpirun-prefix-by-default \
--disable-orterun-prefix-by-default \
--enable-shared --disable-static \
--disable-mpi-f77 --disable-mpi-f90 --disable-mpi-cxx \
--disable-mpi-profile \
$mpiWith \
;
make
make install
make distclean
)
fi
;;
MPICH)
if [ -r $MPI_ARCH_PATH/lib/libmpich.so ]
then
echo "have $WM_MPLIB shared library"
elif [ -r $MPI_ARCH_PATH/lib/libmpich.a ]
then
echo "have $WM_MPLIB static library"
else
(
cd $MPI_HOME || exit
make distclean
rm -rf $MPI_ARCH_PATH
rm util/machines/machines.*
./configure \
--without-mpe \
--disable-f77 \
--disable-f90 \
--disable-f90modules \
--disable-c++ \
--disable-mpedbg \
--disable-devdebug \
--disable-debug \
--enable-sharedlib=$MPI_ARCH_PATH/lib \
--with-device=ch_p4 \
-prefix=$MPI_ARCH_PATH
make
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
# Build Scotch decomposition
(
cd scotch_5.1 || exit
wmake libso src/libscotch
wmake libso src/libscotchmetis
)
# Build Metis decomposition
(
cd metis-5.0pre2 || exit
wmake libso GKlib
wmake libso libmetis
)
# Build parMetis. Requires MPI!
if [ -d "$MPI_ARCH_PATH" ]
then
(
cd ParMetis-3.1 || exit
wmake libso METISLib
wmake libso ParMETISLib
)
fi
# Build ParMGridGen
wmake libso ParMGridGen-1.0/MGridGen/IMlib
wmake libso ParMGridGen-1.0/MGridGen/Lib
set +x
echo
echo ==============================
echo done ThirdParty Allwmake
echo ==============================
echo
# ----------------------------------------------------------------- end-of-file