DOC: Fix etc/controlDict.in::parRunTemplate variables doc
[freefoam.git] / INSTALL
blobeac433d0a6b21930193c03961aa458f1d33459a5
1 {project} Installation Instructions for Version {fullver}
2 =========================================================
3 Michael Wild <themiwi@users.sourceforge.net>
4 :Author Initials: MW
5 v{fullver}, {localdate}
6 {homepage}
8 :apidoc: {homepage}/doc/v{fullver}/API
9 :asciidoc: http://www.methods.co.nz/asciidoc[Asciidoc]
10 :bash: http://www.gnu.org/software/bash/[BASH]
11 :cd-adapco: http://www.cd-adapco.com[CD-adapco]
12 :dblatex: http://dblatex.sourceforge.net[dblatex]
13 :debian: http://debian.org[Debian]
14 :dvipng: http://sourceforge.net/projects/dvipng[dvipng]
15 :emacs: http://www.gnu.org/software/emacs[Emacs]
16 :fop: http://xmlgraphics.apache.org/fop[Apache FOP]
17 :latex: http://www.latex-project.org[LaTeX]
18 :libccmio: https://wci.llnl.gov/codes/visit/3rd_party/libccmio-2.6.1.tar.gz
19 :linuxcommand: http://linuxcommand.org
20 :mathjax: http://www.mathjax.org[MathJax]
21 :metis: http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.0pre2.tar.gz
22 :mgridgen: http://www-users.cs.umn.edu/~moulitsa/download/ParMGridGen-1.0.tar.gz
23 :parmetis: http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/ParMetis-3.1.tar.gz
24 :scotch: http://master.dl.sourceforge.net/project/freefoam/ThirdParty/scotch/scotch_5.1.7.dfsg.orig.tar.gz
25 :tarball: http://master.dl.sourceforge.net/sourceforge/freefoam/freefoam-{fullver}.tar.bz2
26 :zlib: http://master.dl.sourceforge.net/project/freefoam/ThirdParty/zlib/zlib-1.2.5.tar.gz
27 :zsh: http://www.zsh.org/[ZSH]
29 Obtaining the Prerequisites
30 ---------------------------
31 Some of the libraries {project} requires (or optionally can use) are often not
32 readily available as an installable package and are quite tricky to install
33 manually. {project} can automatically download and build these libraries for
34 you, refer to below instructions. However, if you are behind a firewall or
35 CMake is unable to download a source package, you can do so manually and place
36 the files in the 'ThirdParty' directory in the {project} source tree. When you
37 run CMake, it will detect the presence of the files and not try to download
38 them.
40 You can obtain the source packages from the following URLs:
42 'zlib'::
43   {zlib}
44 'METIS'::
45   {metis}
46 'ParMetis'::
47   {parmetis}
48 'scotch'::
49   {scotch}
50 'MGRIDGEN'::
51   {mgridgen}
52 'libccmio'::
53   {libccmio}
55 [[installation]]
56 Building {project}
57 ------------------
58 - Install the prerequisites documented in the link:README.html[README] file. If
59   your distribution does not have 'METIS', 'ParMetis', 'MGRIDGEN' or 'libccmio'
60   be not worried, {project} can handle those for you.
61 - Download the {project} source and unpack it somewhere convenient. For the
62   further instructions we will use +$HOME/Source/+.
64 ---------------------------------------------------------------------------
65 $ mkdir -p $HOME/Source
66 $ cd $HOME/Source
67 $ wget {tarball}
68 $ tar xjf freefoam-{fullver}.tar.bz2
69 ---------------------------------------------------------------------------
70 - Create a build tree and _cd_ into it:
72 ---------------
73 $ mkdir $HOME/Source/freefoam-{fullver}-build
74 $ cd $HOME/Source/freefoam-{fullver}-build
75 ---------------
76 - Start CMake-configuration:
78 ---------------
79 $ ccmake $HOME/Source/freefoam-{fullver}
80 ---------------
81 - Press the +c+ key. Use the arrow keys to navigate up and down and press
82   +enter+ to edit a field. To commit the change, press +enter+ again, or +ESC+
83   to abandon the change. ON/OFF fields are toggled by pressing +enter+.
84   Advanced options can be displayed by hitting the +t+ key.
85   * Set +CMAKE_BUILD_TYPE+ to 'Release' for an optimized build.
86   * If CMake complains that it can't find MPI, and you don't want to install
87     it, disable +FOAM_USE_MPI+.
88   * Select the default Pstream implementation by setting +FOAM_DEFAULT_PSTREAM+
89     to one of 'dummy' or 'mpi'. This setting will only influence the contents
90     of the <<globalconfig,global 'controlDict' file>>.
91   * If you want to use the 'metis' and 'parmetis' decomposition methods, make
92     sure that +FOAM_ENABLE_METIS+ and +FOAM_ENABLE_PARMETIS+ are enabled,
93     respectively. If you do not have 'METIS' or 'ParMetis' installed, enable
94     +FOAM_BUILD_PRIVATE_METIS+ or +FOAM_BUILD_PRIVATE_PARMETIS+, respectively.
95     CMake will then try to download and build the selected libraries for you.
96     Conversely, if one of the libraries is provided by your system, you can
97     turn the respective setting to 'OFF'. Please note that if your system
98     provides only 'ParMetis', you do not have to install 'METIS', as the former
99     also contains 'METIS' in an older version.
100   * If you want to use the 'MGridGen' agglomeration method for the GAMG solver,
101     you need to enable +FOAM_ENABLE_MGRIDGEN+ and if the library is not
102     installed on your system ensure that +FOAM_BUILD_PRIVATE_MGRIDGEN+ is
103     enabled. See <<enable-mgridgen,above>> regarding the unknown license status
104     of this package.
105   * In order to build 'ccm26ToFoam', a conversion utility for grids generated
106     with 'ProStar/ccm' (C) version 2.6, enable the setting
107     +FOAM_ENABLE_CCMIO+ and if 'libccmio' is not installed on your system,
108     also +FOAM_BUILD_PRIVATE_CCMIO+. Refer to the <<enable-ccmio,above>>
109     description of the 'libccmio' package for the license restrictions which
110     apply to this package. If you decide to build a private version, please
111     read the description of <<private-ccmio,+FOAM_BUILD_PRIVATE_CCMIO>>
112     carefully.
113   * If you plan on installing {project}, set +CMAKE_INSTALL_PREFIX+ to the base
114     directory under which {project} should reside.
115   * For more fine-grained control over what gets installed where, adjust
116     +FOAM_INSTALL_CONFIG_PATH+, +FOAM_INSTALL_HEADER_PATH+,
117     +FOAM_INSTALL_LIBRARY_PATH+, +FOAM_INSTALL_FRAMEWORK_PATH+,
118     +FOAM_INSTALL_PVFOAMREADER_PATH+ and +FOAM_INSTALL_USERDFOAM_PATH+. Paths
119     not starting with a slash ('/') will be relative to 'CMAKE_INSTALL_PREFIX'.
120     If you include a leading slash, the paths are absolute.
121   * If you want {project} to use 'float' as the floating point type instead of
122     'double', change +FOAM_DOUBLE_PRECISION+ to 'OFF'.
123 - Hit +c+ again. You shouldn't get any errors anymore now. Keep pressing +c+
124   until ccmake displays "++Press [g] to generate and exit++" in the legend at
125   the bottom of the interface.
126 - Press +g+ to generate the Makefiles and exit the ccmake interface.
127 - Start the native build tool. If you used the 'Makefile' generator
128   (which is the default for Unix-platforms), type
130 ----------------
131 $ make
132 ----------------
133 - If you have a multi-core/processor machine, you can speed things up
134   significantly by telling Make to run independent jobs in parallel.
135   A good choice for the number of parallel jobs to run is the
136   number of CPU's/cores you have in your machine plus 1 (to compensate
137   for disk-latency). For a typical dual-core machine, run
139 ----------------
140 $ make -j3
141 ----------------
143 Installing {project}
144 --------------------
145 If you want to, you can now install {project}. Depending on the
146 +CMAKE_INSTALL_PREFIX+ and the individual +FOAM_INSTALL_*_PATH+ it is possible
147 that you have to do this as root, i.e. use +su+ or +sudo+.
148 ---------------
149 $ make install
150 ---------------
152 Using {project}
153 ---------------
154 If you didn't change +CMAKE_INSTALL_PREFIX+ and +FOAM_INSTALL_BIN_PATH+ chances
155 are that you can start using {project} right after you installed it without any
156 further steps being necessary.
158 [[globalconfig]]
159 Global Configuration Files
160 ~~~~~~~~~~~~~~~~~~~~~~~~~~
161 Unfortunately the OpenFOAM library (on which {project} builds) and some
162 applications require some files to be present for start-up. It finds those
163 in the following places (in the specified order, picking the first hit):
165 1. Under the directory specified in the +$FREEFOAM_CONFIG_DIR+ environment
166    variable
167 2. In '$HOME/.{project}/{shortver}'
168 3. In '$HOME/.{project}'
169 4. In the installation directory of the configuration files. There are
170    two possible places for this:
172    '<CMAKE_INSTALL_PREFIX>/<FOAM_INSTALL_CONFIG_PATH>':: if you specified
173      +<FOAM_INSTALL_CONFIG_PATH>+ as a relative path.
174    '<FOAM_INSTALL_CONFIG_PATH>':: if you specified +<FOAM_INSTALL_CONFIG_PATH>+
175      as an absolute path.
177 The default location is '/usr/local/etc/{project}-{ver}'.
179 Selecting the Parallel Communications Library
180 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
181 Both, {project} and OpenFOAM abstract the parallel operations into the
182 'Pstream' library, making it rather simple to firstly switch between parallel
183 implementations and secondly port the software to a new communications library.
184 However, {project} uses a much more flexible mechanism of determining which
185 'Pstream' implementation library to use than OpenFOAM. The latter does this by
186 adjusting the +LD_LIBRARY_PATH+ environment variable. As {project} wants to be
187 a well behaved Linux citizen, this is not an option. Instead, {project}
188 dynamically loads the desired 'Pstream' library at startup (i.e. as a plug-in).
189 The following list details how {project} determines what library to load (if at
190 all):
192 1. If the environment variable +FREEFOAM_PSTREAM_LIBRARY+ is set,
193    {project} will try to load the library specified by it.
194 2. If the sub-dictionary +PstreamImplementation+ exists in the global
195    'controlDict' file (see <<globalconfig,'Global Configuration Files'>>), it
196    reads the value of the entry +configName+ therein. It then expects that a
197    sub-dictionary of +PstreamImplementation+ with the name specified in
198    +configName+ exists. If that sub-dictionary contains the entry +library+, it
199    will try to load a library specified by the value of that entry.
201 After {project} (possibly) loaded the library, it will try to instantiate
202 concrete implementations of the abstract base classes +PstreamImpl+,
203 +IPstreamImpl+ and +OPstreamImpl+. Which classes are to be instantiated
204 is determined as follows:
206 1. {project} queries the environment variables +FREEFOAM_PSTREAM_CLASS+,
207    +FREEFOAM_IPSTREAM_CLASS+ and +FREEFOAM_OPSTREAM_CLASS+ for the class
208    names to be instantiated.
209 2. For any of the variables not set,  it requires the sub-dictionary
210    +PstreamImplementation+ to be present in the global 'controlDict', reads the
211    value of +configName+ and similarly to the library loading, loads the
212    sub-dictionary specified by that value. It then expects to find the entries
213    +Pstream+, +IPstream+ and +OPstream+ which specify the names of the classes
214    to load.
216 This means that one can create a global 'controlDict' file containing
217 (among other things) something like the following:
218 =========
219 ---------
220 PstreamImplementation
222     //configName dummy;
223     configName mpi;
225     dummy
226     {
227         library libdummyPstream.so;
228         Pstream dummyPstreamImpl;
229         OPstream dummyOPstreamImpl;
230         IPstream dummyIPstreamImpl;
231     }
233     mpi
234     {
235         library libmpiPstream.so;
236         Pstream mpiPstreamImpl;
237         OPstream mpiOPstreamImpl;
238         IPstream mpiIPstreamImpl;
239     }
241 ---------
242 =========
244 This way the administrator can provide a global 'controlDict' in the {project}
245 installation. Every user can then override that 'controlDict' by supplying her
246 own file in her home directory as detailed in <<globalconfig,'Global
247 Configuration Files'>>. In order to select a particular 'Pstream'
248 implementation for a specific communications library, the user can then either
249 adjust the +PstreamImplementation::configName+ entry in the global
250 'controlDict' file, set the +FREEFOAM_PSTREAM_CONFIG+ variable or for full
251 control, set the variables +FREEFOAM_PSTREAM_LIBRARY+,
252 +FREEFOAM_PSTREAM_CLASS+, +FREEFOAM_IPSTREAM_CLASS+ and
253 +FREEFOAM_OPSTREAM_CLASS+.
255 Running {project} From the Build Tree
256 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
257 You can use {project} without installing it first, directly from the build
258 tree. However, this might take a little bit more effort to set up because most
259 likely you will have to adjust the following environment variables:
261 `PATH`::
262   Must contain '$HOME/Source/freefoam-{fullver}-build/bin'
263 `LD_LIBRARY_PATH`::
264   Must contain '$HOME/Source/freefoam-{fullver}-build/lib/{project}-{ver}'
265 `FREEFOAM_CONFIG_DIR`::
266  Should point to '$HOME/Source/freefoam-{fullver}-build/etc'
268 Where it is assumed that you followed the <<installation,installation
269 instructions>>. If you used different paths for downloading and compiling
270 {project}, you will have to adjust these names. Refer to
271 <<environment,'Extending Search Paths And Setting Environment Variables
272 Permanently'>> if you need help setting these variables.
274 Running the tutorials
275 ---------------------
276 Now you should be able to run the tutorial cases. For this copy the +tutorials+
277 directory to some convenient place:
278 ---------------
279 $ mkdir -p $HOME/{project}/$LOGNAME-{shortver}/run
280 $ cp -r $HOME/Source/freefoam-{fullver}-build/tutorials \
281   $HOME/{project}/$LOGNAME-{shortver}/run/
282 $ cd $HOME/{project}/$LOGNAME-{shortver}/run/tutorials
283 ---------------
284 And try to run e.g. the 'cavity' tutorial case:
285 ---------------
286 $ cd icoFoam
287 $ freefoam blockMesh -case cavity
288 $ freefoam checkMesh -case cavity
289 $ freefoam ico -case cavity
290 ---------------
291 Things should run smoothly and finish without an error.
293 All the tutorials contain a script for automatic execution since some of the
294 cases are quite intricate and it is not obvious how to run them. Also, these
295 scripts are used for automated testing. The scripts are called 'Allrun', where
296 the one located in the 'tutorials' directory is a driver script to run all the
297 other tutorials.
299 Obtaining the Source Code from the GIT repository
300 -------------------------------------------------
301 - Clone the {project} repository (here the clone is placed in
302   +$HOME/Source/{project}+):
304 ---------------------------------------------------------------------------
305 $ mkdir -p $HOME/Source
306 $ git clone git://repo.or.cz/freefoam.git $HOME/Source/{project}
307 ---------------------------------------------------------------------------
308 - Proceed in the same way (replacing the path names appropriately) as in the
309   above build instructions.
311 Shell completion scripts
312 ------------------------
313 {project} comes with completions scripts for the {bash} and {zsh} shells. The
314 former is quite simplistic and only offers very basic completion of the
315 available application names. The ZSH completion, however, is quite complete and
316 also completes options and arguments for all applications. These completion
317 functions are not installed by +make install+, because no two systems have the
318 same locations for these kinds of scripts. You find them for manual
319 installation in the {project} sources in the directory
320 'data/shellFunctions/bashCompletion' and 'data/shellFunctions/zshCompletion'
321 respectively. Please refer to the documentation of your system/shell on where
322 to place them.
324 Emacs mode
325 ----------
326 {project} includes a rudimentary major mode for the {emacs} programming editor.
327 If you want to use this mode, place the file
328 'data/editor-modes/foamdict-mode.el' in a directory where your Emacs
329 installation finds it. Please refer to the Emacs documentation for further
330 instructions.
332 Build Configuration Reference
333 -----------------------------
334 All installation paths below, if not absolute, are relative to
335 'CMAKE_INSTALL_PREFIX'.
337 ///////////////////////////
338 KEEP ALPHABETICALLY SORTED!
339 ///////////////////////////
341 [glossary]
342 +CMAKE_BUILD_TYPE+::
343   One of '<empty>', 'Debug', 'Release', 'RelWithDebInfo' and 'MinSizeRel'.
344   Refer to the CMake documentation for more detail.
345 +CMAKE_INSTALL_PREFIX+::
346   Installation prefix under which to install {project}.
347 +FOAM_DOUBLE_PRECISION+::
348   If set to 'ON' {project} will be compiled using 'double' as the
349   floating point type. If set to 'OFF' it will use 'float'.
350 +FOAM_BUILD_FRAMEWORKS+::
351   If this is enabled, the libraries are built as frameworks. Only available on
352   Mac OS X.
353 +FOAM_BUILD_PRIVATE_CCMIO+::
354   [[private-ccmio]]
355   Automatically download and build libccmio. Unfortunately this process may
356   fail in the download step if CMake cannot find either 'wget' or 'curl' on
357   your system, since CMake itself currently does not support 'https' URLs. If
358   this happens, the build process will abort. To fix the issue, Download the
359   file {libccmio} manually and place it in +ThirdParty/ccmio/src+ (relative to
360   the build directory). It is important that you re-run CMake *before*
361   restarting the build in order to notify the build system that the file is now
362   there.
363 +FOAM_BUILD_PRIVATE_METIS+::
364   Automatically download and build 'METIS'.
365 +FOAM_BUILD_PRIVATE_MGRIDGEN+::
366   Automatically download and build 'MGRIDGEN'.
367 +FOAM_BUILD_PRIVATE_PARMETIS+::
368   Automatically download and build 'ParMetis'.
369 +FOAM_DEFAULT_PSTREAM+::
370   The default Pstream selection in the global 'controlDict' file.
371 +FOAM_DOXYDOCS_FOR_SF+::
372   This setting is for the maintainers of the {project} and indicates whether
373   the Doxygen documentation should be built for deployment on {homepage}
374 [[enable-ccmio]]
375 +FOAM_ENABLE_CCMIO+::
376   Enable the use of 'libccmio'. This is required to build the grid conversion
377   utility 'ccm26ToFoam'.
379 [WARNING]
380 The license of 'libccmio' (C) is proprietary and requires the consent of the
381 copyright holders ({cd-adapco}) to download and use the
382 library. Further it is not allowed to redistribute it in any form. The request
383 for permission of inclusion with {debian} was answered as
384 follows by mailto:geoffrey.prewett@us.cd-adapco.com[Geoffrey Prewett]:
386 -------------------------------------------------------------------------------
387 Gerber,
389 Sorry for the delay in response.  I checked back with our development director,
390 and he felt that it would be best to not include libccmio with Debian.
391 Instead, we would prefer to continue our current policy and keep it on our
392 web/FTP and have people ask for it.  There are three reasons for this:
394 1) We don't support STAR on Debian, and don't want to give the impression that
395    we do.
396 2) We would like to keep a list of people that we give the library to.
397 3) This is not a general purpose library;  its sole purpose is to communicate
398 between our products.  Accepting outside changes risks committing a change that
399 would break our own software in possibly subtle ways.
401 So I regret to tell you that my company has declined to permit libccmio to be
402 distributed as part of Debian.
404 Regards,
405 Geoff Prewett
406 -------------------------------------------------------------------------------
408 +FOAM_ENABLE_DOXYGEN_DOCS+::
409   Enable building of the 'Doxygen API documentation'. The documentation will
410   only be built once and is not updated automatically. This is because it
411   depends on a huge number of files and would make dependency tracking very
412   slow and difficult to maintain. To force the re-generation of the API
413   documentation execute +make apidoc+.
414 +FOAM_ENABLE_METIS+::
415   Enable the use of the 'METIS' graph partitioning library which is required to
416   implement the 'metis' decomposition method.
417 [[enable-mgridgen]]
418 +FOAM_ENABLE_MGRIDGEN+::
419   Enable the use of 'MGRIDGEN' which is required to build
420   'MGridGenGamgAgglomeration' providing the 'MGridGen' agglomeration method for
421   the GAMG solver.
423 [WARNING]
424 The license of 'MGRIDGEN' is unknown and the upstream authors so far have not
425 answered any inquiries to resolve the issue. If you enable the use of
426 'MGRIDGEN' you alone are responsible for ensuring that you don't violate any
427 license conditions applying to these libraries. The authors of {project} will
428 and cannot take any responsibility for your actions.
430 +FOAM_ENABLE_MANPAGE_HELP+::
431   [[foam_enable_manpage_help]]
432   Build (and install) the help-pages in manpage format. This requires a
433   complete {asciidoc} toolchain to be present.
434 +FOAM_ENABLE_PARMETIS+::
435   Enable the use of the 'ParMetis' graph partitioning library which is required
436   to implement the 'parMetis' decomposition method.
437 +FOAM_ENABLE_PDF_GUIDES+::
438   Build a PDF version of the user guide. In addition to a complete {asciidoc}
439   toolchain, this requires either {dblatex} (for better results) or {fop} to be
440   installed. If FOP is used, {latex} and {dvipng} are required.
441 +FOAM_ENABLE_XHTML_GUIDES+::
442   Build a XHTML version of the user guide. This requires a complete {asciidoc}
443   toolchain. If +FOAM_ENABLE_MATHJAX+ is disabled, this also requires {latex}
444   and {dvipng} to be available.
445 +FOAM_ENABLE_XHTML_HELP+::
446   Build (and install) the help-pages in XHTML format for the display in a web
447   browser. The requirements are the same as for
448   <<foam_enable_manpage_help,+FOAM_ENABLE_MANPAGE_HELP+>>.
449 +FOAM_EXE_PREFIX+::
450   Prefix used to mangle application names. Normally this shouldn't be changed.
451 +FOAM_ENABLE_FULL_TUTORIAL_TESTS+::
452   Run the full tutorials as tests, don't limit their run-time to a single time
453   step.
454 +FOAM_INSTALL_BIN_PATH+::
455   Installation path of the binaries.
456 +FOAM_INSTALL_CMAKE_PATH+::
457   Installation path of the CMake development files.
458 +FOAM_INSTALL_CONFIG_PATH+::
459   Installation path of the configuration files.
460 +FOAM_INSTALL_DATA_PATH+::
461   Installation path of the architecture-independent files.
462 +FOAM_INSTALL_DOC_PATH+::
463   Installation path of the documentation files.
464 +FOAM_INSTALL_FRAMEWORK_PATH+::
465   Installation path of the Mac OS X frameworks. This is only available and
466   takes effect if {project} is compiled on Mac OS X, and if
467   'FOAM_BUILD_FRAMEWORKS' is enabled.
468 +FOAM_INSTALL_HEADER_PATH+::
469   Installation path of the header files. On Mac OS X, and if
470   'FOAM_BUILD_FRAMEWORKS' is enabled, this setting is ignored.
471 +FOAM_INSTALL_LIBEXEC_PATH+::
472   Installation path of the binaries which should not be on the +PATH+.
473 +FOAM_INSTALL_LIBRARY_PATH+::
474   Installation path of the libraries.
475 +FOAM_INSTALL_MAN_PATH+::
476   Installation path of the manpage files.
477 +FOAM_ENABLE_MATHJAX+::
478   When 'FOAM_ENABLE_XHTML_GUIDES' is enabled, use {mathjax} for the math
479   rendering.
480 +FOAM_INSTALL_PLUGIN_PATH+::
481   Installation base-path of plugins.
482 +FOAM_INSTALL_PYTHON_PATH+::
483   Installation path for Python modules.
484 +FOAM_INSTALL_USERDFOAM_PATH+::
485   Installation path of the Ensight plug-in.
486 +FOAM_INSTALL_TUTORIALS_PATH+::
487   Installation path of the tutorials.
488 +FOAM_USE_FOP+::
489   Use {fop} instead of {dblatex} when building the PDF of the user guide.
490 +FOAM_USE_MPI+::
491   If enabled, {project} will use the MPI parallel communications library.
492   This is required in order to build some of the libraries and utilities.
493 +FOAM_USE_LOCAL_DOXYGEN_DOCS+::
494   This setting influences the location in which the Doxygen source
495   code documentation is looked for if any of the {project} applications
496   is invoked with the '-doc' or '-srcDoc' options. If it is disabled,
497   the documentation will be loaded over the network from
498   {apidoc}. If you enable it, the
499   documentation will be loaded locally. This requires that you either
500   build and install the documentation by enabling +FOAM_ENABLE_DOXYGEN_DOCS+,
501   or provide the required HTML files otherwise.
502 +HTML_DOC_BROWSER+::
503   This is the program used to display the Doxygen source code documentation
504   if any of the {project} applications is invoked with the '-doc' or '-srcDoc'
505   options. The special value of 'ECHO' changes the behaviour to just write
506   the location of the HTML file to the output. This is a good setting if
507   you're system doesn't have any kind of HTML browser installed (such
508   as on a cluster).
509 +FOAM_HTML_DOC_BROWSER_COMMAND+::
510   This is the command with which to invoke the HTML browser. By default
511   it calls the program named in +HTML_DOC_BROWSER+ and passes it the
512   name/URL of the documentation file to be displayed. You shouldn't
513   have to change this unless your HTML browser requires some unusual
514   options or arguments.
516 Troubleshooting
517 ---------------
519 The {project} Executables Are Not Found By The Shell
520 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
521 There are three possible reasons for this:
523 1. Your shell (notably 'csh', 'tcsh' and 'zsh') requires you to refresh the
524    cache of available executables. You can do so by entering the command:
526 --------------
527 $ rehash
528 --------------
530 2. If 'rehashing' didn't solve the problem, the problem most likely is that you
531    installed {project} into a non-standard location by changing the
532    configuration variables +CMAKE_INSTALL_PREFIX+ or +FOAM_INSTALL_BIN_PATH+ in
533    which case the executables where installed into a directory not searched by
534    the shell. In this case you have to add the installation directory of the
535    executables to the +PATH+ variable. There are two possible locations:
538 '<CMAKE_INSTALL_PREFIX>/<FOAM_INSTALL_BIN_PATH>':: if you specified
539   +FOAM_INSTALL_BIN_PATH+ as a relative path
540 '<FOAM_INSTALL_BIN_PATH>':: if you specified +FOAM_INSTALL_BIN_PATH+ as an
541   absolute path
544 After extending the +PATH+ variable with the installation directory of the
545 executables, you should be able to run all {project} applications as any other
546 binary available on the system. See <<environment,'Extending Search Paths And
547 Setting Environment Variables Permanently'>> for
548 instructions on how to extend the search path.
550 3. This option is similar to the previous solution and applies if you want to
551    run {project} from the build tree (i.e. without running +make install+). In
552    this case you again have to make sure that your shell finds the executables
553    built by CMake by extending the +PATH+ variable. Further, you have to tell
554    {project} where to find the global configuration files (see
555    <<globalconfig,'Global Configuration Files'>>). Here, you have the option to
556    place the files under your home directory or set an environment variable.
557    The former can be achieved by:
559 --------------
560 $ mkdir -p $HOME/.{project}/{shortver}
561 $ cp $HOME/Source/freefoam-{fullver}-build/etc/controlDict \
562     $HOME/.{project}/{shortver}
563 $ cp $HOME/Source/freefoam-{fullver}-build/etc/cellModels \
564     $HOME/.{project}/{shortver}
565 $ cp -r $HOME/Source/freefoam-{fullver}-build/etc/thermoData \
566     $HOME/.{project}/{shortver}
567 --------------
569 The latter (and recommended) method is to set the environment variable
570 +FREEFOAM_CONFIG_DIR+ to '$HOME/Source/freefoam-{fullver}-build/etc'. Adjust
571 the paths to match the build tree to your actual setup.
573 Starting Any {project} Application Fails Because Some Libraries Cannot Be Found
574 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
575 Although CMake should have taken care of this by using +RPATH+ on Linux and
576 +install_name+ on Mac OS X, it might be necessary on some systems to adjust the
577 library search paths:
579 +LD_LIBRARY_PATH+:: This variable is used by all Unix like systems (e.g. Linux,
580   Mac OS X, etc.)
581 +DYLD_LIBRARY_PATH+:: This variable is used by Mac OS X.
583 If you installed {project}, there are (as with the executables), two possible
584 installation directories:
586 '<CMAKE_INSTALL_PREFIX>/<FOAM_INSTALL_LIBRARY_PATH>':: if you specified
587   +FOAM_INSTALL_LIBRARY_PATH+ as a relative path.
588 '<FOAM_INSTALL_LIBRARY_PATH>':: if you specified +FOAM_INSTALL_LIBRARY_PATH+ as
589   an absolute path.
591 If you are trying to run from the build tree, you have to include
592 '$HOME/Source/freefoam-{fullver}-build/lib/{project}-{ver}' in the above
593 mentioned search paths (where you have to adjust the location of the build tree
594 to your actual setup).
596 A Running {project} Application Aborts Because It Can't 'dlopen' A Library
597 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
598 {project} (and OpenFOAM) often dynamically load libraries at run-time (a.k.a
599 plug-ins) to add features the user requested without requiring that the whole
600 application be recompiled. This makes it very simple to add new boundary
601 conditions, turbulence and combustion models etc. However, it also requires
602 that {project} must be able to find these libraries at run-time. The operating
603 system function which does the loading of the libraries ('dlopen') usually
604 tries to find the library with the given name in several places; namely a
605 default search path and a search path configured by one or multiple environment
606 variables such as +LD_LIBRARY_PATH+ or +DYLD_LIBRARY_PATH+ (on Mac OS X). The
607 details vary from platform to platform, so you best consult the documentation
608 of 'dlopen' for the details.
610 Additionally {project} allows you to configure a custom search path for
611 plug-ins in the <<globalconfig,global 'controlDict'>> file by listing the
612 directories to be searched in the list +LibrarySearchPaths+. By default
613 {project} is configured to search for plug-ins in the location where CMake
614 installed them.
616 If you want to add your own plug-in libraries (e.g. you want to add your own
617 boundary conditions class), you most probably will want to extend this search
618 path.
620 {project} Aborts When Trying To Instantiate a Plugin Class
621 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
622 If you get a warning message similar to the following
624  --> FOAM Warning :
625      From function dlLibraryTable::open(const dictionary& dict, const word& libsEntry, const TablePtr tablePtr)
626      in file XXX/src/OpenFOAM/db/dlLibraryTable/dlLibraryTableTemplates.C at line 68
627      library "libfieldFunctionObjects.so" did not introduce any new entries
629 (where +XXX+ is the path to the {project} source code and the actual library
630 name can be different), followed by a fatal error stating that {project} does
631 not know a class or type, e.g.
633  --> FOAM FATAL ERROR:
634  Unknown function type fieldAverage
636  Table of functionObjects is empty
639      From function functionObject::New(const word& name, const Time&, const dictionary&)
640      in file XXX/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C at line 74.
642  FOAM exiting
644 and you are absolutely sure that the named type actually exists in the library
645 mentioned in the preceding warning message, the issue is very likely that
646 {project} is loading the plugin library from a different binary tree than the
647 executable belongs to.
649 [IMPORTANT]
650 Always make sure that you never load plugins from different binary trees (where
651 the build tree and the install tree count as such). If you want to run a binary
652 from the build tree but already have a corresponding installation tree, use the
653 +FREEFOAM_CONFIG_DIR+ environment variable to point {project} to the directory
654 '<path to build tree>/etc/' containing the global 'controlDict' file in the
655 **build tree**. Otherwise the binaries are likely to be incompatible with each
656 other.
658 [[environment]]
659 Extending Search Paths And Setting Environment Variables Permanently
660 --------------------------------------------------------------------
661 The way one sets environment variables and extends the executable and library
662 search paths permanently strongly depends on the shell used. Usually one has to
663 create or change an initialization file in the users home directory. In the
664 following this will be discussed very briefly for the popular shells 'BASH' and
665 'tcsh'. However, if you need more help or want information on using the shell,
666 there is an excellent tutorial available at {linuxcommand}.
668 BASH
669 ~~~~
670 The BASH shell is the default shell for most Linux/Unix distributions. Most
671 systems configure the BASH shell such that it reads the text file
672 '$HOME/.bashrc' when starting up, so this is the place where one appends
673 customizations of the environment variables. On some systems this file is not
674 processed by default (notably Mac OS X). In this case you can use
675 '$HOME/.bash_profile'.
677 Referencing A Variable
678 ^^^^^^^^^^^^^^^^^^^^^^
679 To retrieve the value stored in a shell variable or environment variable, one
680 prefixes its name with the dollar (+$+) character.
682 Setting A Variable
683 ^^^^^^^^^^^^^^^^^^
684 The syntax for setting a variable and making it available to child-processes of
685 the shell is the following:
686 -------
687 $ export variable_name=variable_value
688 -------
689 Note that no white-space characters are allowed surrounding the +=+ sign.
691 Extending A Search Path
692 ^^^^^^^^^^^^^^^^^^^^^^^
693 The shell and other Unix system facilities use environment variables to locate
694 executables and dynamically linked libraries. These search paths consist of
695 strings naming directories in which the executables and libraries should be
696 searched for. The individual paths are separated by a colon (+:+) character. To
697 add the e.g. the directory '$HOME/bin' to the search path for executables, one
698 would do the following:
699 -------
700 $ export PATH=$PATH:$HOME/bin
701 -------
702 which appends '$HOME/bin' to the end of the +PATH+ variable.
704 TCSH
705 ~~~~
706 Some users and administrators prefer to use a 'C-Shell', such as the TCSH. Here
707 you can use e.g. the file '$HOME/.tcshrc' to customize the environment.
709 Referencing A Variable
710 ^^^^^^^^^^^^^^^^^^^^^^
711 As with the BASH, one retrieves the value stored in a shell variable or
712 environment variable by prefixing its name with the dollar (+$+) character.
713 Sometimes it is also necessary to protect the variable name by surrounding it
714 with curly braces (+{+ and +}+).
716 Setting A Variable
717 ^^^^^^^^^^^^^^^^^^
718 The syntax for setting a variable and making it available to child-processes of
719 the shell is the following:
720 -------
721 $ setenv variable_name variable_value
722 -------
724 Extending A Search Path
725 ^^^^^^^^^^^^^^^^^^^^^^^
726 The shell and other Unix system facilities use environment variables to locate
727 executables and dynamically linked libraries. These search paths consist of
728 strings naming directories in which the executables and libraries should be
729 searched for. The individual paths are separated by a colon (+:+) character. To
730 add the e.g. the directory '$HOME/bin' to the search path for executables, one
731 would do the following:
732 [subs="verbatim"]
733 -------
734 $ setenv PATH ${PATH}:${HOME}/bin
735 -------
736 which appends '$HOME/bin' to the end of the +PATH+ variable. Note that
737 'C-shells' usually require the user to type 'rehash' after changing the +PATH+
738 variable to update the cache of available programs.
740 ////////////////////////////////////////////////////////////////////
741 Process with: asciidoc -a toc -f data/asciidoc/html.conf INSTALL
743 Vim users, this is for you:
744 vim: ft=asciidoc sw=2 expandtab fenc=utf-8
745 ////////////////////////////////////////////////////////////////////