2 #------------------------------------------------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
8 #-------------------------------------------------------------------------------
10 # This file is part of OpenFOAM.
12 # OpenFOAM is free software: you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by
14 # the Free Software Foundation, either version 3 of the License, or
15 # (at your option) any later version.
17 # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
18 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 # You should have received a copy of the GNU General Public License
23 # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 # foamListThirdPartyBinDirs <directory> [archOptions]
29 # Lists directories containing binary files for OpenFOAM ThirdParty
32 # Not normally called directly by the user.
33 #------------------------------------------------------------------------------
34 toolsDir
="${0%/*}" # this script is already located in the tools/ directory
36 [ $# -eq 1 -o $# -eq 2 ] ||
{
38 Usage : ${0##*/} <packDir> [archOptions]
40 * List directories containing binary files for OpenFOAM ThirdParty
42 The value of 'archOptions' normally corresponds to \$WM_OPTIONS
43 The current value of \$WM_OPTIONS = $WM_OPTIONS
49 #------------------------------------------------------------------------------
52 # default to same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
53 archOptions
="${2:-$WM_OPTIONS}"
55 [ -n "$archOptions" ] ||
{
56 echo "Error: no archOptions specified" 1>&2
60 # base arch (w/o precision, optimization, etc)
61 # same as "$WM_ARCH$WM_COMPILER"
62 archCompiler
=$
(echo "$archOptions" |
sed -e 's@[DS]P.*$@@')
64 # same as $WM_ARCH - eg, 'linux64'
65 # TODO: only works for Gcc, Icc, Clang
66 archOS
=$
(echo "$archOptions" |
sed -e 's@[GI]cc.*$@@' -e 's@Clang.*$@@')
68 # links for 32-bit version, eg convert linux64 -> linux-64
69 arch3264
=$
(echo "$archOS" |
sed -e 's@64@-64@')
72 #------------------------------------------------------------------------------
73 # check for essential directories
76 $packDir/platforms
/$archOptions/lib \
80 echo "Error: directory $dir does not exist" 1>&2
85 #------------------------------------------------------------------------------
89 $packDir/platforms
/$archOptions \
90 $packDir/platforms
/$archCompiler \
91 $packDir/platforms
/$archOS \
94 [ -d $dir ] && echo $dir
97 # add in links for 32-bit version
98 if [ "$archOS" != "$arch3264" ]
101 $packDir/platforms
/$arch3264 \
104 [ -d $dir -a -L $dir ] && echo $dir
111 -------------------------------------------------------------------------------
112 Packing $archOptions ($archCompiler) port of $packDir
114 32bit archOS = $arch3264
117 $(echo ${dirList:-NONE})
123 #------------------------------------------------------------------------------