[ English | Japanese ] [ GFD Dennou Club / Gtool Project ] [ Gtool5 Documents ]

Gtool5 Installation Guide


  1. Operation Environment
  2. Input Output Data Format
  3. General outline
  4. Software Requirements
  5. How to build
  6. How to install
  7. Execute test programs
  8. Set PATH to gt5frt

Operation Environment

Gtool5 library is operated by following environments.

Gtool5 library was operated by following environments in the past. Latest version may be operated (unconfirmed).

Input Output Data Format

gtool5 support following data format.

General outline

Install gtool5 as follows. Refer each items for details.

  1. Satisfy Software Requirements.
  2. Build the library following How to build.
  3. Install the library following How to install.
  4. Check whether the installed library functions normally following Execute test programs.
  5. Set PATH to gt5frt.

Install example

There are examples of installation in "Tutorial" on Gtool Project. Refer them if the installation is not successful.

For Debian GNU/Linux users

When you are using Debian GNU/Linux, binary packages distributed with <URL:http://www.gfd-dennou.org/library/gtool/debian.htm.en> can be used.

For Windows users

Naohito OTOBE (in JAPANESE) creates and releases gtool5 Windows binaries (in JAPANESE) for Intel Visual Fortran

Software Requirements

The following software needs to use gtool5.

netCDF (version 3.6)

Debian GNU/Linux (use binary packages)

Build from source codes

Following softwares should be installed for generating documentations. But, if you get from gtool5 TGZ package, documentations are already generated.

How to build

Extract TGZ Package

Make an empty directory, and extract archive. A directory `gtool5-version' created at the current working directory.

$ tar xvzf gtool5_current.tgz

or

$ zcat gtool5_current.tar.gz | tar -xvf -

Specify Fortran Compiler

Specify Fortran compiler to environment variable FC . For example, if you use "frt",

Specify Fortran compiler options for optimization and debug to environment variable FFLAGS . For example, if you set options for automatic optimization and automatic parallelization to "frt",

Create `Config.mk'

Move created directroy, and excute ` ./configure '.

If your path of netCDF library is `/usr/local/netcdf/lib/libnetcdf.a', you should set options as follow. Then a configure file `Config.mk' will be created at the current working directory. If the netCDF library is a shared library, --with-netcdff= option may be needed. See details of options as follows.

$ ./configure --with-netcdf=/usr/local/netcdf/lib/libnetcdf.a

If gtool5 is built for MPI, see How to build for MPI.

GNU make is needed to build, so configure automatically inquires into GNU make in PATH. However, it returns error when GNU make is not found. In that case, please set the GNU make command for environment variable MAKE . And rerun execute ` ./configure '.

If you want to change directory to which the library and the module, etc. are installed, please set --help option as follow. Available options are showed.

$ ./configure --help

Descriptions about principal options are listed below.

--with-netcdf=ARG
Specify netCDF library needed for build to ARG. You must specify explicitly.
--with-netcdff=ARG
If the netCDF library is a shared library, the library may be divided C library from Fortran library. In the case, specify the C library to above option, and specify the Fortran library to ARG in this option.
--prefix=ARG
Specify prefix to ARG. Default value is /usr/local/gtool5 .
--host=ARG
When cross-compiling, specify the type of system on which the package will run to ARG.
--libdir=ARG
Specify directory to which the library is installed to ARG. Default value is /usr/local/gtool5/lib .
--includedir=ARG
Specify directory to which the module is installed to ARG. Default value is /usr/local/gtool5/include .
--bindir=ARG
Specify directory to which the executable file is installed to ARG. Default value is /usr/local/gtool5/bin .
--with-docdir=ARG
Specify directory to which the documentation file is installed to ARG. Default value is /usr/local/gtool5/doc .
--with-gt5libname=ARG
Specify gtool5 library name to ARG. Library name becomes lib<ARG>.a . Default value is gtool5 , so library name becomes libgtool5.a .
--with-gt5suffix=ARG
Specify suffix of installdir, library name, executable files toARG. For example, you specify ffc5 when others are default, prefix of installdir becomes /usr/local/gtool5-ffc5 , library name becomes libgtool5-ffc5.a , executable files become gt5frt.ffc5 , gt5config.ffc5 .
--with-lang_conform_check=ARG
Specify language standard to ARG. And when you compile source code, check the language standard conformance. Now, "95" is valid. The compiler that can be used is limited.
--enable-debug
When you compile source code and execute binary file, output debug messages. This will slow down your program. This option is valid at some compilers (ex. g95, frt, ifort).
--with-abort=ARG
Specify one of abort, errtra-setrcd, exit, setrcd, stop to ARG. Default value is abort .
abort
Stop by intrinsic subroutine "abort".
errtra-setrcd
Stop by Fujitsu Fortran service subroutine "ERRTRA". And outputs error trace back map.
exit
Stop by intrinsic subroutine "exit".
setrcd
Stop by Fujitsu Fortran service subroutine "SETRCD". And outputs error trace back map.
stop
Stop by intrinsic subroutine "stop".
--config-cache or -C

config.cache is created at the same time as Config.mk 's being generated. config.cache stores information investigated with ./configure .

If you set this option, when you execute ./configure again, config.cache is loaded. If you want to ignore config.cache, don't set this option

For example, execute ./configure as follows.

$ ./configure -C --with-netcdf=/usr/local/netcdf/lib/libnetcdf.a --enable-debug

Then, information such as the locations of the netCDF library is succeeded by executing ./configure as follows after next time.

$ ./configure -C

If you use Fujitsu Fortran compiler in Debian GNU/Linux, copy "Config.cache.debian-ffc*" to config.cache and execute ./configure . So, locations of libraries are specified automatically.

$ cp Config.cache.debian-ffc5 config.cache
$ ./configure

How to build for MPI

If gtool5 is built for MPI, install MPI library to a system firstly.

When "Config.mk" is edited, specify a compile commend like as "mpif90" to environment variable FC . And specify a MPI executable command to "--with-mpiexec" option of "configure".

$ ./configure --with-netcdf=/usr/local/netcdf/lib/libnetcdf.a --with-mpiexec=mpirun

"configure" may not be performed correctly if a MPI executable command is particular. In such cases, specify "--enable-mpi" option as follows.

$ ./configure --with-netcdf=/usr/local/netcdf/lib/libnetcdf.a --enable-mpi

See Create `Config.mk' about other options.

