2 #------------------------------------------------------------------------------
4 # \\ / F ield | foam-extend: Open Source CFD
5 # \\ / O peration | Version: 3.2
6 # \\ / A nd | Web: http://www.foam-extend.org
7 # \\/ M anipulation | 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 # Downloads, extracts, builds and installs thirdy-party dependencies.
32 # Cesare Guardino, Alstom Power Ltd., (2015)
34 #------------------------------------------------------------------------------
36 # {{{ DEFINE UTILITY FUNCTIONS
41 if [ -f $BUILD_HOME/downloads
/$file ] ; then
42 echo "Using already existing file $BUILD_HOME/downloads/$file"
44 wget
--no-check-certificate $url -O $BUILD_HOME/downloads
/$file
52 cp -p $BUILD_HOME/downloads
/$file .
53 package
=`basename $file`
54 if [ "$program" = "7zip" ] ; then
57 $program -cd $package |
tar xvf
-
74 cp -rp $BUILD_HOME/$ARCH/patches
/$dir .
80 if [ ! -d $dir ] ; then
88 rm -rf $dir > /dev
/null
2>&1
93 # {{{ DEFINE PROCESS FUNCTIONS
95 echo "======================== FOAM-EXTEND THIRD-PARTY DEPENDENCIES WINDOWS BUILD SCRIPT ========================"
101 if [ ! "$MINGW_HOME" ] ; then
102 echo "*** ERROR: MINGW_HOME environment variable not specified."
105 echo "Using MINGW_HOME=$MINGW_HOME"
112 BUILD_DIR
=$BUILD_HOME/$ARCH/build
113 INSTALL_DIR
=$BUILD_HOME/$ARCH/install
114 OUT_DIR
=$BUILD_HOME/$ARCH/output
116 mkchk
$BUILD_HOME/downloads
119 echo "All stdout/stderr output is redirected to the directory $OUT_DIR"
120 echo "All builds occur in the directory $BUILD_DIR"
121 echo "The script will install the completed builds in the directory $INSTALL_DIR"
126 echo "Removing previous builds ..."
136 echo "- Building $PACKAGE ..."
137 LOG_FILE
=$OUT_DIR/$PACKAGE.log
143 download
$PACKAGE.
zip https
://github.com
/dlfcn-win32
/dlfcn-win32
/archive
/master.
zip > $LOG_FILE 2>&1
144 extract
$PACKAGE.
zip 7zip >> $LOG_FILE 2>&1
146 .
/configure
--prefix=$INSTALL_DIR/system
>> $LOG_FILE 2>&1
147 make >> $LOG_FILE 2>&1
148 mkdir
$INSTALL_DIR/system
149 make install >> $LOG_FILE 2>&1
157 pthreads-w32-2-9-1-release
)
158 download
$PACKAGE.
zip ftp://sourceware.org
/pub
/pthreads-win32
/pthreads-w32-2-9-1-release.
zip > $LOG_FILE 2>&1
159 unzip_dir
$PACKAGE >> $LOG_FILE 2>&1
161 mv $PACKAGE $INSTALL_DIR
165 download
$PACKAGE.
tar.gz http
://glaros.dtc.umn.edu
/gkhome
/fetch
/sw
/metis
/$PACKAGE.
tar.gz
> $LOG_FILE 2>&1
166 extract
"$PACKAGE.tar.gz" gzip >> $LOG_FILE 2>&1
171 cmake
-G "MSYS Makefiles" -DCMAKE_CONFIGURATION-TYPES="Release" -DGKLIB_PATH="../../GKlib" ..
/..
>> $LOG_FILE 2>&1
172 make >> $LOG_FILE 2>&1
173 mkdir
$INSTALL_DIR/$PACKAGE
174 mkdir
$INSTALL_DIR/$PACKAGE/bin
175 mkdir
$INSTALL_DIR/$PACKAGE/include
176 mkdir
$INSTALL_DIR/$PACKAGE/lib
177 cp -p programs
/*.exe
$INSTALL_DIR/$PACKAGE/bin
178 cp -p ..
/..
/include
/metis.h
$INSTALL_DIR/$PACKAGE/include
179 cp -p libmetis
/libmetis.a
$INSTALL_DIR/$PACKAGE/lib
183 download
$PACKAGE.
tar.gz http
://glaros.dtc.umn.edu
/gkhome
/fetch
/sw
/parmetis
/$PACKAGE.
tar.gz
> $LOG_FILE 2>&1
184 extract
"$PACKAGE.tar.gz" gzip >> $LOG_FILE 2>&1
189 cmake
-G "MSYS Makefiles" -DCMAKE_CONFIGURATION-TYPES="Release" -DGKLIB_PATH="../../metis/GKlib" ..
/..
>> $LOG_FILE 2>&1
190 $BUILD_HOME/parmetis_includes_hack.pl
191 make >> $LOG_FILE 2>&1
192 mkdir
$INSTALL_DIR/$PACKAGE
193 mkdir
$INSTALL_DIR/$PACKAGE/bin
194 mkdir
$INSTALL_DIR/$PACKAGE/include
195 mkdir
$INSTALL_DIR/$PACKAGE/lib
196 cp -p programs
/*.exe
$INSTALL_DIR/$PACKAGE/bin
197 cp -p ..
/..
/metis
/include
/metis.h
$INSTALL_DIR/$PACKAGE/include
198 cp -p ..
/..
/include
/parmetis.h
$INSTALL_DIR/$PACKAGE/include
199 cp -p libmetis
/libmetis.a
$INSTALL_DIR/$PACKAGE/lib
200 cp -p libparmetis
/libparmetis.a
$INSTALL_DIR/$PACKAGE/lib
204 export EXTRA_SYSTEM_HOME
=$INSTALL_DIR/system
205 download
$PACKAGE.
tar.gz http
://www.mgnet.org
/mgnet
/Codes
/parmgridgen
/$PACKAGE.
tar.gz
> $LOG_FILE 2>&1
206 extract
"$PACKAGE.tar.gz" gzip >> $LOG_FILE 2>&1
209 make serial
>> $LOG_FILE 2>&1
210 make parallel
>> $LOG_FILE 2>&1
211 mkdir
$INSTALL_DIR/$PACKAGE
212 mkdir
$INSTALL_DIR/$PACKAGE/bin
213 mkdir
$INSTALL_DIR/$PACKAGE/include
214 mkdir
$INSTALL_DIR/$PACKAGE/lib
215 cp -p *.exe
$INSTALL_DIR/$PACKAGE/bin
216 cp -p libmgrid.a
$INSTALL_DIR/$PACKAGE/lib
217 cp -p libparmgrid.a
$INSTALL_DIR/$PACKAGE/lib
218 cp -p MGridGen
/IMlib
/libIMlib.a
$INSTALL_DIR/$PACKAGE/lib
219 cp -p ParMGridGen
/IMParMetis-2.0
/libIMparmetis.a
$INSTALL_DIR/$PACKAGE/lib
220 cp -p MGridGen
/IMlib
/*.h
$INSTALL_DIR/$PACKAGE/include
221 cp -p MGridGen
/Lib
/*.h
$INSTALL_DIR/$PACKAGE/include
222 export EXTRA_SYSTEM_HOME
=
226 export PTHREADS_HOME
=$INSTALL_DIR/pthreads-w32-2-9-1-release
227 download
$PACKAGE.
tar.gz https
://gforge.inria.fr
/frs
/download.php
/34618 > $LOG_FILE 2>&1
228 extract
"$PACKAGE.tar.gz" gzip >> $LOG_FILE 2>&1
231 make scotch
>> $LOG_FILE 2>&1
232 make ptscotch
>> $LOG_FILE 2>&1
233 mkdir
$INSTALL_DIR/$PACKAGE
234 make install prefix
=$INSTALL_DIR/$PACKAGE >> $PACKAGE.log
2>&1
235 export PTHREADS_HOME
=
239 export CPPFLAGS
=-fpermissive
240 download
$PACKAGE.
tar.gz http
://downloads.sourceforge.net
/project
/openfoam-extend
/foam-extend-3.0
/ThirdParty
/$PACKAGE.
tar.gz
> $LOG_FILE 2>&1
241 extract
"$PACKAGE.tar.gz" gzip >> $LOG_FILE 2>&1
243 cp -p $MINGW_HOME/bin
/libstdc
++-6.dll utils
244 .
/configure
--prefix=$INSTALL_DIR >> $LOG_FILE 2>&1
245 make >> $LOG_FILE 2>&1
246 mkdir
$INSTALL_DIR/$PACKAGE
247 make install prefix
=$INSTALL_DIR/$PACKAGE >> $LOG_FILE 2>&1
252 echo "*** ERROR: Unknown package '$PACKAGE'"
260 echo "Building libraries ..."
261 build_library dlfcn-win32-master
263 build_library pthreads-w32-2-9-1-release
264 build_library metis-5.1
.0
265 build_library parmetis-4.0
.3
266 build_library ParMGridGen-1.0
267 build_library scotch_6.0
.4
268 build_library mesquite-2.1
.2
273 echo "Checking for build directories and creating them if required ..."
287 cd ${0%/*} ||
exit 1 # run from this directory