-
Notifications
You must be signed in to change notification settings - Fork 15
/
Allwmake.mingw
80 lines (74 loc) · 3 KB
/
Allwmake.mingw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/sh
#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | foam-extend: Open Source CFD
# \\ / O peration | Version: 4.1
# \\ / A nd | Web: http://www.foam-extend.org
# \\/ M anipulation | For copyright notice see file Copyright
#------------------------------------------------------------------------------
# License
# This file is part of foam-extend.
#
# foam-extend 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.
#
# foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# Allwmake.mingw
#
# Description
# Top-level build script for use with MSYS shell for MinGW-based builds on Windows.
#
# Author:
# Cesare Guardino, Alstom Power Ltd., (2015)
#
#------------------------------------------------------------------------------
cd ${0%/*} || exit 1 # run from this directory
echo
echo "=============== FOAM-EXTEND MINGW WINDOWS TOP-LEVEL BUILD SCRIPT ==============="
if [ "$PWD" != "$WM_PROJECT_DIR" ]
then
echo "Error: Current directory is not \$WM_PROJECT_DIR"
echo " The environment variable are not consistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
fi
cd $WM_PROJECT_DIR/ThirdParty/mingwBuild
echo
echo "In directory `pwd`"
echo "Configuring your OpenMPI installation ..."
./configure_OpenMPI.sh
PACKAGES_DIR=$WM_PROJECT_DIR/ThirdParty/packages
if [ -d $PACKAGES_DIR ] ; then
echo "Third-party dependencies packages $PACKAGES_DIR already exists."
else
echo "Building third-party dependencies ... (see `pwd`/build.log)"
./build.sh > build.log 2>&1
echo "Installing third-party dependencies ..."
rm -rf $PACKAGES_DIR
mv x64/install $PACKAGES_DIR
fi
cd $WM_PROJECT_DIR
echo
echo "In directory `pwd`"
echo "Build foam-extend ... (see `pwd`/Allwmake.log)"
./Allwmake > Allwmake.log 2>&1
echo "Copying MinGW dependencies to $FOAM_APPBIN ..."
cp -p $MINGW_HOME/bin/libgcc_s_seh-1.dll $FOAM_APPBIN
cp -p $MINGW_HOME/bin/libgomp-1.dll $FOAM_APPBIN
cp -p $MINGW_HOME/bin/libstdc++-6.dll $FOAM_APPBIN
cp -p $MINGW_HOME/bin/libwinpthread-1.dll $FOAM_APPBIN
cp -p $WM_THIRD_PARTY_DIR/packages/pthreads-w32-2-9-1-release/Pre-built.2/dll/x64/pthreadGC2.dll $FOAM_APPBIN
echo "Creating release package ... (see `pwd`/createWindowsBinaryPackage.log)"
./bin/createWindowsBinaryPackage > createWindowsBinaryPackage.log 2>&1
echo
echo "All done!"