Skip to content

Installation

Bob Fischer edited this page Jul 27, 2014 · 22 revisions

Table of Contents

Prerequisites

The GLINT2 Regridding Library has the following prerequisites:

  • C++ Compiler compliant with ISO C++11 standard (gcc 4.7 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
  • CGAL
  • 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

PISM Installation (Optional)

If PISM is being used, it must be installed before GLINT2.

PETSc

The following worked on beauregard (Ubuntu 12.04-LTS):

cd $HOME/opt
tar xfz $HOME/Downloads/petsc-3.4.0.tar.gz
cd petsc-3.4.0
PETSC_DIR=$PWD ./config/configure.py --with-shared-libraries --with-debugging=0 
make PETSC_DIR=/home/rfischer/opt/petsc-3.4.3 PETSC_ARCH=arch-linux2-c-opt all test

GLINT2 Installation

Clone the Git repository.

 > git clone https://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.
 > cd glint2

See here if you have problems cloning: https://help.github.com/articles/which-remote-url-should-i-use

Set up with Autoconf/Automake

 > 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'

Choose a file in the configme/ directory that best matches your system, and edit it. 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 Glint2:

 > sh ./configme/xxxxx
 > cd slib
 > make
 > make install
 > cd ..
 > make
 > 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. The following edit to the source code is required by Glint2. Unfortunately, it has not yet been released as a numbered version or tarball. The correct version of pyproj may be installed as follows:

 svn checkout -r 329 http://pyproj.googlecode.com/svn/trunk/ pyproj
 cd pyproj/
 python setup.py install --user

Make sure you don't have any MacPorts version of pyproj that might conflict with this:

 port uninstall py27-pyproj

netcdf4-python

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 https://github.com/citibob/pygiss.git

See here if you have trouble cloning: https://help.github.com/articles/which-remote-url-should-i-use

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

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

Frequent Installation Issues

GCC 4.9

Glint2 is supposed to be C++11 compliant. It was developed with GCC 4.8, which allows some things that are not in the C++11 standard. When GCC 4.9 is used, those things cause errors. Long-term, we will remove all non-C++11-compliant code from Glint2. In the meantime, if using GCC 4.9, the following line should be changed in commonmake.am before running configure:

 OLD: AM_CXXFLAGS = -std=c++11 -I$(top_srcdir)/slib \
 NEW: AM_CXXFLAGS = -std=c++14 -I$(top_srcdir)/slib \

IFort

Glint2 was originally developed using the GNU Fortran, C and C++ compilers. It is possible to use ifort instead of gfortran. In that case, do the following:

Missing python-config

Some python installations are missing the python-config command. This can often be resolved with a package install. If not, try using the following script as python-config.