- Table of contents
- Python unsio wrapper Installation
Python unsio wrapper Installation¶
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
UNSIOPATH specify your UNSIO installation path directory
(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 :
mkdir build-debug cd build-debug cmake ..
Will configure py_unsio in "debug" mode
mkdir build-release cd build-release cmake .. -DCMAKE_BUILD_TYPE=Release
Will configure py_unsio in "release" mode with shared library.
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.
To build py_unsio library, enter
To install py_unsio module and library, enter
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