Edit `Config.mk'

Edit `Config.mk' manually, if you want to change. If you do not understand following settings, go forward to Compile source code tentatively.

FC          : Fortran Compiler

SYSFFLAGS   : Flags needed when compiled and linked

SYSLDFLAGS  : Flags needed when linked

SYSLDLIBS   : Libraries needed when linked

F90MODTYPE  : Information of Modules
              (std.mod, HP.mod, fqs.mod, intel.d, hitachi.f90)

DEST_LIB    : Directory to which the library file is installed

DEST_INC    : directory to which the module files are installed

DEST_BIN    : directory to which the executable files are installed

DEST_DOC    : directory to which the documantation files are installed


MODS        : Extensions of Module Files used when "make clean"

MAKE        : GNU make command

AR          : Archive command

ARFLAGS     : Flags of AR

RANLIB      : Generate index to archive

Compile source code

You must use GNU make to build. No other "make" program is acceptable. "make" tentatively means GNU make at the following. Replace them with GNU make of your system.

When ./configure is executed, the command name of GNU make is displayed as follows. Execute GNU make according to this message.

Execute GNU make in the current directory, as follows.

  /usr/bin/make

Generate documentations

To generate documentations, execute the following command in current directory. If you get from gtool5 TGZ package, documentations are already generated.

$ make doc

How to install

In current directory, execute following command. If you install to system, you need to be administrator. (By default, you install to system).

# make install

If you want to install documentation files, execute following command.

# make install-doc

Execute test programs

In current directry, execute following command. If message " *** Compilation and installation are succeeded !! *** " are showed without error, installation is completed.

$ make test-installed

When cross-compiling ...

If you are cross-compiling, following messages will be displayed.

Cross compile mode will be used.
First, change directory to ./test .
Secondly, submit ...
       dc_string_test ... histtest ...,

Thirdly, change directory to ./ .
Last "make test-installed-c"

According to above message, test as follows.

  1. Change directory to test .
  2. Run listed executable files. The way of run depends on each environment. Therefore, you should examine the way by yourself.
  3. Change former directory.
  4. Do "make test-installed-c".

If message " *** Compilation and installation are succeeded !! *** " are showed without error, installation is completed.

Set PATH to gt5frt

If the installation is correctly done as stated above, shell script gt5frt is made under the directory --prefix=ARG/bin (By default, /usr/local/gtool5/bin/ ).

Please specify PATH to this directory. It is an example as follows when gt5frt is installed in /usr/local/gtool5/bin/ .

gt5frt is a shell script in order to easily compile and link Fortran programs which utilizes the gtool5 library. Link to the gtool5 library and directory appointment to the modules are done automatically by using gt5frt in place of command of the Fortran compiler.

$ gt5frt test.f90

/usr/bin/g95 -I/usr/local/gtool5/include -O test.f90 \
    -L/usr/local/gtool5/lib -lgtool5 -L/usr/local/lib -lnetcdf

$Id: INSTALL,v 1.8 2009-03-18 07:12:38 morikawa Exp $
Gtool Development Group / GFD Dennou Staff dcstaff@gfd-dennou.org