Build instructions

For a proper build, the release code including the required CMake files can be downloaded or cloned from the SWAN git repository hosted on TU Delft GitLab.


Next, carry out the following steps.


1. clone the repository and navigate to the top level source directory

   git clone https://gitlab.tudelft.nl/citg/wavemodels/swan.git && cd swan
2. create the build directory


At the top of SWAN source directory execute the following commands
   mkdir build
   cd build
This step is required to perform an out-of-source build with CMake, that is, build files will not be created in the /swan/src directory.


3. build the software


Two CMake configuration files are provided as required for the build. They are placed in the following source directories: ./swan/CMakeLists.txt and ./swan/src/CMakeLists.txt. The following two CMake commands should suffice to build SWAN
   cmake .. -G Ninja
   cmake --build .
The first command refers to the source directory where the main configuration file is invoked. The second command carries out the building in the build directory. The package is actually built by invoking Ninja.


4. install the package
   cmake --install .
The default install directory is /usr/local/swan (Unix-like operating systems, including macOS) or C:$\backslash$PROGRAM FILES$\backslash$swan (Windows). Instead, you may install SWAN in any other user-defined directory, as follows
   cmake --install . --prefix /your/defined/directory
After installation a number of subdirectories are created. The executables end up in the /bin directory, the library files in /lib, and the module files in /mod. Additionally, the /doc folder contains the pdf documents, the folder /tools consists of some useful scripts and the /misc directory contains all of the files that do not fit in other folders (e.g., a machinefile and the edit file swan.edt).


Please note that the installation can be skipped (though not recommended). Executables and libraries are then located in subdirectories of the build directory.

The SWAN team 2024-09-09