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