Changes between Version 9 and Version 10 of BuildingOnUnix


Ignore:
Timestamp:
Jan 24, 2016, 4:36:04 AM (8 years ago)
Author:
Even Rouault
Comment:

Update instructions

Legend:

Unmodified
Added
Removed
Modified
  • BuildingOnUnix

    v9 v10  
    11GDAL has been successfully built on Linux, IRIX, Solaris, BSD, and MacOS X.  On Unix platforms you might be able to build it as follows (assuming it is unpacked or checked out of subversion as gdal):
     2
     3System install :
    24
    35{{{
    46% cd gdal
    5 % ./configure
     7% ./configure [options]
    68% make
    79% su
     
    911# make install
    1012# exit
     13}}}
     14
     15Install in non-root directory :
     16
     17{{{
     18% cd gdal
     19% ./configure --prefix=/path/to/install/prefix [options]
     20% make
     21% make install
     22% export PATH=/path/to/install/prefix/bin:$PATH
     23% export LD_LIBRARY_PATH=/path/to/install/prefix/lib:$PATH
     24% export GDAL_DATA=/path/to/install/prefix/share/gdal
     25# Test
     26% gdalinfo --version
     27# See below for installation of Python bindings
    1128}}}
    1229
     
    3552 * If you find build problems with one of the format drivers that you don't care about, just remove the format from the GDAL_FORMATS line at the bottom of gdal/GDALmake.opt, do a ''make clean'', and ''make''.  This will drop it from the build and default runtime registration.
    3653
    37  * If you are trying to install as other than root (to your own tree set with --prefix) you will likely have problems with the python since it always tries to install under the site-packages directory for the installed python tree.  If you don't need python support you can suppress it at configure using --without-python, or override the python module output directory at configure time with the --with-pymodir='''directory'''
     54 * With GDAL 2.0 or previous version, if you are trying to install as other than root (to your own tree set with --prefix), you will likely have problems with the python since it always tries to install under the site-packages directory for the installed python tree.  If you don't need python support you can suppress it at configure using --without-python. If you need them,
     55
     56{{{
     57(from GDAL source root)
     58cd swig/python
     59python setup.py build
     60mkdir -p /path/to/install/prefix/lib/python2.7/site-packages (replace python2.7 by appropriate version in all below commands)
     61PYTHONPATH=/path/to/install/prefix/lib/python2.7/site-packages setup.py install --prefix=/path/to/install/prefix
     62# Check that this works with :
     63PYTHONPATH=/path/to/install/prefix/lib/python2.7/site-packages:$PYTHONPATH python -c "from osgeo import gdal; print(gdal.__version__)"
     64}}}
    3865
    3966 * Static builds of GDAL are possible.  Here is one route that worked for me on Ubuntu 10.04 at about revision 23504 (you may want to take caution and figure out if there is a better way).  This example has java and mdb but shouldn't be required.  openjdk-6-jre and openjdk-6-jdk must be installed if you want --with-java.  ./configure --with-java=yes --with-mdb=yes --without-ld-shared --disable-shared --enable-static.  Then copy just /usr/bin/ogrinfo and ogr2ogr to another machine with similar environment (minus compiling tools, etc), follow [http://gdal.org/ogr/drv_mdb.html mdb format page] if you are using mdb.