Versions Compared

Key

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

All platforms:
Required third 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)
  • HDF5hdf5: this library is optional www.hdfgroup.org. Required only to write postprocess files with this format (files opened with GiD_PostHDF5=3 flag)

...

Code Block
apt-get install zlib1g-dev libhdf5-dev libhdf5-serial-devhl-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
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:

Code Block
hdf5-devel.x86_64
hdf5-mpich-devel.x86_64
hdf5-openmpi.x86_64

...



Required third part tool:

  • CMake: The CMake tool (www.cmake.org) is used to have a cross-platform build system.

...


Note: Users that don't want to use CMake could also manually create off course its own makefile for Unix/Linux or its own compiler project.
All the source code to generate the library is included, it can be compiled in other platforms.
The third party code, "cfortran.h", is also provided as a link between C and FORTRAN. It has its own distribution policy. Please, read the file "cfortran.doc" about the licence terms of this code.


Precompiled version:
The 'binaries' folder

...

stores precompiled release versions of the library for Windows and Linux (x32 and x64 platforms), to avoid the requirement of compile them.

...


Compiling gidpost:

...


to compile the gidpost library using the command line:


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 (Linux - nvidia hpc sdk ):



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


Code Block
languagebash
$ NVARCH=`uname -s`_`uname -m`; export NVARCH
$ NVCOMPILERS=/opt/nvidia/hpc_sdk; export NVCOMPILERS
$ MANPATH=$MANPATH:$NVCOMPILERS/$NVARCH/23.5/compilers/man; export MANPATH
$ PATH=$NVCOMPILERS/$NVARCH/23.5/compilers/bin:$PATH; export PATH



Once done, log in again and:


Code Block
languagebash
$ cd .../gidpost
$ mkdir build-linux
$ cd build-linux
$ cmake -DHDF5=ON -DBUILD_FORTRAN_EXAMPLES=ON \
-DMAKE_CXX_COMPILER=/opt/nvidia/hpc_sdk/Linux_x86_64/23.5/compilers/bin/nvc++ \
-DMAKE_C_COMPILER=/opt/nvidia/hpc_sdk/Linux_x86_64/23.5/compilers/bin/nvc \
-DMAKE_Fortran_COMPILER=/opt/nvidia/hpc_sdk/Linux_x86_64/23.5/compilers/bin/nvfortran \
..          ;# you can also use 'ccmake/cmake-gui ..' with 'Advanced options' enabled.
$ 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



For the graphical interface of cmake use cmake-gui or ccmake .


e.g. for Windows, to compile with MicroSoft Microsoft Visual Studio 2005, fill in
Where is the source code: C:/gid project/gidpost
Where to build the binaries: C:/gid project/gidpost/win/vs2005
and press "Configure"
select generate a project of "Visual Studio 8 2005", "use default native compilers"

...