Skip to content

Installation

Bob Fischer edited this page Feb 5, 2014 · 22 revisions

Table of Contents

Prerequisites

The GLINT2 Regridding Library has the following prerequisites:

  • C++ Compiler (gcc 4.5 or higher)
  • Fortran 2003 Compiler (gfortran 4.5 or higher)
  • Python (for installation, and for use with the Python interface)
  • NetCDF (including Fortran and C++ bindings)
  • Proj.4 (map projections)
  • Boost C++ Library
  • GMP
  • MPFR
  • GALAHAD (Optimization Library)
  • Blitz C++ Arrays

Prerequisite Installation: Macintosh

The following instructions are for installation of prerequisites using a Macintosh. We recommend the use of MacPorts. Many of the required packages can be obtained directly from MacPorts, greatly easing the installation process.

  1. Install MacPorts. See directions on MacPorts web site.
  2. Install your favorite C/C++/Fortran compiler and assorted utilities:
    sudo port install -s autoconf automake
    sudo port install -s gcc47 +gfortran
    sudo port install -s libtool pkgconfig doxygen
  3. Install a basic Python environment:
    sudo port install -s python27 py27-numpy py27-matplotlib
    sudo port select --list python
    sudo port select python python27
  4. Install the following prerequisite libraries via MacPorts:
    sudo port install -s proj gmp cgal mpfr boost
    sudo port install -s hdf5 udunits netcdf netcdf-cxx netcdf-fortran blitz

GALAHAD Installation

Obtain GALAHAD. This is a two-step process:

  1. Register for GALAHAD at http://www.galahad.rl.ac.uk/registration.html
  2. Download GALAHAD at http://www.galahad.rl.ac.uk/downloads/download.html
From this process, you should obtain a galahad.tar.gz tarball. Galahad is installed via an interactive script.
 tar xvfz galahad.tar.gz    # Put in destination, no separate install
 cd galahad
 mkdir ext
 cd ext
 svn checkout --username anonymous \
    http://ccpforge.cse.rl.ac.uk/svn/cutest/archdefs/trunk ./archdefs
 cd ..
 export GALAHAD=`pwd`
 export ARCHDEFS=`pwd`/ext/archdefs
 $ARCHDEFS/install_optsuite

GALAHAD: Macintosh

Now it will have a conversation with you:

     (1) Everything
     (2) LANCELOT B and its dependencies
     (3) the QP packages and their dependencies
     (4) the regularised quadratic solvers and their dependencies
     (5) FILTRANE and its dependencies
 '''3'''
  Select required interfaces to GALAHAD packages
  (the chosen subset will optionally be installed below)
 
     (E) Provide all available interfaces (CUTEst, Matlab, AMPL)
     (X) Provide all available interfaces except to Matlab
     (B) Provide all available interfaces except to AMPL
     (C) Provide CUTEst interfaces
     (M) Provide Matlab interfaces
     (A) Provide AMPL interfaces
     (N) Standalone - no interfaces required
 '''N'''
 
 Build schedule:
  - GALAHAD from
  -  /Users/rpfische/opt/galahad-1305
 
  Select platform
 
    (1) Compaq (DEC) alpha
    (2) Cray
    (3) HP workstation
    (4) IBM PowerPC
    (5) PC
    (6) PC with generic 64-bit processor
    (7) PC with 64-bit Itanium processor
    (8) PC with 64-bit Opteron processor
    (9) PC with 64-bit Athlon processor
   (10) SGI workstation
   (11) SUN workstation
   (12) MAC OS/X
   (13) 64-bit MAC OS/X
 '''13'''
  Would you like to review and modify the system commands (y/N)? y
  Select fortran compiler
 
         (1) GNU g95 compiler for 64-bit Macs under OSX
         (2) GNU gfortran compiler for 64-bit Macs under OSX
         (3) Intel ifort compiler for 64-bit Macs under OSX
         (4) NAG nagfor compiler for 64-bit Macs under OSX
 '''2'''
  Would you like to review and modify the fortran compiler settings (y/N)? y
  Version for architecture mac64.osx.gfo will be installed
 
  Installing GALAHAD ...
  Would you like to compile the GALAHAD subset you selected earlier (Y/n)? y
 
  GALAHAD may be compiled in (S)ingle or (D)ouble precision or (B)oth.
  Which precision do you require for the installed subset (D/s/b) ? D
  Installing the double precision version
  Compiling cputim         		[ OK ]
  Compiling clock          		[ OK ]
  Compiling blas           		...

