Tuesday, May 19, 2015
An open source geoscientific software environment: install notes
***********************************************************
Dear visitor: since I found myself updating this post too
often, I decided to make it a permanent page. I leave this
here, but the most updated notes are found here.
***********************************************************
These are my notes for installing from source the standard software tools I use most often. The instructions are given in order to satisfy dependencies. I use openSUSE (currently 13.1) on a AMD 64-bit machine. USE AT OWN RISK and enjoy!
# prerequisites you will need:
gcc, gcc++, gcc-fortran, make, hdf5, libtiff, gd, cairo, freetype, ncurses
open a terminal
su root # change to root user
cd /usr/local/src # change to a suitable directory
# Then, for every package "foo" download the tarball (foo.tar.gz) from each site using :
wget foo.tar.gz
# then uncompress and untar:
tar -xvf foo.tar.gz
# and change directory
cd foo/
# then, for each package, follow the instructions below
-------------------------------------------------------------------------------
NETCDF (http://www.unidata.ucar.edu/software/netcdf/)
./configure CC=gcc FC=gfortran F90=gfortran F77=gfortran CPPFLAGS=-DpgiFortran --with-pic
# convenient to install F90 support
# --with-pic is mandatory in 64 bit systems (GDAL compatibility)
make
make check
make install
# add a line to /etc/bash.bashrc.local: export NETCDFHOME=/usr/local
-------------------------------------------------------------------------------
GEOS (http://trac.osgeo.org/geos/)
./configure
make
make install
-------------------------------------------------------------------------------
PROJ (http://trac.osgeo.org/proj/)
./configure --without-jni
make
make install
# Perl module: Geo::Proj4
-------------------------------------------------------------------------------
LIBGEOTIFF (ftp://ftp.remotesensing.org/pub/geotiff/libgeotiff/)
./configure
make
make install
-------------------------------------------------------------------------------
FFTW (http://www.fftw.org/)
./configure --with-pic
make
make install
-------------------------------------------------------------------------------
ImageMagick (http://www.imagemagick.org/script/index.php)
./configure --with-perl --with-fftw # FFTW must be compiled with -with-pic
make
make check
make install
-------------------------------------------------------------------------------
GNUPLOT (http://www.gnuplot.info/)
# gnuplot is having troubles with wxWidget v 2.9, use 2.8 instead
./configure
make
make check
make install
-------------------------------------------------------------------------------
GSL - GNU Scientific Library (http://www.gnu.org/software/gsl/)
./configure
make
make check
make install
# get also the Perl module: Math:GSL
-------------------------------------------------------------------------------
GMT (http://gmt.soest.hawaii.edu)
# these are steps for version 5
# adapted from the official instructions (http://gmt.soest.hawaii.edu/projects/gmt/wiki/BuildingGMT)
- get the GMT tree
svn checkout svn://gmtserver.soest.hawaii.edu/gmt5/trunk gmt-dev
- get and untar GSHHG coastlines (ftp://ftp.soest.hawaii.edu/gshhg)
- get and untar country polygons (ftp://ftp.soest.hawaii.edu/dcw)
- copy cmake/ConfigUserTemplate.cmake to cmake/ConfigUser.cmake
- edit the file:
# Set path to GSHHG Shoreline Database [auto]:
set (GSHHG_ROOT "/usr/local/src/gshhg-gmt-nc4-2.2.4")
# Copy GSHHG files to $/coast [FALSE]:
set (COPY_GSHHG TRUE)
# Set path to DCW Digital Chart of the World for GMT [auto]:
set (DCW_ROOT "/usr/local/src/dcw-gmt-1.1.0")
# Copy DCW files to $/dcw [FALSE]:
set (COPY_DCW TRUE)
Build and install GMT:
cd gmt-dev
mkdir build
cd build
cmake ..
make
make install
-------------------------------------------------------------------------------
PostgreSQL (http://www.postgresql.org)
./configure --with-perl --with-python
gmake
useradd postgres -p postgres # simple password: postgres
# make sure that the home directory for user
# postgres is where you put the data
chown -R postgres /usr/local/src/postgresql-X.X.X
su postgres
gmake check
exit (su root)
gmake install
add to /etc/bash.bashrc.local export PATH=$PATH:/usr/local/pgsql/bin
add to /etc/bash.bashrc.local export MANPATH=$MANPATH:/usr/local/pgsql/man
add to /etc/ld.so.conf /usr/local/pgsql/lib
run /sbin/ldconfig
mkdir /where/your/pgdata/istobelocated # this should be the default directory
chown postgres /where/your/pgdata/istobelocated
su posgtres
initdb -D /where/your/pgdata/istobelocated
postmaster -D /where/your/pgdata/istobelocated
su root
cp /contrib/start-scripts/linux /etc/init.d/postgresql
make /etc/init.d/postgresql executable
activate postgresql in runtime levels 3 and 5
leave configured and built in order to follow with PostGIS
# you might want to keep the configured /src directory to eventually uninstall later
-------------------------------------------------------------------------------
PostGIS (http://www.postgis.org)
mv postgis-X.X.X/ postgresql-X.X.X/contrib/postgis-X.X.X/
./configure
make # if there were changes in fundamental libraries
make install # like bison, you must do "make" in PostgreSQL
su postgres
createdb test
# createlang plpgsql test
psql -f postgis/postgis.sql -d test
psql -f spatial_ref_sys.sql -d test
-------------------------------------------------------------------------------
Spatialite (http://www.gaia-gis.it/gaia-sins/)
# requires SQLite
# begin with freexl (https://www.gaia-gis.it/fossil/freexl/index)
./configure
make
make install
# then continue with
# libspatialite (https://www.gaia-gis.it/fossil/libspatialite/index)
# it is important to install and enable libxml2:
./configure --enable-libxml2
make
make install
# and then
# readosm (https://www.gaia-gis.it/fossil/readosm/index)
# spatialite-tools (https://www.gaia-gis.it/fossil/spatialite-tools/index)
# all with:
./configure
make
make install
# then, to install the handy spatialite_gui and the minimalistic spatialite_gis, install
# libgaiagraphics (https://www.gaia-gis.it/fossil/spatialite-tools/index)
# spatilite_gui (https://www.gaia-gis.it/fossil/spatialite_gui/index)
# librasterlite (https://www.gaia-gis.it/fossil/librasterlite/index)
# spatialite_gis (https://www.gaia-gis.it/fossil/spatialite_gis/index)
# for all these:
./configure
make
make install
# NOTE: libHaru (http://libharu.org/) is an indispensable requisite for spatialite_gis. I found it hard to install via the command line, so I got through the openSUSE Application:Geo repository.
-------------------------------------------------------------------------------
GDAL (http://www.gdal.org)
./configure --with-netcdf=/usr/local --with-png=/usr/lib --with-libtiff=internal --with-geotiff=/usr/local --with-jpeg=/usr/lib --with-geos=/usr/local/bin/geos-config --with-perl --with-python --with-odbc --without-libtool --with-spatialite=/usr/local
make
make install
# Note: The perl module Geo::GDAL gets installed in subdirectories of /usr/local/lib/perl5 ...
# just the directory to your working perl path (@INC) using
# use lib '/usr/local/lib/perl5 ...'
-------------------------------------------------------------------------------
QGIS (http://qgis.org)
Check that you also have
- QWT
change directory to /usr/local/qgis-X.X.X/
make new directory mkdir /build
change directory cd /build
ccmake ..
make
make install
-------------------------------------------------------------------------------
FWTOOLS (http://www.fwtools.maptools.org/)
wget http://home.gdal.org/fwtools/FWTools-linux-2.0.6.tar.gz
tar -xvf FWTools-linux-2.0.6.tar.gz
mv FWTools-linux-2.0.6/ /usr/local/
execute the install script
add to /etc/bash.bashrc.local export PATH=$PATH:/usr/local/FWTools-X.X.X/bin-safe # so it does not mess the main GDAL
-------------------------------------------------------------------------------
GPSBABEL (http://www.gpsbabel.org/)
./configure
make
make install
# Still needs to be investigated how to make it work with Garmin USB
# when one is not root
# According to the website, one should do:
# add garmin_gps to /etc/modprobe.conf.local
# create file /etc/udev/rules.d/51-garmin.rules
# with a line SYSFS{idVendor{=="091e", SYSFS{idProduct}=="0003",MODE="0666"}
# but does not work.
# I normally execute gpsbabel as root and previously disable the garmin_gps
# kernel module
Posted by HernĂ¡n De Angelis at Thursday, August 22, 2013
Email This
BlogThis!
Share to Twitter
Share to Facebook
Share to Pinterest
Labels: FOSS, geoscience, GIS, open culture, open science, remote sensing, science, software
2013-08-17
Welcome!
Welcome to Tales of ice and stone!
Here you will find (mostly free) resources for learning glaciology, remote sensing and geoscientific data analysis.
From time to time, I will post articles on science and science education.
Enjoy!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment