Installing GDAL
Procedure
- Use PuTTY to log in to the server as the root user.
- Create an installation directory.
mkdir -p /path/to/gdal
- Go to the installation directory.
cd /path/to/gdal
- Obtain the source code.
wget http://download.osgeo.org/gdal/2.2.4/gdal-2.2.4.tar.gz
- Decompress the source package.
tar -zxvf gdal-2.2.4.tar.gz
- Go to the directory generated after the decompression.
cd gdal-2.2.4
- Configure the compilation.
./configure --with-static-proj4=/usr --prefix=/path/to/gdal --without-pam --with-png=/usr --with-gif=internal --with-libtiff=internal --with-geotiff=internal --with-jpeg=/usr --with-libz=/usr --with-sqlite3=no --with-expat=no --with-curl=no --without-ld-shared --with-hdf4=no --with-hdf5=no --with-pg=no --without-grib --disable-shared --with-freexl=no --with-geos=no --with-openjpeg=no --with-mysql=no --with-ecw=no --with-fgdb=no --with-odbc=no --with-xml2=no --with-ogdi=no --with-pcraster=no --with-xerces=no

- Perform the compilation and installation.
make -j 8

make install

- Set the environment variables.
export PATH=/path/to/gdal/bin:$PATH export LD_LIBRARY_PATH=/path/to/gdal/lib:$LD_LIBRARY_PATH
Parent topic: Configuring the Compilation Environment