Build and Install

The installation described here is for UNIX platforms only. The MS-Windows version is distributed as a self-installable Windows package.

The installation process is easy in the case you already have the required libraries and a standard configuration.

Required libraries

The first step of the installation is to make sure you have the required libraries. We have now a quite large set of libraries, we are trying hard to use well known and easy to install libraries but we must admit this could be a difficult task to install all by yourself…

The mandatory libs are Python, numpy, HDF5 and CHLone, VTK and Qt. The cython compiler and scons (for CHLone) are also required.


The libcgns (CGNS/MLL) is NOT required for pyCGNS.

The complete set of required tools/modules/libraries contains Python, HDF5 and other graphical toolkits:

The VTK and the Qt graphical toolkits need to have a Python binding. The important point is to use the native Python binding of these toolkits, not any other (see installation details hereafter).

No Python binding is required for HDF5.

Optional libraries

The so-called mid-level library is not mandatory,

Installation process

Once you have these installed you can proceed with pyCGNS. You go into the top directory and you edit the (see Configuration file contents). You have to set the correct paths and various values such as directory search libs or flags.

Then you run:

python build

and then:

python install


python install --prefix=/local/tools/installation

All the modules of the pyCGNS package are installed and you can now proceed with tutorial examples.

Single module installation

You can ask for a single module installation:

python build --single-module=MAP
python install

You have to check that this installation doesn’t overwrite an existing installation with the other pyCGNS modules.

Configuration file contents

The should work with no modification if you have a standard installation. All you have to declare is the directory in which we can find Python/numpy/hdf5/CHLone/cgns libraries.

If you have specific installations you can change some paths/flags for each external library: hdf5, numpy. The configuration file is a Python file, it is imported after the default configuration. The changes you make in the configuration file will overwrite the defaults:

# --- stuff to add for HDF5

#HDF5_VERSION          = ''
HDF5_PATH_INCLUDES    = ['/home/myself/hdf5/include']
HDF5_PATH_LIBRARIES   = ['/home/myself/hdf5/lib']
#HDF5_EXTRA_ARGS       = []

To avoid overwriting, use Python to update the config:

# --- stuff to add for HDF5

#HDF5_VERSION          = ''
HDF5_PATH_INCLUDES    = ['/home/myself/hdf5/include']
HDF5_PATH_LIBRARIES   = ['/home/myself/hdf5/lib']

You do not have to specify the VTK nor the Qt libraries, there is no direct link to these libraries: the Python modules will do that.

Module dependancies

The pyCGNS modules have dependancies with their brothers. The list below gives you the required modules (or optional) for each of them.

  • MAP : None
  • PAT : MAP

MAP depends

The embedded CHLone library is required and thus HDF5 is required.


CGNS/MLL and CGNS/ADF libraries are required. Set the following variable to ON in the CMakeCache.txt file:

//Build the CGNSTools package

//Build a shared version of the library

//Enable or disable the use of Fortran

//Enable or disable HDF5 interface

The NAV module (and CHLone by the way) is using cython. You can check your cython is present using:

cython --version

That should not fail…


Some of the pyCGNS modules have embedded tests. Once you have installed pyCGNS, you can run each test suite from another user account/directory:

python -c 'import CGNS.MAP.test;'

All modules tests can be run the same way, replace MAP by any of PAT, VAL, NAV, APP, DAT. You can run all the tests by importing CGNS.test:

python -c 'import CGNS.PAT.test;'

python -c 'import CGNS.test'

The tests are running silently, if there is a problem you would see a stack error on the output.