When it's over, it tells you:

 You should now add the following to your .bashrc file:

 export ARCHDEFS="/Users/rpfische/opt/galahad-1305/ext/archdefs"
 export GALAHAD="/Users/rpfische/opt/galahad-1305"
 export PATH="${GALAHAD}/bin:${PATH}"
 export MANPATH="${GALAHAD}/man:${MANPATH}"

 Optionally, if you also wish this to be your default version, add

 export MYARCH="mac64.osx.gfo"

 Finally, remember to export MASTSIF="" to your SIF test-problem directory

I did not need to do this for my purposes.

GALAHAD: Ubuntu 12.04-LTS=

The conversation you have with the GALAHAD install script will look as follows on Ubuntu 12.04-LTS:

rfischer@myhost:~/opt/galahad-1305$ $ARCHDEFS/install_optsuite 
Do you wish to install GALAHAD (Y/n)? y
 Select required subset of GALAHAD packages
 (the chosen subset will optionally be installed below)

    (1) Everything
    (2) LANCELOT B and its dependencies
    (3) the QP packages and their dependencies
    (4) the regularised quadratic solvers and their dependencies
    (5) FILTRANE and its dependencies
3
 Select required interfaces to GALAHAD packages
 (the chosen subset will optionally be installed below)

    (E) Provide all available interfaces (CUTEst, Matlab, AMPL)
    (X) Provide all available interfaces except to Matlab
    (B) Provide all available interfaces except to AMPL
    (C) Provide CUTEst interfaces
    (M) Provide Matlab interfaces
    (A) Provide AMPL interfaces
    (N) Standalone - no interfaces required
N

Build schedule:
 - GALAHAD from
 -  /home/rfischer/opt/galahad-1305

 Select platform

   (1) Compaq (DEC) alpha
   (2) Cray
   (3) HP workstation
   (4) IBM PowerPC
   (5) PC
   (6) PC with generic 64-bit processor
   (7) PC with 64-bit Itanium processor
   (8) PC with 64-bit Opteron processor
   (9) PC with 64-bit Athlon processor
  (10) SGI workstation
  (11) SUN workstation
  (12) MAC OS/X
  (13) 64-bit MAC OS/X
6
 Select operating system

   (1) Windows 2000/XP with MinGW/Msys
   (2) Linux
2
 Would you like to review and modify the system commands (y/N)? y
 Select fortran compiler

        (1) GNU g95 compiler
        (2) GNU gfortran compiler
        (3) Intel ifort compiler
        (4) Lahey lf95 compiler
        (5) NAG nagfor compiler for 64-bit PCs under Linux
        (6) Portland Group pgfortran compiler
        (7) Sun Studio f90/f95 compiler
        (8) IBM xlf95 compiler under 64-bit linux
2
 Would you like to review and modify the fortran compiler settings (y/N)? y
 Version for architecture pc64.lnx.gfo will be installed

 Installing GALAHAD ...
 Would you like to compile the GALAHAD subset you selected earlier (Y/n)? y

 GALAHAD may be compiled in (S)ingle or (D)ouble precision or (B)oth.
 Which precision do you require for the installed subset (D/s/b) ? d
 Installing the double precision version
 Compiling cputim         		[ OK ]
 Compiling clock          		[ OK ]
 Compiling blas           		[ OK ]
 Compiling lapack         		

