Skip to content

805: PostGIS installation from source

KaiGai Kohei edited this page Oct 7, 2024 · 10 revisions

Below is a step-by-step command list for RHEL8/CentOS8.

NOTE: Please don't use geos-devel, gdal and gdal-devel distributed via the distribution. You need to get the specialized packages from the PGDG repository to build PostGIS.

-- if not installed yet
# dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
-- if not installed yet
# dnf install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

# dnf install proj-devel
# dnf install geos312-devel
# dnf install libxml2-devel
# dnf install protobuf-c-devel
# dnf install poppler
# dnf install gdal38 gdal38-devel
# dnf install SFCGAL SFCGAL-devel

$ git checkout https://github.com/postgis/postgis
$ cd postgis
$ git checkout --track origin/stable-3.4
$ ./autogen.sh
$ ./configure --with-pgconfig=/usr/local/pgsql-16/bin/pg_config \
              --with-geosconfig=/usr/geos312/bin/geos-config \
              --with-gdalconfig=/usr/gdal38/bin/gdal-config
$ make -j 12
$ sudo make install