Skip to content
Stefano Zaghi edited this page Feb 17, 2015 · 3 revisions

Lib_VTK_IO has been developed on GNU/Linux architecture. Other OS are not supported (and in general there is no best alternative to GNU/Linux :-).

Compiler Support

Compiler

Compiler

Compiler

Compiler

Compiler

Compiler

Lib_VTK_IO relies on two other modules:

The most easy way to compile Lib_VTK_IO is to use FoBiS.py or use the provided makefile.

Consequently, it is strongly encouraged to install FoBiS.py or a Make program (preferably GNU make http://www.gnu.org/software/make/).

Compiling by means of FoBiS.py

FoBiS.py is a KISS tool for automatic building of modern Fortran projects. Providing very few options, FoBiS.py is able to build almost automatically complex Fortran projects with cumbersome inter-modules dependency. This removes the necessity to write complex makefile. Moreover, providing a very simple options file (in the FoBiS.py nomenclature indicated as fobos file) FoBiS.py can substitute the (ab)use of makefile for other project stuffs (build documentations, make project archive, etc...). Lib_VTK_IO is shipped with a fobos file that can build the library in both static and shared forms and also build the Test_Driver program. The provided fobos file has several building modes.

Listing fobos building modes

Typing:

FoBiS.py build -lmodes

the following message should be printed:

The fobos file defines the following modes:
  - "shared"
  - "static"
  - "test-driver"
  - "shared-debug"
  - "static-debug"
  - "test-driver-debug"

The modes should be self-explicative: shared, static and test-driver are the modes for building (in realese, optimized form) the shared and static versions of the library and the Test Driver program, respectively. The other 3 modes are the same, but in debug form instead of release one.

Building the library

The shared or static directories are created accordingly to the form of the library built. The compiled objects and mod files are placed inside this directory, as well as the linked library.

Release shared library
FoBiS.py build -mode shared
Release static library
FoBiS.py build -mode static
Debug shared library
FoBiS.py build -mode shared-debug
Debug static library
FoBiS.py build -mode static-debug

Building the Test Driver program

The Test_Driver directory is. The compiled objects and mod files are placed inside this directory, as well as the linked program.

Release test driver program
FoBiS.py build -mode test-driver
Debug test driver program
FoBiS.py build -mode test-driver-debug

Listing fobos rules

Typing:

FoBiS.py rule -ls

the following message should be printed:

The fobos file defines the following rules:
  - "makedoc" Rule for building documentation from source files
       Command => doxygen .doxygenconfig
  - "deldoc" Rule for deleting documentation
       Command => rm -rf doc/html/*
  - "maketar" Rule for making tar archive of the project
       Command => rm -rf Lib_VTK_IO…

The rules should be self-explicative.

Compiling by means of makefile

The provided makefile has several options. It has one rule that prints all options available and the default settings. Typing in the shell prompt: make help the following output will be printed:

 Make options of Lib\_VTK\_IO code

 Compiler choice: COMPILER=gnu => default
  COMPILER=gnu   => GNU gfortran
  COMPILER=intel => Intel Fortran

 Compiling options
  SHARED=yes(no)   => on(off) shared library         (default no)
  DEBUG=yes(no)    => on(off) debug                  (default no)
  F03STD=yes(no)   => on(off) check standard fortran (default no)
  OPTIMIZE=yes(no) => on(off) optimization           (default no)
  OPENMP=yes(no)   => on(off) OpenMP directives      (default no)

 Preprocessing options
  R16P=yes(no) => on(off) definition of real with "128 bit" (default no)

 Provided Rules: default=Lib_VTK_IO => compile the library
  help         => printing this help message
  Lib_VTK_IO   => compile the library
  Test_Driver  => compile Test_Driver program

#### Building the Test Driver program

#### Listing fobos building modes

### Compiling by means of makefile

The provided makefile has several options. It has one rule that prints all options available and the default settings. Typing in the shell prompt: `make help` the following output will be printed:

```bash
 Make options of Lib\_VTK\_IO code

 Compiler choice: COMPILER=gnu => default
  COMPILER=gnu   => GNU gfortran
  COMPILER=intel => Intel Fortran

 Compiling options
  SHARED=yes(no)   => on(off) shared library         (default no)
  DEBUG=yes(no)    => on(off) debug                  (default no)
  F03STD=yes(no)   => on(off) check standard fortran (default no)
  OPTIMIZE=yes(no) => on(off) optimization           (default no)
  OPENMP=yes(no)   => on(off) OpenMP directives      (default no)

 Preprocessing options
  R16P=yes(no) => on(off) definition of real with "128 bit" (default no)

 Provided Rules: default=Lib_VTK_IO => compile the library
  help         => printing this help message
  Lib_VTK_IO   => compile the library
  Test_Driver  => compile Test_Driver program
  cleanobj     => cleaning compiled object
  cleanmod     => cleaning .mod files
  cleanmsg     => cleaning make-log massage files
  cleanlib     => cleaning library
  clean        => running cleanobj, cleanmod and cleanmsg
  cleanall     => running clean and cleanexe
  tar          => creating a tar archive of the project
  doc          => building the documentation

Makefile Options

The makefiles provides several options. These can be divided in make options (compiler choice and compiling options) and in pre-processing options. For the pre-processing options the C pre-process paradigm has been used.

The meaning of the options are:

  • Compiler choice
    • COMPILER=gnu the codes is compiled using GNU gfortran compiler;
    • COMPILER=intel the codes is compiled using Intel Fortran compiler;
  • Compiling options
    • DEBUG=yes(no) compilation with (or not) debug symbols;
    • F03STD=yes(no) checking (or not) the compliance to Fortran standard 2003;
    • OPTIMIZE=yes(no) performance-optimized compilation (or not);
    • OPENMP=yes(no) compilation with (or not) OpenMP directives;
  • Preprocessing options
    • R16P=yes(no) activation (or not) support for real with "128 bit" (quadruple precision) representation;

Makefile Rules

The makefiles provides several rules. Their meanings are:

  • help: print help message in the shell prompt providing informations about the options and the rules available;
  • Lib_VTK_IO: build Lib_VTK_IO library;
  • Test_Driver: build Test_Driver program used for testing the library and for providing examples of usage;
  • cleanobj: clean compiled object file .o that are saved in obj directory by default;
  • cleanmod: clean modules files .mod that are saved in obj directory by default;
  • cleanmsg: clean log massage files of the make compilation that are "error_message" and "diagnostic_messages";
  • cleanlib: clean (remove) libary directory;
  • clean: execute cleanobj, cleanmod and cleanmsgr;
  • cleanall: execute clean and cleanexe;
  • tar: create a tar archive containing input lib util and src directories and makefile;
  • doc: build the documentation (by means doxygen) in the directory doc/html.
Note on the doxygen API documentations

In order to build the documentation the following dependences must be satisfied:

  • .doxigenconfig file must be in project main directory;
  • doc directory with doc/fpp.sh, doc/mainpage.txt, doc/examples.txt and doc/layout.xml files must be in project main directory;
  • doxygen program must be installed (http://www.stack.nl/~dimitri/doxygen/). All of the above pre-requisites are satisfied if the GitHub repository (https://github.com/szaghi/Lib_VTK_IO) is cloned.