Project

General

Profile

Python unsio wrapper Installation

Requirements

Before installing python unsio wrapper you must install UNSIO, see following link.

Unsio python wrapper 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 :. You need also the SWIG library, and numpy development library.

  • For Mac OS X, you can install swig using macport
sudo port install swig swig-python

IMPORTANT REQUIREMENT FOR MACOSX users

You must set environment variable DYLD_INSERT_LIBRARIES to libunsio.dylib file in every terminal where you will use py_unsio

export DYLD_INSERT_LIBRARIES=UNSIOPATH/libunsio.dylib

UNSIOPATH specify your UNSIO installation path directory

Configuration

(We assume that UNSIOSRC specify your UNSIO sources directory, and UNSIOPATH your UNSIO installation path directory)

To configure python unsio wrapper, do the following :

cd UNSIOSRC/py
mkdir build
cd build
cmake ..

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

  -DCMAKE_BUILD_TYPE=<Debug|Release>    build type [Debug]

Here are different scenarios :

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

    Will configure py_unsio in "debug" mode
  • release mode (with optimizations enabled)
    mkdir build-release
    cd build-release
    cmake .. -DCMAKE_BUILD_TYPE=Release
    

    Will configure py_unsio in "release" mode with shared library.
  • 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 py_unsio library, enter

make

To install py_unsio module and library, enter

make install

note that files will be installed in UNSIOPATH/py/modules directory. In order to use py_unsio module, you have to add path UNSIOPATH/py/modules to your environment variable PYTHONPATH

A list of all available make targets can be obtained by

make help