Skip to content

Commit

Permalink
Add general compile procedures
Browse files Browse the repository at this point in the history
  • Loading branch information
rafmudaf committed Mar 10, 2021
1 parent 87a9efa commit e6b2146
Showing 1 changed file with 32 additions and 13 deletions.
45 changes: 32 additions & 13 deletions docs/source/install/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ development, CMake is adequate. Background on CMake is given in
:ref:`understanding_cmake`, and procedures for configuring and
compiling are given in :ref:`cmake_unix` and :ref:`cmake_windows`.

Generally, the steps required to compile are:

1. Install Dependencies (Section :numref:`dependencies`)
2. Configure the build system (Visual Studio - :numref:`vs_windows`, CMake - :numref:`understanding_cmake`)
3. Compile and test binaries (Visual Studio - :numref:`vs_windows`, CMake - :numref:`cmake_unix` and :numref:`cmake_windows` )

.. _dependencies:

Dependencies
------------
Compiling OpenFAST from source requires additional libraries and tools that
Expand Down Expand Up @@ -498,16 +506,19 @@ not to the libraries themselves.

CMake with Make for Linux/macOS
-------------------------------
After reading :ref:`understanding_cmake`, proceed with
configuring OpenFAST. The CMake project is well developed for Linux and
macOS systems, so the default settings should work as given. These settings
should only be changed when a custom build is required.
After installing all dependencies and reading :ref:`understanding_cmake`,
proceed with configuring OpenFAST. The CMake project is well developed for
Linux and macOS systems, so the default settings should work as given.
These settings should only be changed when a custom build is required.

The procedure for configuring CMake and compiling with GNU Make on Linux
and macOS systems is given below.

.. code-block:: bash
# For macOS using Homebrew, this installs all dependencies
brew install
# Clone the repository from GitHub using git
git clone https://github.com/OpenFAST/OpenFAST.git
Expand All @@ -526,8 +537,16 @@ and macOS systems is given below.
make help
# Choose a particular target or give no target to compile everything
make hydrodyn_driver
# or
make openfast
# or
make
# Test the compiled binary, for example
./glue-codes/openfast/openfast -v
./modules/hydrodyn/hydrodyn_driver -v
.. tip::

Compile in parallel by adding "-jN" where N is the number of parallel
Expand All @@ -543,15 +562,15 @@ again.

CMake with Visual Studio for Windows
------------------------------------
After reading :ref:`understanding_cmake`, proceed with
configuring OpenFAST. The result of this configuration process will be
a Visual Studio solution which will be fully functional for compiling
any of the targets within OpenFAST. However, this method lacks support
for continued active development. Specifically, any settings that are
configured in the Visual Studio solution directly will be lost any time
CMake is executed. Therefore, this method should only be used to compile
binaries, and the procure described in :ref:`vs_windows` should be used
for active OpenFAST development on Windows.
After installing all dependencies and reading :ref:`understanding_cmake`,
proceed with configuring OpenFAST. The result of this configuration
process will be a Visual Studio solution which will be fully functional
for compiling any of the targets within OpenFAST. However, this method
lacks support for continued active development. Specifically, any settings
that are configured in the Visual Studio solution directly will be lost
any time CMake is executed. Therefore, this method should only be used to
compile binaries, and the procure described in :ref:`vs_windows` should
be used for active OpenFAST development on Windows.

The procedure for configuring CMake and compiling with Visual Studio
on Windows systems is given below.
Expand Down

0 comments on commit e6b2146

Please sign in to comment.