Skip to content

Instantly share code, notes, and snippets.

@justinnhli
Created January 12, 2021 01:48
Show Gist options
  • Save justinnhli/3909344ba58a3d9fe55a96fc2af54964 to your computer and use it in GitHub Desktop.
Save justinnhli/3909344ba58a3d9fe55a96fc2af54964 to your computer and use it in GitHub Desktop.
#!/bin/sh
export INSTALL_DIR=/usr/local
# download and install sqlite (required by proj)
curl -L https://www.sqlite.org/2020/sqlite-autoconf-3340000.tar.gz > sqlite.tar.gz
tar -xzvf sqlite.tar.gz
cd sqlite-autoconf-3340000/
CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA=1" ./configure --prefix=$INSTALL_DIR
make
make install
cd ..
# download and install libtiff (required by proj)
curl -L https://download.osgeo.org/libtiff/tiff-4.2.0.zip > tiff-4.2.0.zip
unzip tiff-4.2.0.zip
cd tiff-4.2.0/
ls
./configure --prefix=$INSTALL_DIR
make
make install
cd ..
# download and install proj (required by gdal)
curl -L https://download.osgeo.org/proj/proj-7.2.1.tar.gz > proj-7.2.1.tar.gz
tar -xzvf proj-7.2.1.tar.gz
cd proj-7.2.1/
#TIFF_LIBS=/home/justinnhli/root SQLITE3_LIBS=/home/justinnhli/root
PKG_CONFIG_PATH=$INSTALL_DIR/lib/pkgconfig ./configure --prefix=$INSTALL_DIR
make
make install
cd ..
# download and install gdal
curl -L https://github.com/OSGeo/gdal/releases/download/v3.2.0/gdal-3.2.0.tar.gz > gdal-3.2.0.tar.gz
tar -xzvf gdal-3.2.0.tar.gz
cd gdal-3.2.0/
PKG_CONFIG_PATH=$INSTALL_DIR/lib/pkgconfig ./configure --prefix=$INSTALL_DIR --with-proj=$INSTALL_DIR
make
make install
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment