1.2.3. Installations

1.2.3.1. Quick installation with conda

Conda is a package manager that provides pre-compiled binaries for Windows, OSX and Linux.

Install conda first from this page. Miniconda is a mini installer it is good to start with.

Then, you can install vacumm and its dependecies:

$ conda install -c vacumm -c conda-forge -c cdat vacumm

For more option, please read the conda documentation.

1.2.3.2. From sources

1.2.3.2.1. In short

Here is an example of basic installation inside CDAT, with some OpenMP parallelisation:

$ cp setup.cfg.omp setup.cfg
$ python setup.py install

1.2.3.2.2. For all users

This installation puts the library within the python tree. The python excutable must be the one provided by CDAT (see Prerequisites).

One compile and install VACUMM from the main directory of the package with:

$ python setup.py install

For more options:

$ python setup.py --help

1.2.3.2.3. For our own usage

In this case, the library is installed in the user’s directory.

First, compile:

$ python setup.py build

Then, install in the default user’s directory (typically $HOME/.local/lib/python2.x/site-packages):

$ python setup.py install --user

If the library must be installed in a special directory, use:

$ python setup.py install --prefix=/my/special/dir

Then, set your environment variables to have acces both to the python library and to the executables:

$ export PATH=/my/special/dir/bin
$ export PYTHONPATH=/my/special/dir/lib/python{x.x}/site-packages  # {x.x} refers to the python version

1.2.3.2.4. Local installation for a developper

VACUMM must be used directly after an untar or a checkout by compiling the extensions and setting the variables:

$ make lib # or python setup.py build_ext --inplace
$ export PATH=~/path/to/vacumm-trunk/bin
$ export PYTHONPATH=~/path/to/vacumm-trunk/lib/python

You can also use the environment module provided with the package as presented at section The developer side.

1.2.3.3. Tuning the installation

You can tune the installation with the setup.cfg file, following the instruction of the official documentations (here). Two examples are provided, which differ in the way the fortran extension is compilated:

  • The setup.cfg.simple simply specifies the compiler type:

    [config_fc]
    fcompiler=gnu95
    
  • The setup.cfg.omp makes the compilation to use OpenMP:

    [config_fc]
    fcompiler=gnu95
    opt=-fopenmp -O3 -funroll-loops
    
    [build_ext]
    libraries=gomp
    

For example, to quickly allow OpenMP parallelisation, link to the right setup configuration file before installing:

$ cp setup.cfg.omp setup.cfg
$ python setup.py build_ext --force # to force the recompilation

Note

If the setup.cfg file doesn’t exist, the setup.py will copy file:setup.cfg.simple into setup.cfg.

1.2.3.4. User configuration of the modules

Some of the modules can be configured to change their default behaviour. Configurations store for instance default paths.

The library is configured by default for a use on the supercomputer from IFREMER (datarmor). If you are on your own system or you want to change your configuration, please check the documentation section Library configuration.

During the installation process using the setup.py, you can provide a general configuration file and secondary configuration files with --cfgfiles option (comma separated). All these files will be installed in the vacumm-config directory.

For instance, the configuration of the vacumm.bathy.bathy module makes a reference to a secondary configuration file refered in the config section [vacumm.bathy.bathy] with the key cfgfile_gridded. To alter this configuration, proceed in this way:

  1. Specify the name of the secondary config file in the main config file by prefixing it with %(conf_dir)s, which is the directory where config files will be installed (see Library configuration):

    [vacumm.bathy.bathy]
    cfgfile_gridded=%(conf_dir)s/bathy.gridded.cfg
    
  2. Then specify the list of config files as comandline option:

    $ python setup.py install --cfgfiles=myconfig.cfg,path/to/bathy.gridded.cfg
    

1.2.3.5. Check your installation

Run:

$ vacumm_config.py print
$ python -c 'import vcmq'