Project

General

Profile

uns_devel installation

Requirements

To compile your project, you just need a recent gcc/g++ and optionally a fortran compiler and cmake tools (version 2.6). Cmake tools can be installed directly from your distribution or downloaded from here :.

IMPORTANT: we assume that unsio has been properly compiled and installed (see unsio installation).

Configuration

To configure your project, type

cd unsio/template/uns_devel
mkdir build
cd build
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 your project in "debug" mode, with shared library and installation path will be

    a) in ${NEMO} if NEMO package is installed and loaded
    b) 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 your project 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 your project in "release" mode with shared library and installation path will be

    a) in ${NEMOPATH} if NEMO package is installed and loaded
    b) if not NEMO installed nor loaded, it will install to ${HOME}/local/unsio

  • 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 your project, type

make

To install your project, type

make install