- Install some required packages: these are the names for Debian-based systems
- compiler and build tools: gcc g77 g++ flex bison m4 make libcfitsio-dev
- database includes: libsqlite3-dev libmysqlclient14-dev libwrap0-dev (postgresql-includes)
- GDAL-specific:libhdf4g-dev python-numeric
- GRASS-specific: libncurses5-dev zlib1g-dev libreadline5-dev libfreetype6-dev libtiff4-dev libpng3-dev tcl8.3-dev tk8.3-dev (glutg3-dev libgle3-dev libgl1-mesa-dev) or (nvidia-glx-dev) fftw-dev
- X.org requires: libxmu-headers libxmu-dev libxxf86vm-dev libxmuu-dev libxmu-dev
- Get and install PROJ4 from source (simple compile)
- Don't forget the proj-datumgrid-1.4.zip file: unzip in the 'nad' folder before the ./configure step.
- Get and install the latest GEOS from source (simple compile)
- Get and install the latest GDAL and GDAL-GRASS plugin (relatively simple compile)
## 32-bit mode
#optimization for opteron: (http://www.coyotegulch.com/reviews/gcc4/index.html)
export CFLAGS="-march=opteron -O2"
export CXXFLAGS="-march=opteron -O2"
#optimization for P4:
export CFLAGS="-march=pentium4 -O2"
export CXXFLAGS="-march=pentium4 -O2"
## 64-bit mode PowerPC
#optimization from powerpc64:
export CFLAGS="-mpowerpc64 -O2"
export CXXFLAGS="-mpowerpc64 -O2"
export FCFLAGS="-O2 -mpowerpc64"
export OBJCFLAGS="-O2 -mpowerpc64"
export FFLAGS="-O2 -mpowerpc64"
Special Note when compiling GDAL with NetCDF Support:
I usually use the following configure script:
./configure --with-png=internal --with-jpeg=internal \
--with-gif=internal --with-libtiff=internal \
--with-geotiff=internal --with-libz=internal --with-netcdf --without-hdf4 \
--without-ogdi --with-python --with-sqlite --with-mysql \
--with-threads=yes --without-grass \
--with-mrsid=/home/dylan/src/Geo_DSDK-6.0.7.1407/
Note that you will need to leave the Lizard Tech DSDK folder in the exact same location for subsequent compilation of GRASS.
- Checkout the latest development version of GRASS 6 via Subversion:
# check out the software:
svn co http://svn.osgeo.org/grass/grass/branches/develbranch_6 grass6_dev/
# or update a local copy:
svn up
I usually use the following configure script:
./configure --with-tcltk-includes=/usr/include/tcl8.4 \
--with-postgres --without-odbc --with-mysql \
--with-mysql-includes=/usr/include/mysql/ \
--with-freetype --with-freetype-includes=/usr/include/freetype2 \
--with-readline --with-cxx --enable-largefile \
--with-postgres-includes=/usr/local/pgsql/include/ \
--with-postgres-libs=/usr/local/pgsql/lib/ --with-sqlite --with-python \
--with-proj-share=/usr/local/share/proj/ \
--with-cairo
- Get and install the GDAL-GRASS plugin: GRASS Wiki Page on this topic
Here are the steps that I use:
#link GRASS libs to the /usr/local/lib/ folder
cd /usr/local/lib/ ; sudo ln -s /usr/local/grass-6.5.svn/lib/*.so .
#return to the gdal-grass plugin source directory:
./configure --with-grass=/usr/local/grass-6.5.svn/
#make
make clean && make
#create a gdal-plug-ins folder
sudo mkdir /usr/local/lib/gdalplugins
#copy the compiled plugins to the gdalplugins folder
sudo cp *.so /usr/local/lib/gdalplugins/
#done
- Finally, you might need to update your /etc/ld.so.conf to include GRASS libs
Here is my /etc/ld.so.conf Don't forget to run ldconfig after changing this file!
---------/etc/ld.so.conf---------------
...
/usr/local/lib
/usr/local/grass-6.5.svn/lib
...
-----------------------------------------