forked from Expander/FlexibleSUSY
/
building.dox
301 lines (194 loc) · 10.1 KB
/
building.dox
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
/**
\page building Generating a FlexibleSUSY spectrum generator
\tableofcontents
\section generating_a_specgen Generating a FlexibleSUSY spectrum generator
\subsection Requirements
- C++ compiler (`g++` >= 4.8.4 or `clang++` >= 3.4 or `icpc` >= 12.1)
- Fortran compiler (`gfortran`, `ifort`)
- Mathematica (version 7.0 or higher)
- SARAH (version 4.11.0 or higher) http://sarah.hepforge.org
- Boost (version 1.37.0 or higher) http://www.boost.org
- Eigen 3 (version 3.1 or higher) http://eigen.tuxfamily.org
- GNU scientific library http://www.gnu.org/software/gsl/
- Lapack / Blas http://www.netlib.org/lapack/
Optional:
- Looptools (version 2.8 or higher) http://www.feynarts.de/looptools/
\subsection generation Generating a spectrum generator
Before you setup a FlexibleSUSY model, you have to provide a SARAH
model file. To make it available in FlexibleSUSY, you can put it
either into FlexibleSUSY's SARAH model directory
(`FlexibleSUSY/sarah/<model>/`) or directly into SARAH's own model
directly (`SARAH/Models/<model>/`).
Here `<model>` is the name of your SARAH model (e.g. SM, MSSM, NMSSM,
etc.). Note, that there are already plenty of pre-installed model
files under `SARAH/Models/` that can be used.
Setup a FlexibleSUSY model
./createmodel --name=<model>
See `./createmodel --help` for more details. Afterwards there will be
- a model directory <code>models/\<model\>/</code>
- a makefile module <code>models/\<model\>/module.mk</code>
- a Mathematica start script <code>models/\<model\>/start.m</code>
- and a FlexibleSUSY model file <code>models/\<model\>/FlexibleSUSY.m</code>
To modify the model details (input parameters, boundary conditions,
etc.), please edit the FlexibleSUSY model file
`models/<model>/FlexibleSUSY.m`. The model file options are explained
in more detail in @ref model_file_options .
Create the Makefile and register your model
./configure --with-models=<model>
Use `./configure --with-models=all` to build all available models.
See `./configure --help` for more options.
Start the spectrum generator generation and compile it by running
make
When `make` is executed, Mathematica is called and generates the C++
code for the spectrum generator. All C++ source files are written to
`models/<model>/`. Afterwards this C++ code will be compiled and a
user example spectrum generator `models/<model>/run_<model>.x` will be
created.
### Example ###
./createmodel --name=NMSSM
./configure --with-models=NMSSM
make
\section running_the_sg Running the spectrum generator
\subsection running_the_sg_cmd_line Running the spectrum generator from the command line
To run the spectrum generator at the command line, execute
./models/<model>/run_<model>.x --slha-input-file=<slha-input-file>
where `<slha-input-file>` is an SLHA input file. For more details on
the SLHA input options see @ref slha_input_fields .
### Example ###
./models/NMSSM/run_NMSSM.x --slha-input-file=model_files/NMSSM/LesHouches.in.NMSSM
The SLHA input can also read from `stdin` by using the dash `-` as
input file name:
cat model_files/NMSSM/LesHouches.in.NMSSM | ./models/NMSSM/run_NMSSM.x --slha-input-file=-
To specify a file name for the SLHA output use the
`--slha-output-file=` option.
### Example ###
./models/NMSSM/run_NMSSM.x --slha-input-file=model_files/NMSSM/LesHouches.in.NMSSM --slha-output-file=LesHouches.out.NMSSM
To suppress the SLHA output leave the file name after
`--slha-output-file=` empty.
The output can also be written to an SQLite database using the
`--database-output-file=` option.
### Example ###
./models/NMSSM/run_NMSSM.x --slha-input-file=model_files/NMSSM/LesHouches.in.NMSSM --slha-output-file= --database-output-file=point.db
\subsection running_the_sg_mathematica Running the spectrum generator from inside Mathematica
Since version 1.7.0, FlexibleSUSY provides a Mathematica interface.
Please see \ref librarylink for more details and examples.
\section no_compilation Creating only the source code files (no compilation)
If you want to only create the C++ source files for your model, but do
not want to compile the code, you can use the `--disable-compile`
configure option:
./configure --with-models=MSSM --disable-compile
make
Here, `configure` will not check for installed compilers or libraries.
It will only check for Mathematica and SARAH. The execution of `make`
will stop as soon as all C++ source code files are generated.
\section only_compilation Compile only (no code generation)
If you want to only compile already created the C++ source files for
your model, you can use the `--disable-meta` configure option:
./configure --with-models=MSSM --disable-meta
make
Here, `configure` will only check for installed compilers or
libraries. It will not check for Mathematica and SARAH.
Warning: Please make sure all C++ source files of your model are
available in the model directory `models/<model>/`. Otherwise the
compilation will fail.
\section export_src Exporting the generated source code
The generated C++ source code can be exported to a separate directory,
without the Mathematica meta code. This exported directory will be a
complete standalone package, with it's own build system. To export
the code, one has to set the target directory during configuration via
the `--with-install-dir=` option. For example
./configure --with-models=<models> --with-install-dir=/path/to/export/directory
By running
make install-src
the generated C++ source code for all `<models>` is copied to
`/path/to/export/directory`, together with the non-model specific
source code from `config/`, `doc/`, `slhaea/` and `src/`.
Afterwards, the standalone package can be build via
cd /path/to/export/directory
./configure --with-models=all
make
It is also possible to create a package which includes only the
generated source code of a given model. To create such a package run
make pack-<model>-src
where `<model>` is the name of the model whose generated source code
shall be packed. After `make` has finished, the package file
`<model>.tar.gz` can be found in the working directory.
\section dynamic_libraries Dynamic libraries
If you want to create dynamic libraries (instead of static libraries)
you need to pass the `--enable-shared-libs` option to the `configure`
script. The default file name extension for the shared libraries as
well as the command to build the libraries can be overwritten using
the
--with-shared-lib-ext=
--with-shared-lib-cmd=
parameters. For example, when Intel compilers should be used, replace
`gcc` by `icc` or `icpc`.
Example:
$ ./configure --with-models=CMSSM,NMSSM --enable-shared-libs --with-shared-lib-ext=".so" --with-shared-lib-cmd="gcc -shared -o"
\a Important \a remark:
The libraries are linked to the executables with \a absolute paths.
This means that, if you move the package directory to another
location, the executables will no longer find the libraries, because
the libraries are now at another place. To make the executables find
the libraries again, you have to relink them via
$ make clean-executables
$ make allexec
\section static_linking Statically linked executables
External libraries can be linked statically to the spectrum generator
executables by passing `--enable-static` to configure.
Example (using g++ on Debian Jessie):
$ ./configure --with-models=CMSSM --enable-static
If `--enable-static` is used, the following linker flags and additional
libraries will be used:
LDFLAGS = -static
LDLIBS = -ldl
These linker specific flags and additional libraries can be
overwritten using
--with-static-ldflags=
--with-static-ldlibs=
Example:
$ ./configure --with-models=CMSSM --enable-static --with-static-ldflags="-static" --with-static-ldlibs="-lquadmath -ldl"
In case of dynamic linking, the options
--with-shared-ldflags=
--with-shared-ldlibs=
must be used to set `LDFLAGS` and `LDLIBS`.
\section cleaning Cleaning up
There are several make targets to remove generated files, compiled
object files, libraries or executables:
make clean # deletes all .d .o .a .x files
make distclean # does `clean' and `clean-generated'
# and deletes in addition:
# Makefile flexiblesusy-config config.*
# config/list_sarah_model_files.sh
make clean-dep # deletes all .d files
make clean-executables # deletes all .x files
make clean-generated # deletes generated files
make clean-lib # deletes all libraries
make clean-obj # deletes all .o files
For each model `<model>` or addon there are specific clean targets to
remove model-specific files:
make clean-<model> # deletes .d .o .a .x and generated files
make distclean-<model> # same as `make clean-<model> clean-<model>-src'
make clean-<model>-dep # deletes .d files
make clean-<model>-lib # deletes model library
make clean-<model>-obj # deletes .o files
make clean-<model>-src # deletes generated files
\section looptools Looptools
It is possible to use Looptools (http://www.feynarts.de/looptools/)
for calculating the loop functions, instead of using Softsusy's loop
functions. To enable Looptools configure via
./configure --enable-looptools
To use the Looptools library and header files from a specific
directory configure via
./configure --enable-looptools --with-looptools-incdir="/path/to/looptools/build/" --with-looptools-libdir="/path/to/looptools/build/"
Note: Looptools 2.8 or higher is required. Versions <= 2.7 will fail
to build with the following compiler error message (or similar):
In file included from models/MSSM/MSSM_two_scale_model.cpp:28:0:
/usr/include/clooptools.h:67:28: error: conflicting declaration ‘typedef struct std::complex<double> Complex’
In file included from src/utils.h:15:0,
from src/rge.h:17,
from models/MSSM/MSSM_two_scale_soft_parameters.hpp:24,
from models/MSSM/MSSM_two_scale_model.hpp:25,
from models/MSSM/MSSM_two_scale_model.cpp:21:
src/mycomplex.h:17:7: error: ‘class Complex’ has a previous declaration as ‘class Complex’
*/