Skip to content

Instantly share code, notes, and snippets.

@riskydigital
Forked from robinkraft/osgeo_compile.sh
Created March 28, 2021 09:22
Show Gist options
  • Save riskydigital/a54a0aadd99889305e00e8c0801de21d to your computer and use it in GitHub Desktop.
Save riskydigital/a54a0aadd99889305e00e8c0801de21d to your computer and use it in GitHub Desktop.
compile and install GEOS, PROJ4 and GDAL from source on Ubuntu 12.0.4
# Compile/install GEOS. Taken from:
# http://grasswiki.osgeo.org/wiki/Compile_and_Install_Ubuntu#GEOS_2
cd /tmp
wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
bunzip2 geos-3.4.2.tar.bz2
tar xvf geos-3.4.2.tar
cd geos-3.4.2
./configure && make && sudo make install
sudo ldconfig
##########################################
# Compile & install proj.4. Taken from:
# http://grasswiki.osgeo.org/wiki/Compile_and_Install_Ubuntu#PROJ4
sudo apt-get install subversion
cd /tmp
svn co http://svn.osgeo.org/metacrs/proj/branches/4.8/proj/
cd /tmp/proj/nad
sudo wget http://download.osgeo.org/proj/proj-datumgrid-1.5.zip
unzip -o -q proj-datumgrid-1.5.zip
#make distclean
cd /tmp/proj/
./configure && make && sudo make install && sudo ldconfig
##########################################
# install gdal 1.10.1 - must happen after proj & geos
# taken from:
# http://grasswiki.osgeo.org/wiki/Compile_and_Install_Ubuntu#GDAL
# sudo apt-get install libtiff4
cd /tmp
svn co https://svn.osgeo.org/gdal/branches/1.10/gdal gdal_stable
cd gdal_stable
#make distclean
CFLAGS="-g -Wall" LDFLAGS="-s" ./configure \
--with-png=internal \
--with-libtiff=internal \
--with-geotiff=internal \
--with-jpeg=internal \
--with-gif=internal \
--with-ecw=no \
--with-expat=yes \
--with-sqlite3=yes \
--with-geos=yes \
--with-python \
--with-libz=internal \
--with-netcdf \
--with-threads=yes \
--without-grass \
--without-ogdi \
--with-xerces=yes
#with-pg=/usr/bin/pg_config \
make -j2 && sudo make install && sudo ldconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment