forked from Expander/FlexibleSUSY
/
flexiblesusy-config.in
252 lines (229 loc) · 10.2 KB
/
flexiblesusy-config.in
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
#!/bin/sh
# Author: Alexander Voigt
BASEDIR=$(dirname $0)
ABSBASEDIR=$(cd ${BASEDIR}; pwd)
CONFIGDIR="${BASEDIR}/config"
packagename="@PKGNAME@"
version="@FLEXIBLESUSY_VERSION@"
algorithms="@ALGORITHMS@"
addons="@ADDONS@"
blaslibs="@BLASLIBS@"
boostflags="@BOOSTFLAGS@"
boosttestlibs="@BOOSTTESTLIBS@"
boostthreadlibs="@BOOSTTHREADLIBS@"
cppflags_from_configure="@CPPFLAGS@"
cxx="@CXX@"
cxxflags="@CXXFLAGS@"
eigenflags="@EIGENFLAGS@"
fc="@FC@"
fflags="@FFLAGS@"
flibs="@FLIBS@"
gslflags="@GSLFLAGS@"
gsllibs="@GSLLIBS@"
lapacklibs="@LAPACKLIBS@"
ldflags="@LDFLAGS@"
ldlibs="@LDLIBS@"
loopfuncflags="@LOOPFUNCFLAGS@"
loopfunclibs="@LOOPFUNCLIBS@"
math="@MATH@"
models="@MODELS@"
module_make_lib_cmd="@MODULE_MAKE_LIB_CMD@"
module_lib_ext="@MODULE_LIBEXT@"
shared_lib_cmd="@SHARED_LIB_CMD@"
sqliteflags="@SQLITEFLAGS@"
sqlitelibs="@SQLITELIBS@"
static_lib_cmd="@STATIC_LIB_CMD@"
threadlibs="@THREADLIBS@"
tsilflags="@TSILFLAGS@"
tsillibs="@TSILLIBS@"
create_include_directives_for_FS_modules() {
local incl=
for m in config src fflite legacy slhaea doc $models $addons ; do
incl="$incl -I${m}"
done
echo "$incl"
}
create_include_directives_for_external_modules() {
local incl="$gslflags $eigenflags $boostflags"
[ "x@ENABLE_TSIL@" = xyes ] && \
incl="$incl $tsilflags"
[ "x@ENABLE_LOOPTOOLS@" = xyes -a "x@ENABLE_FFLITE@" = xyes ] && \
incl="$incl $loopfuncflags"
[ "x@ENABLE_LIBRARYLINK@" = xyes ] && \
incl="$incl $(${CONFIGDIR}/mathematica_include_paths.sh --math-cmd="$math" -I --librarylink --mathlink)"
echo "$incl"
}
# creates list of FlexibleSUSY module libraries
create_flexiblesusy_libs() {
local flexiblesusylibs=
for a in $models $addons ; do
flexiblesusylibs="$flexiblesusylibs ${ABSBASEDIR}/${a}/lib$(basename $a)${module_lib_ext}"
done
flexiblesusylibs="$flexiblesusylibs ${ABSBASEDIR}/src/libflexisusy${module_lib_ext}"
flexiblesusylibs="$flexiblesusylibs ${ABSBASEDIR}/legacy/liblegacy${module_lib_ext}"
echo "$flexiblesusylibs"
}
incl_FS_modules="$(create_include_directives_for_FS_modules)"
incl_external_modules="$(create_include_directives_for_external_modules)"
cppflags_without_modules="$cppflags_from_configure $incl_external_modules"
cppflags="$cppflags_from_configure $incl_FS_modules $incl_external_modules"
flexiblesusy_libs="$(create_flexiblesusy_libs)"
compile_cmd="$cxx $cppflags $cxxflags"
libs="$ldflags $flexiblesusy_libs $loopfunclibs $gsllibs $boostthreadlibs $lapacklibs $blaslibs $flibs $sqlitelibs $tsillibs $threadlibs $ldlibs"
help() {
cat <<EOF
Usage: `basename $0` [options]
Options:
--algorithms Print all algorithms that are used
--addons Print all addons that are build
--blaslibs Print BLAS libraries, BLASLIBS
--boostflags Print compiler flags for BOOST, BOOSTFLAGS
--boosttestlibs Print BOOST test libraries, BOOSTTESTLIBS
--boostthreadlibs Print BOOST thread libraries, BOOSTTHREADLIBS
--compile-cmd Print compilation command for object files
--cppflags Print C preprocessor flags, CPPFLAGS
--cppflags-without-modules
Print C preprocessor flags without -I directives
for FlexibleSUSY models and addons
--cxx Print C++ compiler, CXX
--cxxflags Print C++ compiler flags, CXXFLAGS
--eigenflags Print compiler flags for Eigen, EIGENFLAGS
--enable-colors Test if colors are enabled
--enable-compile Test if compilation is enabled
--enable-compiler-warnings
Test if compiler warnings are enabled
--enable-debug Test if debug mode is enabled
--enable-fflite Test if FFlite is enabled
--enable-lapack Test if LAPACK is enabled
--enable-librarylink Test if LibraryLink is enabled
--enable-looptools Test if LoopTools is enabled
--enable-mass-error-check
Test if mass error check is enabled
--enable-ilp64mkl-workaround
Test if ilp64 MKL workaround is enabled
--enable-silent Test if silet mode is enabled
--enable-shared-libs Test if shared libraries are build
--enable-sqlite Test if SQLite is enabled
--enable-static Test if static executables are build
--enable-threads Test if multi-threading is enabled
--enable-tsil Test if TSIL is linked in
--enable-verbose Test if verbose mode is enabled
--fc Print Fortran compiler, FC
--fflags Print Fortran flags, FFLAGS
--flexiblesusylibs Print FlexibleSUSY module libraries
--flibs Print Fortran libraries, FLIBS
--gslflags Print compiler flags for GSL, GSLFLAGS
--gsllibs Print GSL libraries, GSLLIBS
--lapacklibs Print LAPACK libraries, LAPACKLIBS
--ldflags Print flags for optional libraries, LDFLAGS
--ldlibs Print optional libraries, LDLIBS
--libs Print all libraries linked to an executable
--loopfuncflags Print compiler flags for loop function library, LOOPFUNCFLAGS
--loopfunclibs Print loop function libraries, LOOPFUNCLIBS
--math-cmd Print Mathematica kernel command, MATH
--models Print all models that are build
--module-make-lib-cmd Print command to build module libraries, MODULE_MAKE_LIB_CMD
--module-lib-ext Print file name extension for module libraries, MODULE_LIBEXT
--shared-lib-cmd Print command to build shared library, SHARED_LIB_CMD
--sqliteflags Print SQLite flags, SQLITEFLAGS, SQLITEFLAGS
--sqlitelibs Print SQLite libararies, SQLITELIBS, SQLITELIBS
--static-lib-cmd Print command to build static library, STATIC_LIB_CMD
--threadlibs Print thread library, THREADLIBS
--tsilflags Print TSIL flags, TSILFLAGS
--tsillibs Print TSIL libraries, TSILLIBS
--with-<addon> Test if <addon> is compiled in
--with-<algorithm> Test if <algorithm> is compiled in
--with-<model> Test if <model> is compiled in
--version Print the $packagename version
--help Print this message
EOF
}
out=""
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--addons) out="$out $addons" ;;
--algorithms) out="$out $algorithms" ;;
--blaslibs) out="$out $blaslibs" ;;
--boostflags) out="$out $boostflags" ;;
--boosttestlibs) out="$out $boosttestlibs" ;;
--boostthreadlibs) out="$out $boostthreadlibs" ;;
--compile-cmd) out="$out $compile_cmd" ;;
--cppflags) out="$out $cppflags" ;;
--cppflags-without-modules) out="$out $cppflags_without_modules" ;;
--cxx) out="$out $cxx" ;;
--cxxflags) out="$out $cxxflags" ;;
--eigenflags) out="$out $eigenflags" ;;
--fc) out="$out $fc" ;;
--fflags) out="$out $fflags" ;;
--flexiblesusylibs) out="$out $flexiblesusy_libs" ;;
--flibs) out="$out $flibs" ;;
--gslflags) out="$out $gslflags" ;;
--gsllibs) out="$out $gsllibs" ;;
--lapacklibs) out="$out $lapacklibs" ;;
--ldflags) out="$out $ldflags" ;;
--ldlibs) out="$out $ldlibs" ;;
--libs) out="$out $libs" ;;
--loopfuncflags) out="$out $loopfuncflags" ;;
--loopfunclibs) out="$out $loopfunclibs" ;;
--math-cmd) out="$out $math" ;;
--models) out="$out $models" ;;
--module-make-lib-cmd) out="$out $module_make_lib_cmd" ;;
--module-lib-ext) out="$out $module_lib_ext" ;;
--shared-lib-cmd) out="$out $shared_lib_cmd" ;;
--sqliteflags) out="$out $sqliteflags" ;;
--sqlitelibs) out="$out $sqlitelibs" ;;
--static-lib-cmd) out="$out $static_lib_cmd" ;;
--threadlibs) out="$out $threadlibs" ;;
--tsilflags) out="$out $tsilflags" ;;
--tsillibs) out="$out $tsillibs" ;;
--with-*)
### Check for models and addons
f=`echo $1 | sed 's/--with-//'`
for c in $models $addons $algorithms ; do
if test "x`basename $c`" = "x$f" ; then
out="$out yes"
break
fi
c=""
done
if test "x$c" = "x" ; then
out="$out no"
fi
;;
### flags
--enable-colors) out="$out @ENABLE_COLOR_PRINTOUT@" ;;
--enable-compile) out="$out @ENABLE_COMPILE@" ;;
--enable-compiler-warnings) out="$out @ENABLE_COMPILER_WARNINGS@" ;;
--enable-debug) out="$out @ENABLE_DEBUG@" ;;
--enable-fflite) out="$out @ENABLE_FFLITE@" ;;
--enable-lapack) out="$out @ENABLE_LAPACK@" ;;
--enable-librarylink) out="$out @ENABLE_LIBRARYLINK@" ;;
--enable-looptools) out="$out @ENABLE_LOOPTOOLS@" ;;
--enable-mass-error-check) out="$out @ENABLE_CHECK_EIGENVALUE_ERROR@" ;;
--enable-ilp64mkl-workaround) out="$out @ENABLE_ILP64MKL_WORKAROUND@" ;;
--enable-silent) out="$out @ENABLE_SILENT@" ;;
--enable-shared-libs) out="$out @ENABLE_SHARED_LIBS@" ;;
--enable-sqlite) out="$out @ENABLE_SQLITE@" ;;
--enable-static) out="$out @ENABLE_STATIC@" ;;
--enable-threads) out="$out @ENABLE_THREADS@" ;;
--enable-tsil) out="$out @ENABLE_TSIL@" ;;
--enable-verbose) out="$out @ENABLE_VERBOSE@" ;;
--version) out="$out $version" ;;
--help)
help
exit 0
;;
*)
echo "Unknown argument: $1" 1>&2
help
exit 1
;;
esac
shift
done
### Output the stuff
echo $out