Skip to content

Commit

Permalink
Describe some CMake options
Browse files Browse the repository at this point in the history
  • Loading branch information
rafmudaf committed Oct 29, 2019
1 parent 3fe0340 commit fa52157
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions docs/source/install/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,45 @@ The commands above are equivalent to having run this command the first time:
# Initial configuration in Debug mode with dynamic linking
cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON
CMAKE_BUILD_TYPE
****************
This option allows to set the compiler optimization level and debug
information. The value and its effect are listed in the table below.

================== ================================================================================================================
CMAKE_BUILD_TYPE Effect
================== ================================================================================================================
Release ``-O3`` optimization level
RelWithDebInfo ``-O2`` optimization level with ``-g`` flag for debug info
Debug No optimization and `-g` flag for debug info; additional debugging flags: ``-fcheck=all -pedantic -fbacktrace``
================== ================================================================================================================

For best performance at the cost of longer compile time, use ``Release``.
The next level, ``RelWithDebInfo`` provides comparable performance in OpenFAST
and faster compile time. It also adds debugging symbols and results in a larger
executable size. Finally, use ``Debug`` during active development to add debug
symbols for use with a debugger. This build type also adds flags for generating
runtime checks that would otherwise result in undefined behavior.

This flag can be set with the following command:

.. code-block:: bash
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
CMAKE_INSTALL_PREFIX
********************
This flag sets the location of the compiled binaries when the build
tool runs the ``install`` command. It should be a full path in a carefully
chosen location. The binaries will be copied into ``include``, ``lib``,
and ``bin`` subfolders under the value of this flag. The default is to
install binaries within the repository in a folder called ``install``.

This flag can be set with the following command:

.. code-block:: bash
cmake .. -DCMAKE_INSTALL_PREFIX="/usr/local/"
Setting the build tool
++++++++++++++++++++++
Expand Down

0 comments on commit fa52157

Please sign in to comment.