Diva installation

From GHER

(Difference between revisions)
Jump to: navigation, search
(Windows)
(Windows)
Line 49: Line 49:
* Xterm, the X11 terminal emulator.
* Xterm, the X11 terminal emulator.
* gmp, mpfr, and mpc libraries
* gmp, mpfr, and mpc libraries
-
* The [http://www.unidata.ucar.edu/downloads/netcdf/index.jsp NetCDF] library. The library is available in the cygwin installer, but does not properly work in all cases (and you must add the library nclib=/usr/lib/libnetcdff.dll.a into the compiling options. When trying to make the cygwin netcdt library to work, you might need to use  "cygcheck netcdfoutput.a" to see which libraries are still missing (in our case sasl) and therefore to install with the cygwin installer.  
+
* The [http://www.unidata.ucar.edu/downloads/netcdf/index.jsp NetCDF] library. The library is available in the cygwin installer, but does not properly work in all cases (and you must add the library '''nclib=/usr/lib/libnetcdff.dll.a''' into the compiling options). When trying to make the cygwin netcdt library to work, you might need to use  ''cygcheck netcdfoutput.a'' to see which libraries are still missing (in our case sasl) and therefore to install with the cygwin installer.  
If this does not work, it is then necessary to install it from source.
If this does not work, it is then necessary to install it from source.

Revision as of 15:43, 8 February 2013

Contents

How to install?

  • Extract the files from the archive
tar -xvf diva-4.4.2.tar.gz


Compilation

Diva can be compiled with different operating systems. The preferred one is Linux, as installing on windows is more tedious. The procedures are detailed below.

Linux

The minimal requirements are:

  1. A fortran compiler (easily installed through a package manager)
  2. The NetCDF library (instructions for installation here)

In order to compile the code:

  • Go in the source directory
cd diva-4.4.2/src/Fortran
  • Edit the configuration file for the compilation divacompile_options according to your machine.

Example:

# Name of the fortran compiler (ex: ifort,gfortran,pgi,...)
compiler=ifort
# Compilation flags
flags='-O3'
# Netcdf library
nclib=/usr/local/lib/netcdf3ifort/libnetcdf.a
  • if your installation knows the nc-config command, you can use
# Netcdf library if found by executing nc-config: make sure to use backquote `
nclib=`nc-config --flibs`


  • Run the compilation script:
divacompileall

and check the log file (compilation.log)

Windows

To compile the code under windows, you need to install cygwin, a Linux-like environment for Windows.

The installation or update of cygwin is done by running the setup.exe executable. It is recommended to install:

  • g77, a Fortran 77 compiler
  • gfortran, a Fortran 95 compiler . You may have to install it from http://gfortran.com/download/cygwin/, since it is not available through the cygwin installer.
  • Xterm, the X11 terminal emulator.
  • gmp, mpfr, and mpc libraries
  • The NetCDF library. The library is available in the cygwin installer, but does not properly work in all cases (and you must add the library nclib=/usr/lib/libnetcdff.dll.a into the compiling options). When trying to make the cygwin netcdt library to work, you might need to use cygcheck netcdfoutput.a to see which libraries are still missing (in our case sasl) and therefore to install with the cygwin installer.

If this does not work, it is then necessary to install it from source.

We used version 3.6.3, which does not require hdf5 library. The installation was performed with commands:

cd directory_containing_netcdf3.6.3
./configure --disable-cc
make
make install

The second line means that the library will not be build for c++ (not necessary in the case of Diva).


Run a test case

  • Go into divastripped directory:
cd path_to_divastripped
  • Execute the script divatest:
divatest
  • Check you results: they should look like this (here viewed with ncview):

Possible issues

Command not found

In case of command not found message, you may have to type

export PATH=$PATH:.

So if you need to type ./divacalc or similar things in a directory where divacalc is present, make sure to expand your path as shown above to be able use local scripts and programs

Problem with awk

By default Ubuntu comes with mawk, which has a different behavior when interpreting awk. In that case, the test will fail, and you will get an error like

error message

To solve this problem, it is only necessary to install gawk. The problem was previously reported for other programs, e.g., http://lists.netisland.net/archives/plug/plug-2008-09/msg00071.html.

Running divatest will try to test if you have the correct gawk version

Personal tools