CentOS 7 下编译gdal

安装GDAL程序


proj4

git clone https://github.com/OSGeo/proj.4.git

cd proj.4

./autogen.sh

./configure 

make

make install

cd ..

wget http://download.osgeo.org/geos/geos-3.6.0.tar.bz2

tar -xvf geos-3.6.0.tar.bz2

cd geos-3.6.0

./configure --enable-php --prefix /opt/gdal/geos 

make 

make install

ldconfig

cd ..


http://elgis.argeo.org/repos/6/elgis/x86_64/repoview/grass.html


GDAL:


netCDF

HDF4 hdf5


wget http://www.ijg.org/files/jpegsrc.v9b.tar.gz

tar -zxvf jpegsrc.v9b.tar.gz

cd jpeg-9b

./configure --prefix /opt /gdal/jpeg

make && make install

cd ..



wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.17/src/hdf5-1.8.17.tar

tar -xvf hdf5-1.8.17.tar

cd hdf5-1.8.17

./configure --prefix /opt/gdal/hdf5 --with-hdf4=/opt/gdal/hdf4  --with-jpeg=/opt/gdal/jpeg


export F9X=ifort

./configure --prefix=/opt/gdal/hdf5 --enable-cxx --enable-fortran


make && make install


wget https://support.hdfgroup.org/ftp/HDF/releases/HDF4.2.12/src/hdf-4.2.12.tar.gz


tar -zxvf hdf-4.2.12.tar.gz

cd hdf-4.2.12

./configure --prefix /opt/gdal/hdf4 --enable-netcdf --with-jpeg=/opt/gdal/jpeg

make && make install

./configure --prefix=/opt/gdal/hdf4 --disable-fortran --enable-hdf4 --enable-shared --with-jpeg=/opt/gdal/jpeg


checking for jpeg_start_decompress in -ljpeg... no

configure: error: couldn't find jpeg library


wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.4.1.tar.gz

tar -zxvf netcdf-4.4.1.tar.gz

cd netcdf-4.4.1

./configure --prefix /opt/gdal/netcdf  --with-hdf5=/opt/gdal/hdf5 --enable-hdf4 --with-hdf4=/opt/gdal/hdf4  --with-jpeg=/opt/gdal/jpeg

./configure --prefix /opt/gdal/netcdf  --with-hdf5=/opt/gdal/hdf5 --with-hdf4=/opt/gdal/hdf4  --with-jpeg=/opt/gdal/jpeg  --disable-netcdf-4




CPPFLAGS="-I/opt/gdal/hdf4/include -I/opt/gdal/hdf5/include -I/opt/gdal/jpeg/include“  LDFLAGS="-L/opt/gdal/hdf4/lib -L/opt/gdal/hdf5/lib -L/opt/gdal/jpeg/lib“   ./configure --enable-hdf4 --enable-hdf5 --enable-jpeg --prefix=/opt/gdal/netcdf --disable-netcdf-4



checking for library containing H5Fflush... no

configure: error: Can't find or link to the hdf5 library. Use --disable-netcdf-4, or see config.log for errors.

make && make install


wget http://download.osgeo.org/gdal/2.1.1/gdal-2.1.1.tar.gz

tar -zxvf gdal-2.1.1.tar.gz

cd  gdal-2.1.1


./configure --with-netcdf=/opt/netcdf/

./configure --prefix /opt/gdal/gdal --with-hdf4=/opt/gdal/hdf4 --with-hdf5=/opt/gdal/hdf5 --with-netcdf=/opt/gdal/netcdf


export LIBS=

export CFLAGS=

./configure --prefix /opt/gdal/gdal --with-hdf4=/opt/gdal/hdf4 --with-hdf5=/opt/gdal/hdf5 --with-netcdf=/opt/gdal/netcdf

./configure --with-hdf4=/opt/hdf-4.2.12/hdf4 --with-hdf5=/media/sf_linuxshare/hdf5-1.8.17 --with-netcdf=/opt/netcdf/

./configure --with-hdf4=/opt/hdf-4.2.12/hdf4 --with-hdf5=/opt/hdf5 --with-netcdf=/opt/netcdf/


export PATH=${PATH}:/opt/gdal/hdf5/include:/opt/gdal/hdf5/bin:/opt/gdal/hdf4/include:/opt/gdal/hdf4/bin:/opt/gdal/netcdf/include:/opt/gdal/netcdf/bin

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/gdal/hdf5/lib:/opt/gdal/hdf4/lib:/opt/gdal/netcdf/lib


export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/liuyue/hdf4/lib:/home/liuyue/hdf5/lib:/home/liuyue/netcdf/lib


export LD_LIBRARY_PATH=/opt/hdf5/lib/:/opt/hdf-4.2.12/hdf4/lib:/opt/netcdf/lib/:/usr/local/lib

export LD_LIBRARY_PATH=/opt/netcdf/lib/:/usr/local/lib


netCDF:

./configure --prefix /opt/gdal/netcdf --libdir=/opt/gdal/hdf5/lib:/opt/gdal/hdf4/lib:/opt/gdal/netcdf/lib && make && make install


CPPFLAGS=-I/opt/gdal/hdf5/include LDFLAGS=-L/opt/gdal/hdf5/lib ./configure --prefix=/opt/gdal/netcdf --enable-hdf4 --enable-netcdf4 --disable-utilities && make && make install

CPPFLAGS=-I/opt/gdal/hdf5/include LDFLAGS=-L/opt/gdal/hdf5/lib ./configure --prefix=/opt/gdal/netcdf --enable-netcdf4 --disable-utilities && make && make install


export LIBS=/opt/hdf5/lib/

export PATH=${PATH}:/opt/hdf5/lib:/opt/hdf-4.2.12/hdf4/lib:/opt/netcdf/lib


netCDF:

./configure --prefix /opt/gdal/netcdf --libdir=/opt/gdal/hdf5/lib:/opt/gdal/hdf4/lib:/opt/gdal/netcdf/lib --disable-netcdf-4

CPPFLAGS=-I/opt/gdal/hdf5/include LDFLAGS=-L/opt/gdal/hdf5/lib ./configure --prefix=/opt/gdal/netcdf --enable-hdf4 --enable-netcdf4 --disable-utilities

CPPFLAGS=-I/opt/gdal/hdf5/include LDFLAGS=-L/opt/gdal/hdf5/lib ./configure --prefix=/opt/gdal/netcdf --enable-netcdf4 --disable-utilities


export LIBS=/opt/gdal/hdf5/lib/

export PATH=${PATH}:/opt/gdal/hdf5/lib:/opt/gdal/hdf4/lib:/opt/gdal/netcdf/lib

你可能感兴趣的:(地理信息系统程序开发,环境配置,数据分析)