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 # foamListBinDirs <directory> [archOptions]
29 # Lists directories containing binary files of OpenFOAM
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 * Lists directories containing binary files for OpenFOAM
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/bin \
77 $packDir/platforms
/$archOptions/lib \
81 echo "Error: directory $dir does not exist" 1>&2
86 #------------------------------------------------------------------------------
90 $packDir/platforms
/$archOptions/bin \
91 $packDir/platforms
/$archOptions/lib \
92 $packDir/wmake
/platforms
/$archCompiler \
93 $packDir/wmake
/platforms
/$archOS \
94 $packDir/wmake
/rules
/General \
95 $packDir/wmake
/rules
/$archCompiler \
96 $packDir/wmake
/rules
/$archOS \
99 [ -d $dir ] && echo $dir
105 -------------------------------------------------------------------------------
106 Packing $archOptions ($archCompiler) port of $packDir
108 32bit archOS = $arch3264
111 $(echo ${dirList:-NONE})
117 #------------------------------------------------------------------------------