Project

General

Profile

Install libraries from source

Back to Overview

The latest versions of HDF, NetCDF and GDAL are required, therefore they are compiled from source. The package manager is always some versions behind the most recent version.

#### Install latest hdf,netcdf and gdal libraries ####

export CPPFLAGS="-I/data/build/include/" 
export LDFLAGS="-L/data/build/lib/" 
export LD_LIBRARY_PATH="/data/build/lib/:$LD_LIBRARY_PATH" 
export PATH="/data/build/bin/:$PATH" 

#You should add these exports to your ~/.bashrc file, in order to load them automatically in each new shell.

#HDF5
cd /data/software
wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.11.tar.gz
tar -xzvf hdf5-1.8.11.tar.gz 
cd hdf5-1.8.11/
./configure --prefix=/data/build
make
make install

#NetCDF4
cd /data/software
wget http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.3.0.tar.gz
tar -xzvf netcdf-4.3.0.tar.gz 
cd netcdf-4.3.0/
./configure --prefix=/data/build --enable-netcdf-4
make
make install

#GDAL
cd /data/software
wget http://download.osgeo.org/gdal/1.10.0/gdal-1.10.0.tar.gz
tar -xzvf gdal-1.10.0.tar.gz 
 #Install GDAL ADAGUC driver (optional)
cd gdal-1.10.0/frmts/netcdf
wget http://trac.osgeo.org/gdal/raw-attachment/wiki/ADAGUC/GDAL_ADAGUC_source_v0.3.tar.gz
tar -xzvf GDAL_ADAGUC_source_v0.3.tar.gz
mv GDAL_ADAGUC_source_v0.3/* .
vi GNUmakefile
# add  adagucdataset.o to the OBJ list
vi /data/software/gdal-1.10.0/frmts/gdalallregister.cpp
# add GDALRegister_ADAGUC(); between GMT and NetCDF drivers
vi /data/software/gdal-1.10.0/gcore/gdal_frmts.h 
# add void CPL_DLL GDALRegister_ADAGUC(void); between GMT and NetCDF drivers
#Continue compiling GDAL
cd /data/software/gdal-1.10.0/
./configure --prefix=/data/build LIBS="-ludunits2" --with-python=yes

make
make install

#geos

#sudo apt-get install libgeos-3.4.2 libgeos-c1
#sudo easy_install GDAL

#or
cd /data/software
wget "http://download.osgeo.org/geos/geos-3.4.2.tar.bz2" 
tar -xjvf geos-3.4.2.tar.bz2 geos-3.4.2/
cd geos-3.4.2/
./configure --prefix=/data/build/
make
make install