-
Notifications
You must be signed in to change notification settings - Fork 2
Setting Up OOPS 2D
OOPS-2D was designed to make installation as easy as possible. Nevertheless, there are a few system requirements:
- CMake 3.0 or later
- A modern C++11-compliant compiler.
- An MPI implementation such as OpenMP or MPICH.
- Python 3.0 or later with standard libraries.
Because OOPS-2D has so few external dependencies, it should theoretically be able to run on any modern version of Windows, Linux, or MacOS. Instructions are provided for a generic command line installation via Make, though the use of CMake should make it possible to generate build files for other systems, too.
Because of CMake, compilation is relatively straightforward. On a Bash terminal using Unix Makefiles, it might look something like the following:
cd <OOPS directory>
mkdir build
ccmake ../
From here, you simply follow the instructions in the CMake terminal, then run make when you're done. The default options should be sufficient for getting started.
Although the default options are good for getting started, they by no means are the optimal settings for production code. The descriptions provided in the CMake GUI are rather brief, so this section provides a more thorough explanation of the (non-advanced) compilation options available in OOPS-2D.
| Option | Description |
|---|---|
BUILD_TESTS |
OOPS-2D contains a selection of unit tests and programs for validating code behavior. These are not built by default, as most users will not need them, but they should be enabled for users modifying the OOPS-2D library to ensure that adding or changing a feature doesn't break another. |
CMAKE_BUILD_TYPE |
This option automatically sets the compiler options for specific builds. Debug disables all optimizations and adds debug information. This is the default. Release enables all safe code optimizations (-O3 in GCC and Clang). MinSizeRel is a release build that optimizes the code for smaller size rather than faster speed. Finally, RelWithDebInfo is a release build which enables some optimizations (-O2 in GCC and Clang) and adds debug information. |
CMAKE_INSTALL_PREFIX |
This tells CMake where to place compiled OOPS-2D libraries and binaries after using something like make install. |
USE_INTRINSICS |
For GCC and Clang, this enables -march=native. On Intel compilers, this enables -xHost or /QxHost. It does nothing for MSVC or other compilers. These flags will enable architecture-specific instruction sets (AVX, AVX2, etc.) which may improve performance at the expense of portability. It is not recommended for code which must run on a variety of processor architectures (e.g., supercomputer jobs which may run simultaneously on Broadwell, Skylake, or KNL nodes), although it may have some benefit for code compiled and tested locally. |