The message at the end is:

You should now add the following to your .bashrc file:

 export ARCHDEFS="/home/rfischer/opt/galahad-1305/ext/archdefs"
 export GALAHAD="/home/rfischer/opt/galahad-1305"
 export PATH="${GALAHAD}/bin:${PATH}"
 export MANPATH="${GALAHAD}/man:${MANPATH}"

 Optionally, if you also wish this to be your default version, add

 export MYARCH="pc64.lnx.gfo"

 Finally, remember to export MASTSIF="" to your SIF test-problem directory

GLINT2 Installation

Clone the Git repository.

 bash-3.2$ '''git clone git@github.com:citibob/glint2.git'''
 Cloning into glint2...
 Enter passphrase for key '/Users/rpfische/.ssh/id_dsa': 
 remote: Counting objects: 543, done.
 remote: Compressing objects: 100% (533/533), done.
 remote: Total 543 (delta 324), reused 0 (delta 0)
 Receiving objects: 100% (543/543), 6.37 MiB | 253 KiB/s, done.
 Resolving deltas: 100% (324/324), done.
 bash-3.2$ '''cd glint2/'''

Set up with Autoconf/Automake

 bash-3.2$ '''sh ./bootstrap'''
 glibtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
 glibtoolize: rerunning glibtoolize, to keep the correct libtool macros in-tree.
 glibtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
 glibtoolize: `AC_PROG_RANLIB' is rendered obsolete by `LT_INIT'

Edit configme. Make sure that all paths in it to prerequisites are correct:

  1. If you used MacPorts, you should only need to set GALAHAD_HOME
  2. Set CPPFLAGS appropriately for Intel vs. GNU C++ compiler
  3. Set DEST_PREFIX to your desired installation location for GLINT2, eg: $HOME/opt/glint2

Configure, compile and install Snowdrift:

 bash-3.2$ '''sh ./configme'''
 bash-3.2$ '''make'''
 bash-3.2$ '''make install'''

Add to your .bash_profile (manually substituting the value of DEST_PREFIX set in configme):

 DEST_PREFIX=...
 export PYTHONPATH=$DEST_PREFIX/lib/python2.7/site-packages
 export PKG_CONFIG_PATH=$DEST_PREFIX/lib/pkgconfig
 export PATH=$PATH:$DEST_PREFIX/bin

You can test that GLINT2 works with your python installation with the following. It will produce no output if everything is OK:

 bash-3.2$ '''python -c "import glint2"'''

Additional Python Installation

If you wish to run the sample Python programs, you must install some additional software:

pyproj

This allows the use of the proj.4 map projection library from Python. Download pyproj-<version></version>.tar.gz from http://code.google.com/p/pyproj/downloads/list, then do:

 tar xvfz pyproj-&lt;version&gt;&lt;/version&gt;.tar.gz
 cd pyproj-&lt;version&gt;&lt;/version&gt;
 python setup.py build
 python setup.py install --user

===netcdf4-python===file:///usr/share/doc/HTML/index.html

This allows the reading and writing of netCDF files from Python. Download netCDF4-<version></version>.tar.gz from http://code.google.com/p/netcdf4-python/downloads/list, then do:

 tar xvfz netCDF4-&lt;version&gt;&lt;/version&gt;.tar.gz
 cd netCDF4-&lt;version&gt;&lt;/version&gt;
 python setup.py build
 python setup.py install --user

pygiss

This is a simple miscellaneous Python library by Bob Fischer. Decide where you want to put it (say, DEST=$HOME/opt), then do:

 cd $HOME/opt
 git clone username@dirk.merseine.nu:/export/git/pygiss.git

Now add to your PYTHONPATH in $HOME/.bash_profile:

 export PYTHONPATH=$HOME/opt/pygiss:$PYTHONPATH

Clone this wiki locally