Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

GiDPost can be build as library to be linked into the calculation program or as python module (look into As python module ).

This page explains how to build gidpost as library to be linked to you program.

 Third part libraries:

  • zlib: it is necessary previously obtain or compile the zlib compression library (www.zlib.net)
  • hdf5: this library is optional www.hdfgroup.org. Required only to write postprocess files with this format (files opened with GiD_PostHDF5=3 flag)

To build GiDPost as Python module you'll need:

  • python3
  • SWIG: (Simplified Wrapper and Interface Generator) a tool used to connect C or C++ code with scripting languages like python. https://www.swig.org/

To install the required packages in Linux just do the following as root:
Ubuntu (Debian and the like):

Code Block
apt-get install zlib1g-dev libhdf5-serial-dev
apt install python3 swigdev libhdf5-hl-100   ;# version number depends on linux distribution and version
apt-get install hdf5-tools hdf5view                     ;# recommended tools to manage and look into hdf5 files

Scientific Linux (Redhat and the like):

Code Block
yum install zlib-devel.x86_64 hdf5-devel.x86_64
yum install python3.x86_64 swig.x86_64


Note:
Bear in mind that there are several hdf5 development packages and that you should choose the right for you.
For instance, in Ubuntu these are the HDF5 development packages available:

Code Block
libhdf5-mpi-dev
libhdf5-mpich-dev
libhdf5-openmpi-dev
libhdf5-serial-dev     ;# by default the package 'libhdf5-dev' installs the -serial version


And in Scientific Linux the HDF5 development packages available:

...

How to build (Linux - gcc):

Code Block
languagebash
$ cd .../gidpost
$ mkdir build-linux
$ cd build-linux
$ cmake -DHDF5=ON -DBUILD_FORTRAN_EXAMPLES=ON ..     ;# gfortran is needed to BUILD_FORTRAN_EXAMPLES (by default it's off)
$ make
$ cd examples
$ ./testc -help      ;# to view format options
$ ./testc -f hdf5    ;# to write a gid post file in hdf5 format
$ ./testf90          ;# fortran 90 example writing hdf5 gid post file

How to build python module (Linux):

Once you have configured and buil the GiDPost library, then:

Code Block
languagebash
titlebuilding gidpost python module
$ cd .../gidpost/gidpost-swig/
$ make
$ make test

How to build (Linux - nvidia hpc sdk ):



First, remember to add the environment variables to your $HOME/.bashrc :

...