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