1 {project} Installation Instructions for Version {fullver}
2 =========================================================
3 Michael Wild <themiwi@users.sourceforge.net>
5 v{fullver}, {localdate}
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: http://freefoam.sf.net/nonfree/libccmio-2.6.1.tar.gz
19 :linuxcommand: http://linuxcommand.org
20 :mathjax: http://www.mathjax.org[MathJax]
21 :metis: http://freefoam.sf.net/nonfree/metis-5.0.1.tar.gz
22 :mgridgen: http://freefoam.sf.net/nonfree/ParMGridGen-1.0.tar.gz
23 :parmetis: http://freefoam.sf.net/nonfree/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
40 You can obtain the source packages from the following URLs:
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
68 $ tar xjf freefoam-{fullver}.tar.bz2
69 ---------------------------------------------------------------------------
70 - Create a build tree and _cd_ into it:
73 $ mkdir $HOME/Source/freefoam-{fullver}-build
74 $ cd $HOME/Source/freefoam-{fullver}-build
76 - Start CMake-configuration:
79 $ ccmake $HOME/Source/freefoam-{fullver}
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
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>>
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
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
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+.
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.
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
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>+
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
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
216 This means that one can create a global 'controlDict' file containing
217 (among other things) something like the following:
220 PstreamImplementation
227 library libdummyPstream.so;
228 Pstream dummyPstreamImpl;
229 OPstream dummyOPstreamImpl;
230 IPstream dummyIPstreamImpl;
235 library libmpiPstream.so;
236 Pstream mpiPstreamImpl;
237 OPstream mpiOPstreamImpl;
238 IPstream mpiIPstreamImpl;
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:
262 Must contain '$HOME/Source/freefoam-{fullver}-build/bin'
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:
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
284 And try to run e.g. the 'cavity' tutorial case:
286 $ cd incompressible/icoFoam
287 $ freefoam blockMesh -case cavity
288 $ freefoam checkMesh -case cavity
289 $ freefoam ico -case cavity
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
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
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
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 ///////////////////////////
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
353 +FOAM_BUILD_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
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_BUILD_PRIVATE_ZLIB+::
370 Automatically download and build the 'ZLIB' compression library.
371 +FOAM_DEFAULT_PSTREAM+::
372 The default Pstream selection in the global 'controlDict' file.
373 +FOAM_DOXYDOCS_FOR_SF+::
374 This setting is for the maintainers of the {project} and indicates whether
375 the Doxygen documentation should be built for deployment on {homepage}
377 +FOAM_ENABLE_CCMIO+::
378 Enable the use of 'libccmio'. This is required to build the grid conversion
379 utility 'ccm26ToFoam'.
382 The license of 'libccmio' (C) is proprietary and requires the consent of the
383 copyright holders ({cd-adapco}) to download and use the
384 library. Further it is not allowed to redistribute it in any form. The request
385 for permission of inclusion with {debian} was answered as
386 follows by mailto:geoffrey.prewett@us.cd-adapco.com[Geoffrey Prewett]:
388 -------------------------------------------------------------------------------
391 Sorry for the delay in response. I checked back with our development director,
392 and he felt that it would be best to not include libccmio with Debian.
393 Instead, we would prefer to continue our current policy and keep it on our
394 web/FTP and have people ask for it. There are three reasons for this:
396 1) We don't support STAR on Debian, and don't want to give the impression that
398 2) We would like to keep a list of people that we give the library to.
399 3) This is not a general purpose library; its sole purpose is to communicate
400 between our products. Accepting outside changes risks committing a change that
401 would break our own software in possibly subtle ways.
403 So I regret to tell you that my company has declined to permit libccmio to be
404 distributed as part of Debian.
408 -------------------------------------------------------------------------------
410 +FOAM_ENABLE_DOXYGEN_DOCS+::
411 Enable building of the 'Doxygen API documentation'. The documentation will
412 only be built once and is not updated automatically. This is because it
413 depends on a huge number of files and would make dependency tracking very
414 slow and difficult to maintain. To force the re-generation of the API
415 documentation execute +make apidoc+.
416 +FOAM_ENABLE_METIS+::
417 Enable the use of the 'METIS' graph partitioning library which is required to
418 implement the 'metis' decomposition method.
420 +FOAM_ENABLE_MGRIDGEN+::
421 Enable the use of 'MGRIDGEN' which is required to build
422 'MGridGenGamgAgglomeration' providing the 'MGridGen' agglomeration method for
426 The license of 'MGRIDGEN' is unknown and the upstream authors so far have not
427 answered any inquiries to resolve the issue. If you enable the use of
428 'MGRIDGEN' you alone are responsible for ensuring that you don't violate any
429 license conditions applying to these libraries. The authors of {project} will
430 and cannot take any responsibility for your actions.
432 +FOAM_ENABLE_MANPAGE_HELP+::
433 [[foam_enable_manpage_help]]
434 Build (and install) the help-pages in manpage format. This requires a
435 complete {asciidoc} toolchain to be present.
436 +FOAM_ENABLE_MATHJAX+::
437 When 'FOAM_ENABLE_XHTML_GUIDES' is enabled, use {mathjax} for the math
439 +FOAM_ENABLE_PARMETIS+::
440 Enable the use of the 'ParMetis' graph partitioning library which is required
441 to implement the 'parMetis' decomposition method.
442 +FOAM_ENABLE_PDF_GUIDES+::
443 Build a PDF version of the user guide. In addition to a complete {asciidoc}
444 toolchain, this requires either {dblatex} (for better results) or {fop} to be
445 installed. If FOP is used, {latex} and {dvipng} are required.
446 +FOAM_ENABLE_XHTML_GUIDES+::
447 Build a XHTML version of the user guide. This requires a complete {asciidoc}
448 toolchain. If +FOAM_ENABLE_MATHJAX+ is disabled, this also requires {latex}
449 and {dvipng} to be available.
450 +FOAM_ENABLE_XHTML_HELP+::
451 Build (and install) the help-pages in XHTML format for the display in a web
452 browser. The requirements are the same as for
453 <<foam_enable_manpage_help,+FOAM_ENABLE_MANPAGE_HELP+>>.
455 Prefix used to mangle application names. Normally this shouldn't be changed.
456 +FOAM_ENABLE_FULL_TUTORIAL_TESTS+::
457 Run the full tutorials as tests, don't limit their run-time to a single time
459 +FOAM_INSTALL_BIN_PATH+::
460 Installation path of the binaries.
461 +FOAM_INSTALL_CMAKE_PATH+::
462 Installation path of the CMake development files.
463 +FOAM_INSTALL_CONFIG_PATH+::
464 Installation path of the configuration files.
465 +FOAM_INSTALL_DATA_PATH+::
466 Installation path of the architecture-independent files.
467 +FOAM_INSTALL_DOC_PATH+::
468 Installation path of the documentation files.
469 +FOAM_INSTALL_FRAMEWORK_PATH+::
470 Installation path of the Mac OS X frameworks. This is only available and
471 takes effect if {project} is compiled on Mac OS X, and if
472 'FOAM_BUILD_FRAMEWORKS' is enabled.
473 +FOAM_INSTALL_HEADER_PATH+::
474 Installation path of the header files. On Mac OS X, and if
475 'FOAM_BUILD_FRAMEWORKS' is enabled, this setting is ignored.
476 +FOAM_INSTALL_LIBEXEC_PATH+::
477 Installation path of the binaries which should not be on the +PATH+.
478 +FOAM_INSTALL_LIBRARY_PATH+::
479 Installation path of the libraries.
480 +FOAM_INSTALL_MAN_PATH+::
481 Installation path of the manpage files.
482 +FOAM_INSTALL_PLUGIN_PATH+::
483 Installation base-path of plugins.
484 +FOAM_INSTALL_PYTHON_PATH+::
485 Installation path for Python modules.
486 +FOAM_INSTALL_USERDFOAM_PATH+::
487 Installation path of the Ensight plug-in.
488 +FOAM_INSTALL_TUTORIALS_PATH+::
489 Installation path of the tutorials.
491 Use {fop} instead of {dblatex} when building the PDF of the user guide.
493 If enabled, {project} will use the MPI parallel communications library.
494 This is required in order to build some of the libraries and utilities.
495 +FOAM_USE_LOCAL_DOXYGEN_DOCS+::
496 This setting influences the location in which the Doxygen source
497 code documentation is looked for if any of the {project} applications
498 is invoked with the '-doc' or '-srcDoc' options. If it is disabled,
499 the documentation will be loaded over the network from
500 {apidoc}. If you enable it, the
501 documentation will be loaded locally. This requires that you either
502 build and install the documentation by enabling +FOAM_ENABLE_DOXYGEN_DOCS+,
503 or provide the required HTML files otherwise.
505 This is the program used to display the Doxygen source code documentation
506 if any of the {project} applications is invoked with the '-doc' or '-srcDoc'
507 options. The special value of 'ECHO' changes the behaviour to just write
508 the location of the HTML file to the output. This is a good setting if
509 you're system doesn't have any kind of HTML browser installed (such
511 +FOAM_HTML_DOC_BROWSER_COMMAND+::
512 This is the command with which to invoke the HTML browser. By default
513 it calls the program named in +HTML_DOC_BROWSER+ and passes it the
514 name/URL of the documentation file to be displayed. You shouldn't
515 have to change this unless your HTML browser requires some unusual
516 options or arguments.
521 The {project} Executables Are Not Found By The Shell
522 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
523 There are three possible reasons for this:
525 1. Your shell (notably 'csh', 'tcsh' and 'zsh') requires you to refresh the
526 cache of available executables. You can do so by entering the command:
532 2. If 'rehashing' didn't solve the problem, the problem most likely is that you
533 installed {project} into a non-standard location by changing the
534 configuration variables +CMAKE_INSTALL_PREFIX+ or +FOAM_INSTALL_BIN_PATH+ in
535 which case the executables where installed into a directory not searched by
536 the shell. In this case you have to add the installation directory of the
537 executables to the +PATH+ variable. There are two possible locations:
540 '<CMAKE_INSTALL_PREFIX>/<FOAM_INSTALL_BIN_PATH>':: if you specified
541 +FOAM_INSTALL_BIN_PATH+ as a relative path
542 '<FOAM_INSTALL_BIN_PATH>':: if you specified +FOAM_INSTALL_BIN_PATH+ as an
546 After extending the +PATH+ variable with the installation directory of the
547 executables, you should be able to run all {project} applications as any other
548 binary available on the system. See <<environment,'Extending Search Paths And
549 Setting Environment Variables Permanently'>> for
550 instructions on how to extend the search path.
552 3. This option is similar to the previous solution and applies if you want to
553 run {project} from the build tree (i.e. without running +make install+). In
554 this case you again have to make sure that your shell finds the executables
555 built by CMake by extending the +PATH+ variable. Further, you have to tell
556 {project} where to find the global configuration files (see
557 <<globalconfig,'Global Configuration Files'>>). Here, you have the option to
558 place the files under your home directory or set an environment variable.
559 The former can be achieved by:
562 $ mkdir -p $HOME/.{project}/{shortver}
563 $ cp $HOME/Source/freefoam-{fullver}-build/etc/controlDict \
564 $HOME/.{project}/{shortver}
565 $ cp $HOME/Source/freefoam-{fullver}-build/etc/cellModels \
566 $HOME/.{project}/{shortver}
567 $ cp -r $HOME/Source/freefoam-{fullver}-build/etc/thermoData \
568 $HOME/.{project}/{shortver}
571 The latter (and recommended) method is to set the environment variable
572 +FREEFOAM_CONFIG_DIR+ to '$HOME/Source/freefoam-{fullver}-build/etc'. Adjust
573 the paths to match the build tree to your actual setup.
575 Starting Any {project} Application Fails Because Some Libraries Cannot Be Found
576 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
577 Although CMake should have taken care of this by using +RPATH+ on Linux and
578 +install_name+ on Mac OS X, it might be necessary on some systems to adjust the
579 library search paths:
581 +LD_LIBRARY_PATH+:: This variable is used by all Unix like systems (e.g. Linux,
583 +DYLD_LIBRARY_PATH+:: This variable is used by Mac OS X.
585 If you installed {project}, there are (as with the executables), two possible
586 installation directories:
588 '<CMAKE_INSTALL_PREFIX>/<FOAM_INSTALL_LIBRARY_PATH>':: if you specified
589 +FOAM_INSTALL_LIBRARY_PATH+ as a relative path.
590 '<FOAM_INSTALL_LIBRARY_PATH>':: if you specified +FOAM_INSTALL_LIBRARY_PATH+ as
593 If you are trying to run from the build tree, you have to include
594 '$HOME/Source/freefoam-{fullver}-build/lib/{project}-{ver}' in the above
595 mentioned search paths (where you have to adjust the location of the build tree
596 to your actual setup).
598 A Running {project} Application Aborts Because It Can't 'dlopen' A Library
599 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
600 {project} (and OpenFOAM) often dynamically load libraries at run-time (a.k.a
601 plug-ins) to add features the user requested without requiring that the whole
602 application be recompiled. This makes it very simple to add new boundary
603 conditions, turbulence and combustion models etc. However, it also requires
604 that {project} must be able to find these libraries at run-time. The operating
605 system function which does the loading of the libraries ('dlopen') usually
606 tries to find the library with the given name in several places; namely a
607 default search path and a search path configured by one or multiple environment
608 variables such as +LD_LIBRARY_PATH+ or +DYLD_LIBRARY_PATH+ (on Mac OS X). The
609 details vary from platform to platform, so you best consult the documentation
610 of 'dlopen' for the details.
612 Additionally {project} allows you to configure a custom search path for
613 plug-ins in the <<globalconfig,global 'controlDict'>> file by listing the
614 directories to be searched in the list +LibrarySearchPaths+. By default
615 {project} is configured to search for plug-ins in the location where CMake
618 If you want to add your own plug-in libraries (e.g. you want to add your own
619 boundary conditions class), you most probably will want to extend this search
622 {project} Aborts When Trying To Instantiate a Plugin Class
623 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
624 If you get a warning message similar to the following
627 From function dlLibraryTable::open(const dictionary& dict, const word& libsEntry, const TablePtr tablePtr)
628 in file XXX/src/OpenFOAM/db/dlLibraryTable/dlLibraryTableTemplates.C at line 68
629 library "libfieldFunctionObjects.so" did not introduce any new entries
631 (where +XXX+ is the path to the {project} source code and the actual library
632 name can be different), followed by a fatal error stating that {project} does
633 not know a class or type, e.g.
635 --> FOAM FATAL ERROR:
636 Unknown function type fieldAverage
638 Table of functionObjects is empty
641 From function functionObject::New(const word& name, const Time&, const dictionary&)
642 in file XXX/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C at line 74.
646 and you are absolutely sure that the named type actually exists in the library
647 mentioned in the preceding warning message, the issue is very likely that
648 {project} is loading the plugin library from a different binary tree than the
649 executable belongs to.
652 Always make sure that you never load plugins from different binary trees (where
653 the build tree and the install tree count as such). If you want to run a binary
654 from the build tree but already have a corresponding installation tree, use the
655 +FREEFOAM_CONFIG_DIR+ environment variable to point {project} to the directory
656 '<path to build tree>/etc/' containing the global 'controlDict' file in the
657 **build tree**. Otherwise the binaries are likely to be incompatible with each
661 Extending Search Paths And Setting Environment Variables Permanently
662 --------------------------------------------------------------------
663 The way one sets environment variables and extends the executable and library
664 search paths permanently strongly depends on the shell used. Usually one has to
665 create or change an initialization file in the users home directory. In the
666 following this will be discussed very briefly for the popular shells 'BASH' and
667 'tcsh'. However, if you need more help or want information on using the shell,
668 there is an excellent tutorial available at {linuxcommand}.
672 The BASH shell is the default shell for most Linux/Unix distributions. Most
673 systems configure the BASH shell such that it reads the text file
674 '$HOME/.bashrc' when starting up, so this is the place where one appends
675 customizations of the environment variables. On some systems this file is not
676 processed by default (notably Mac OS X). In this case you can use
677 '$HOME/.bash_profile'.
679 Referencing A Variable
680 ^^^^^^^^^^^^^^^^^^^^^^
681 To retrieve the value stored in a shell variable or environment variable, one
682 prefixes its name with the dollar (+$+) character.
686 The syntax for setting a variable and making it available to child-processes of
687 the shell is the following:
689 $ export variable_name=variable_value
691 Note that no white-space characters are allowed surrounding the +=+ sign.
693 Extending A Search Path
694 ^^^^^^^^^^^^^^^^^^^^^^^
695 The shell and other Unix system facilities use environment variables to locate
696 executables and dynamically linked libraries. These search paths consist of
697 strings naming directories in which the executables and libraries should be
698 searched for. The individual paths are separated by a colon (+:+) character. To
699 add the e.g. the directory '$HOME/bin' to the search path for executables, one
700 would do the following:
702 $ export PATH=$PATH:$HOME/bin
704 which appends '$HOME/bin' to the end of the +PATH+ variable.
708 Some users and administrators prefer to use a 'C-Shell', such as the TCSH. Here
709 you can use e.g. the file '$HOME/.tcshrc' to customize the environment.
711 Referencing A Variable
712 ^^^^^^^^^^^^^^^^^^^^^^
713 As with the BASH, one retrieves the value stored in a shell variable or
714 environment variable by prefixing its name with the dollar (+$+) character.
715 Sometimes it is also necessary to protect the variable name by surrounding it
716 with curly braces (+{+ and +}+).
720 The syntax for setting a variable and making it available to child-processes of
721 the shell is the following:
723 $ setenv variable_name variable_value
726 Extending A Search Path
727 ^^^^^^^^^^^^^^^^^^^^^^^
728 The shell and other Unix system facilities use environment variables to locate
729 executables and dynamically linked libraries. These search paths consist of
730 strings naming directories in which the executables and libraries should be
731 searched for. The individual paths are separated by a colon (+:+) character. To
732 add the e.g. the directory '$HOME/bin' to the search path for executables, one
733 would do the following:
736 $ setenv PATH ${PATH}:${HOME}/bin
738 which appends '$HOME/bin' to the end of the +PATH+ variable. Note that
739 'C-shells' usually require the user to type 'rehash' after changing the +PATH+
740 variable to update the cache of available programs.
742 ////////////////////////////////////////////////////////////////////
743 Process with: asciidoc -a toc -f data/asciidoc/html.conf INSTALL
745 Vim users, this is for you:
746 vim: ft=asciidoc sw=2 expandtab fenc=utf-8
747 ////////////////////////////////////////////////////////////////////