Skip to content

Instantly share code, notes, and snippets.

@alanorth
Last active June 5, 2024 05:23
Show Gist options
  • Save alanorth/9681766ed4c737adfb48a4ef549a8503 to your computer and use it in GitHub Desktop.
Save alanorth/9681766ed4c737adfb48a4ef549a8503 to your computer and use it in GitHub Desktop.
Install GDAL 2.4.2 on CentOS 7

Install Proj

GDAL needs Proj:

$ cd /tmp
$ wget https://download.osgeo.org/proj/proj-6.1.1.tar.gz
$ tar xf proj-6.1.1.tar.gz 
$ cd proj-6.1.1
$ ./configure --prefix=/export/apps/proj/6.1.1
$ make -j4
$ sudo mkdir -p /export/apps/proj/6.1.1
$ sudo chown aorth /export/apps/proj/6.1.1
$ make install
$ sudo chown -R root:root /export/apps/proj/6.1.1

Install GDAL

$ cd /tmp
$ wget https://download.osgeo.org/gdal/2.4.2/gdal-2.4.2.tar.gz
$ tar xf gdal-2.4.2.tar.gz
$ cd gdal-2.4.2
$ sudo yum install libzstd-devel sqlite-devel libwebp-devel hdf5-devel
$ ./configure --prefix=/export/apps/gdal/2.4.2 --with-proj=/export/apps/proj/6.1.1
$ make -j4
$ sudo mkdir -p /export/apps/gdal/2.4.2
$ sudo chown -R aorth /export/apps/gdal/2.4.2
$ make install
$ sudo chown -R root:root /export/apps/gdal/2.4.2
@bernardo1963
Copy link

Hi, I got an error while executing this line:
sudo chown -R aorth /export/apps/gdal/2.4.2
Is it correct?

@alanorth
Copy link
Author

@bernardo1963 these notes were written with my user and my computing environment in mind. You have to change aorth to your user name, as well as the /export/apps path prefix (that's where we install apps on our cluster, but it is an arbitrary path).

@huangsiyr
Copy link

hello, when I use the step of ./configure --prefix=/export/apps/gdal/2.4.2 --with-proj=/export/apps/proj/6.1.1, it show me that configure: error: cannot find proj, what is the problem of this? and how to solve this?

@anu275
Copy link

anu275 commented Dec 13, 2023

I am getting error while ruining make -j4

collect2: error: ld returned 1 exit status
make[1]: *** [GNUmakefile:88: gdal_translate] Error 1
make[1]: Leaving directory '/home/338040/gdal-2.4.0/apps'
make: *** [GNUmakefile:109: apps-target] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment