Changes between Version 9 and Version 10 of BuildingOnUnix
- Timestamp:
- Jan 24, 2016, 4:36:04 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BuildingOnUnix
v9 v10 1 1 GDAL 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 3 System install : 2 4 3 5 {{{ 4 6 % cd gdal 5 % ./configure 7 % ./configure [options] 6 8 % make 7 9 % su … … 9 11 # make install 10 12 # exit 13 }}} 14 15 Install 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 11 28 }}} 12 29 … … 35 52 * 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. 36 53 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) 58 cd swig/python 59 python setup.py build 60 mkdir -p /path/to/install/prefix/lib/python2.7/site-packages (replace python2.7 by appropriate version in all below commands) 61 PYTHONPATH=/path/to/install/prefix/lib/python2.7/site-packages setup.py install --prefix=/path/to/install/prefix 62 # Check that this works with : 63 PYTHONPATH=/path/to/install/prefix/lib/python2.7/site-packages:$PYTHONPATH python -c "from osgeo import gdal; print(gdal.__version__)" 64 }}} 38 65 39 66 * 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.