diff --git a/Allwmake b/Allwmake index ca2113e522cf92ccfa3d626acb9c16b30bdc1a41..27dce3b858bd22de6af9e8013cf1de06c6585154 100755 --- a/Allwmake +++ b/Allwmake @@ -6,8 +6,9 @@ set -x ( cd wmake/src && make ) # build ThirdParty sources -( cd $WM_THIRD_PARTY_DIR && ./Allwmake ) +$WM_PROJECT_DIR/bin/tools/AllwmakeThirdParty +# build OpenFOAM libraries and applications src/Allwmake applications/Allwmake diff --git a/applications/utilities/mesh/conversion/Optional/Allwmake b/applications/utilities/mesh/conversion/Optional/Allwmake index ae71b400fa5dda71248426baa4d181889f94b4a0..e0a4e315da977b1c08083fc51ffc99567c3f6ed1 100755 --- a/applications/utilities/mesh/conversion/Optional/Allwmake +++ b/applications/utilities/mesh/conversion/Optional/Allwmake @@ -5,9 +5,8 @@ cd ${0%/*} || exit 1 # run from this directory set -x - # build libccmio and create lnInclude directory -( cd $WM_THIRD_PARTY_DIR && ./AllwmakeLibccmio ) +$WM_PROJECT_DIR/bin/tools/AllwmakeLibccmio # if the library built properly, the headers should exist too if [ -e $FOAM_LIBBIN/libccmio.so ] diff --git a/bin/tools/AllwcleanThirdParty b/bin/tools/AllwcleanThirdParty new file mode 100755 index 0000000000000000000000000000000000000000..6b233f92c66af9dd570bd0fc3343f05e17738729 --- /dev/null +++ b/bin/tools/AllwcleanThirdParty @@ -0,0 +1,50 @@ +#!/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 +# AllwcleanThirdParty +# +# Description +# Distribution clean script for ThirdParty +# +# Still somewhat incomplete +#------------------------------------------------------------------------------ +[ -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 + +rm -rf gcc-4.3.3/build +rm -rf gmp-4.2.4/build +rm -rf mpfr-2.4.1/build + +( cd metis-5.0pre2 && make distclean ) +( cd openmpi-1.3.3 && make distclean ) +( cd paraview-3.6.1 && make distclean ) + +# ----------------------------------------------------------------- end-of-file diff --git a/bin/tools/AllwmakeLibccmio b/bin/tools/AllwmakeLibccmio new file mode 100755 index 0000000000000000000000000000000000000000..c4b9d63d3c30acf694e2253d67c9692e991e64a9 --- /dev/null +++ b/bin/tools/AllwmakeLibccmio @@ -0,0 +1,70 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 1991-2007 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 +# AllwmakeLibccmio +# +# Description +# Get and build CD-adapco's ccmio library +# +#------------------------------------------------------------------------------ +packageDir=libccmio-2.6.1 + +[ -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 + +if [ ! -d ${packageDir} ] +then + if [ ! -e ${packageDir}.tar.gz ] + then + wget --no-check-certificate \ + https://wci.llnl.gov/codes/visit/3rd_party/${packageDir}.tar.gz + fi + + if [ -e ${packageDir}.tar.gz ] + then + tar -xzf ${packageDir}.tar.gz + else + echo "no ${packageDir}.tar.gz to unpack" + fi +fi + +if [ -d ${packageDir} -a ! -d ${packageDir}/Make ] +then + cp -r wmakeFiles/libccmio ${packageDir}/Make +fi + +if [ -d ${packageDir}/Make ] +then + wmake libso ${packageDir} +fi + + +# ----------------------------------------------------------------- end-of-file diff --git a/bin/tools/AllwmakeThirdParty b/bin/tools/AllwmakeThirdParty new file mode 100755 index 0000000000000000000000000000000000000000..83d4746a071528e87eeadc74abb529fa899eeb69 --- /dev/null +++ b/bin/tools/AllwmakeThirdParty @@ -0,0 +1,194 @@ +#!/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 diff --git a/bin/tools/makeGcc b/bin/tools/makeGcc new file mode 100755 index 0000000000000000000000000000000000000000..01d6179f2dd5857bb52ef914435d88ca56cdfe78 --- /dev/null +++ b/bin/tools/makeGcc @@ -0,0 +1,142 @@ +#!/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 +# makeGcc +# +# Description +# Build script for gmp, mpfr and gcc-4.3.? and gcc-4.4.? +# +#------------------------------------------------------------------------------ + +gmpVERSION=gmp-4.2.4 +mpfrVERSION=mpfr-2.4.1 +gccVERSION="$1" + +usage() { + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat<<USAGE + +usage: ${0##*/} <gcc-4.?.?> ... + +* build gmp, mpfr and gcc-4.3.? and gcc-4.4.? + +USAGE + exit 1 +} + +[ "$#" -eq 1 ] || usage "gcc version not provided" + + +# +# Set the number of cores to build on +# +WM_NCOMPPROCS=1 + +if [ -r /proc/cpuinfo ] +then + WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l) + [ $WM_NCOMPPROCS -le 8 ] || WM_NCOMPPROCS=8 +fi + +echo "Building on " $WM_NCOMPPROCS " cores" + +GCC_DIR=$WM_THIRD_PARTY_DIR/$gccVERSION +GMP_DIR=$WM_THIRD_PARTY_DIR/$gmpVERSION +MPFR_DIR=$WM_THIRD_PARTY_DIR/$mpfrVERSION + +GCCROOT=${GCC_DIR}/platforms/$WM_ARCH$WM_COMPILER_ARCH +GMPROOT=${GMP_DIR}/platforms/$WM_ARCH$WM_COMPILER_ARCH +MPFRROOT=${MPFR_DIR}/platforms/$WM_ARCH$WM_COMPILER_ARCH + +# +# Bulid GMP +# +if [ ! -d $GMPROOT ] +then +( + cd $GMP_DIR \ + && make distclean \ + && mkdir $GMP_DIR/build \ + && cd $GMP_DIR/build \ + && ../configure ABI=$ABI --prefix=$GMPROOT \ + && make -j $WM_NCOMPPROCS \ + && make install + + echo " Finished building gmp." +) +else + echo " gmp already built." +fi + +export LD_LIBRARY_PATH="$GMPROOT/lib:$LD_LIBRARY_PATH" + +# +# Build MPFR +# +if [ ! -d $MPFRROOT ] +then +( + cd $MPFR_DIR \ + && make distclean \ + && mkdir $MPFR_DIR/build \ + && cd $MPFR_DIR/build \ + && ../configure ABI=$ABI --prefix=$MPFRROOT --with-gmp=$GMPROOT \ + && make -j $WM_NCOMPPROCS \ + && make install + + echo " Finished building mpfr." +) +else + echo " mprf already built." +fi + +export LD_LIBRARY_PATH="$MPFRROOT/lib:$LD_LIBRARY_PATH" + +# +# Build GCC +# +if [ ! -d $GCCROOT ] +then +( + cd $GCC_DIR \ + && make distclean \ + && mkdir $GCC_DIR/build \ + && cd $GCC_DIR/build \ + && ../configure --enable-languages=c,c++ --with-pkgversion='OpenFOAM' \ + --enable-__cxa_atexit --enable-libstdcxx-allocator=new \ + --with-system-zlib --prefix=$GCCROOT \ + --with-mpfr=$MPFRROOT --with-gmp=$GMPROOT \ + && make -j $WM_NCOMPPROCS \ + && make install + + echo " Finished building gcc." +) +else + echo " gcc already built." +fi + + +# ----------------------------------------------------------------- end-of-file diff --git a/bin/tools/makeQT b/bin/tools/makeQT new file mode 100755 index 0000000000000000000000000000000000000000..8a4e047072ca77d7509220b3fbdb01c098e4165e --- /dev/null +++ b/bin/tools/makeQT @@ -0,0 +1,73 @@ +#!/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 +# makeQT +# +# Description +# Build script for Qt-4.3.5 +# +#------------------------------------------------------------------------------ + +QT_VERSION=4.3.5 +QT_HOME=${WM_THIRD_PARTY_DIR}/qt-x11-opensource-src-${QT_VERSION} +QT_ARCH_PATH=${QT_HOME}/platforms/${WM_OPTIONS} + + +if [ ! -d $QT_ARCH_PATH ] +then + cd $QT_HOME || { + echo "no Qt sources found" + exit 1 + } + + make distclean + rm -rf $QT_ARCH_PATH + + ./configure \ + --prefix=$QT_ARCH_PATH \ + -nomake demos \ + -nomake examples + + if [ -r /proc/cpuinfo ] + then + WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l) + [ $WM_NCOMPPROCS -le 8 ] || WM_NCOMPPROCS=8 + + echo "Building on " $WM_NCOMPPROCS " cores" + + time make -j $WM_NCOMPPROCS + else + time make + fi + + make install + + echo " Finished building Qt-$QT_VERSION" +else + echo " Qt-$QT_VERSION already built." +fi + +# ----------------------------------------------------------------- end-of-file