Project

General

Profile

Installation

Requirements

Unsio should compile fine on Linux and MacOSX. You just need a recent gcc/g++ compiler and cmake tools (version 2.6). Cmake tools can be installed directly from your distribution or downloaded from here :

Configuration

To configure UNSIO, type

mkdir build
cd build
cmake ..

on MACOS, you should use cmake command like this :

CC=gcc CXX=g++ GC=gfortran cmake ..

You can add several options to command "cmake". The most important ones are:

  -DCMAKE_INSTALL_PREFIX=<dir>          installation directory [${NEMO}]
  -DCMAKE_BUILD_TYPE=<Debug|Release>    build type [Debug]
  -DBUILD_SHARED_LIBS=<TRUE|FALSE>      shared or static libraries [TRUE]

Here are different scenarios :

  • default configuration (no options added)
    mkdir build-debug
    cd build-debug
    cmake ..
    

    Will configure unsio in "debug" mode, with shared library and installation path will be
    1. in ${NEMO} if NEMO package is installed and loaded
    2. if not NEMO installed nor loaded, it will install to ${HOME}/local/unsio
  • user's own installation path
    mkdir build-test
    cd build_test
    cmake .. -DCMAKE_INSTALL_PREFIX="/mypath/toinstall" 
    

    Will configure unsio in "debug" mode, with shared library and installation path to "/mypath/toinstall"
  • release mode (with optimizations enabled)
    mkdir build-release
    cd build-release
    cmake .. -DCMAKE_BUILD_TYPE=Release
    

    Will configure unsio in "release" mode with shared library and installation path will be
    1. in ${NEMOPATH} if NEMO package is installed and loaded
    2. if not NEMO installed nor loaded, it will install to ${HOME}/local/unsio
  • no FORTRAN support
    If you don't need fortran support, you can disable it
    mkdir build
    cd build
    cmake .. -DCMAKE_DISABLE_FORTRAN=1
    

    Will configure unsio with no fortran support
  • select a specific fortran compilier
    mkdir build
    cd build
    FC=ifort cmake .. 
    

    Will configure unsio using ifort compiler
  • so forth and so on.....

Note that CMake maintains a cache name "CMakeCache.txt". If you change options (or your environment changes), it is best to remove that file to avoid problems.

Building

To build UNSIO library, type

make

To install UNSIO headers and libraries, type

make install

A list of all available make targets can be obtained by

make help

Python support

Easy installation

To install unsio python wrapper, you just have to enter the following command from your favorite python interpreter. This is the preferred installation method :

  pip install python-unsio

Compile by your self

If you are brave, you can compile it by yourself !

Once UNSIO library is installed, you can compile python support. For that you must have SWIG tools and NUMPY developement package installed.

from unsio directory :

python setup.py install

or
python3 setup.py install