Skip to content

Latest commit

 

History

History
179 lines (146 loc) · 5.56 KB

INSTALL.md

File metadata and controls

179 lines (146 loc) · 5.56 KB

Installation Instructions

Requirements

  • cmake: CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice.
  • netcdf: A set of software libraries and self-describing, machine- independent data formats that support the creation, access, and sharing of array-oriented scientific data.

Setup with conda

Anaconda is a free and open-source distribution of the Python programming language for scientific computing, that aims to simplify package management and deployment. The package management system conda manages package versions.

The first step is to install the anaconda distribution. The installation manual for this software is detailed here

To install the software using conda, execute the following command:

conda install pyfes -c fbriol

This command will install the software and the necessary dependencies. More information is available on the syntax of this command on the related documentation

Building & Installing

One nice and highly recommended feature of CMake is the ability to do out of source builds. In this way you can make all your .o files, various temporary depend files, and even the binary executables without cluttering up your source tree. To use out of source builds, first create a build directory, then change into your build directory and run cmake pointing it to the source directory:

mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/local

The command gives feedback on what requirements are fulfilled and what software is still required.

The library can be built and installed using these commands:

make -j
make install # sudo may be needed

To see the full output from the compilation, you can use: make VERBOSE=1

If you have the dependencies installed in non-standard location (other than /usr, e.g. /home/xyz/projects), set CMAKE_PREFIX_PATH to that directory to help CMake find them. You can enter more different dirs if you separate them with semicolons. You can also specify, for each dependency, the required library and header search directories using options.

Also, if you plan to install the library to non-standard location, you might want to set CMAKE_INSTALL_PREFIX to subdir of given prefix (e.g. /home/xyz/projects/fes).

The following table gives an overview of the different options. The default (without any options) will compile all binaries only and install it in /usr/local/.

Construction options
CMake options Documentation Default
BUILD_DOC Build Doxygen documentation OFF
BUILD_PYTHON Build python extension OFF
BUILD_SHARED_LIBS Build shared libraries OFF
CMAKE_BUILD_TYPE Type of compilation: Debug, RelWithDebInfo, Release RelWithDebInfo
CMAKE_CXX_COMPILER C++ Compiler
CMAKE_CXX_FLAGS Flags for the C++ Compiler
CMAKE_INSTALL_PREFIX where you want to install /usr/local
UTHASH_INCLUDE_DIR Path to the include directory of uthash
NETCDF_INCLUDE_DIR Path to the include directory of NetCDF
PYTHON_EXECUTABLE Path to the Python interpreter

The libraries are build as static by default. If you just want to build shared libraries, enable BUILD_SHARED_LIBS to build the libraries as shared. If you want to build with another compiler (e.g. Clang), pass -DCMAKE_CXX_COMPILER=clang++ to CMake.

Libraries built in Debug configuration (e.g. with CMAKE_BUILD_TYPE set to Debug) have a -d suffix to make it possible to have both debug and release libraries installed alongside each other. Headers are the same for both debug and release configurations.

If you want to generate the Python library, enable BUILD_PYTHON. You can also specify which python interpreter you want to use for generation by passing -DPYTHON_EXECUTABLE=/which/python/to/use option to CMake.

Running tests

In the building directory execute the make test command.

Create package

Sources

When you create a distribution containing the source code, please extract the GIT tag to identify the distributed version: git checkout <TAG> -b <tag>

The "package_source" target of the makefile allows to generate a source installer. To create this archive, in the build directory of the software execute the following command :

make package_source

Binaries and headers

The "package" target of the makefile allows to generate an installer of libraries and C headers in :

  • .deb format if you generate the library under "Debian/Ubuntu" distribution,
  • .rpm if the generation is done under "Red Hat/CentOS" or
  • .zip if the generation is done under "Windows" or
  • .tar.gz under the other platforms.

To create this installer, in the construction directory of the software execute the following command :

make package