2 #------------------------------------------------------------------------------
4 # \\ / F ield | foam-extend: Open Source CFD
6 # \\ / A nd | For copyright notice see file Copyright
8 #------------------------------------------------------------------------------
10 # This file is part of foam-extend.
12 # foam-extend is free software: you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by the
14 # Free Software Foundation, either version 3 of the License, or (at your
15 # option) any later version.
17 # foam-extend is distributed in the hope that it will be useful, but
18 # WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 # General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
29 # Build script for ThirdParty packages not requiring rpm packaging
33 # 1: Your OpenFOAM environment must be properly initialized
34 # 2: OpenFOAM must already been compiled because swak4Foam depends on
35 # OpenFOAM include files and libraries
38 # Martin Beaudoin, Hydro-Quebec, (2012)
40 #------------------------------------------------------------------------------
41 # run from Third-party directory only
44 wmakeCheckPwd
"$WM_THIRD_PARTY_DIR" ||
{
45 echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
46 echo " The environment variables are inconsistent with the installation."
47 echo " Check the OpenFOAM entries in your dot-files and source them."
51 #------------------------------------------------------------------------------
53 echo "========================================"
54 echo "Starting ThirdParty AllMake: Stage5 "
55 echo "========================================"
58 # swak4Foam - Version 0.2.4
59 # In fact, we are basically tracking the head branch from the Mercurial repository
60 # which is also replicated under the Breeder_1.7 section of the Subversion repository
63 SWAK_RELEASE_VERSION
=0.2.4
65 if [ -z "$SWAK4FOAM_SYSTEM" ]
67 # Do we need to download the source code?
68 # We choose to put the source code under ./rpmBuild/BUILD prior to compiling.
69 # We will not generate a rpm package, but all ThirdParty source code will be
70 # centralized under the same scratch area
71 if [ ! -e .
/rpmBuild
/BUILD
/swak4Foam-
$SWAK_RELEASE_VERSION ];
73 echo "Checking for a Mercurial client: hg"
74 command -v hg
>/dev
/null
77 echo "Using Mercurial/hg to download the source code for swak4Foam"
80 hg clone http
://hg.code.sf.net
/p
/openfoam-extend
/swak4Foam swak4Foam-
$SWAK_RELEASE_VERSION;
81 cd swak4Foam-
$SWAK_RELEASE_VERSION;
82 hg checkout version_
$SWAK_RELEASE_VERSION
85 echo "Warning: Mercurial/hg is not installed. Switching to an alternate Subversion repository"
86 command -v svn
>/dev
/null
89 echo "Using Subversion/svn to download the source code for swak4Foam"
90 (cd .
/rpmBuild
/BUILD
; svn checkout svn
://svn.code.sf.net
/p
/openfoam-extend
/svn
/trunk
/Breeder_1.7
/libraries
/swak4Foam swak4Foam-
$SWAK_RELEASE_VERSION)
92 echo "Error: Please install either a Mercurial or Subversion client in order to download the source code for swak4Foam"
96 # We move the compilation results directly to $FOAM_SITE_APPBIN and $FOAM_SITE_LIBBIN
97 # If you prefer to keep the libraries and tools under $FOAM_USER_LIBBIN and $FOAM_USER_APPBIN, simply
98 # comment out the next two lines
99 (cd .
/rpmBuild
/BUILD
/swak4Foam-
$SWAK_RELEASE_VERSION; find .
-name files |
xargs -n 1 sed -i.old
"s/FOAM_USER/FOAM_SITE/g")
100 (cd .
/rpmBuild
/BUILD
/swak4Foam-
$SWAK_RELEASE_VERSION; find .
-name options |
xargs -n 1 sed -i.old
"s/FOAM_USER/FOAM_SITE/g")
101 (cd .
/rpmBuild
/BUILD
/swak4Foam-
$SWAK_RELEASE_VERSION; sed -i.old
"s|// #define FOAM_SYMMTENSOR_WORKAROUND|#define FOAM_SYMMTENSOR_WORKAROUND|g" Libraries
/swak4FoamParsers
/include
/swak.H
)
103 # We recompile everything
104 (cd .
/rpmBuild
/BUILD
/swak4Foam-
$SWAK_RELEASE_VERSION; .
/Allwclean
; .
/Allwmake
)
106 echo "The source code for swak4Foam is already present under ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION"
107 echo "Please remove this directory if you want to refresh your installation of swak4Foam"
111 echo "Using system installed swak4Foam"
115 echo "========================================"
116 echo "Done ThirdParty AllMake: Stage5 "
117 echo "========================================"
120 # ----------------------------------------------------------------- end-of-file