I'm compiling PostGIS 2.5 from source on Ubuntu Server 18.04
The server had no internet connection due to client requirements, so I've been following PostGIS 2.5.1dev Manual, 2.4. Compiling and Install from Source: Detailed Steps ( https://postgis.net/docs/manual-2.5/postgis_installation.html#PGInstall ).
It's required to install (compile from source) the next packages:
- Proj4 reprojection library, version 4.9.0 or greater.
- GEOS geometry library, version 3.5 or greater.
- LibXML2, version 2.5.x or higher.
- JSON-C, version 0.9 or higher.
- GDAL, version 1.8 or higher.
Everything works fine after typical compiling instructions:
./configure
make
make install
Then I compile PostGIS again with typical instructions:
./configure
make
make install
In order to check if everything is working, I connect to my DB:
sudo -u postgres psql postgres
postgres=# \c testdb
testdb=# \CREATE EXTENSION postgis;
And then... PostGIS ERROR: could not load library "/usr/lib/postgresql/10/lib/postgis-2.5.so": libproj.so.13: cannot open shared object file: No such file or directory.
As far as I understand, the problem is with libproj so I've compiled again, but had no success.
Did I miss something?
2 Answers 2
If you did not install postgis in /usr, then this error is normal.
You need to configure ldconfig to link you compiled libs. You could export LD_LIBRARY_PATH=/opt/postgres or /usr/local (see in the makefile) or you can permanently add a config file in /etc/ld.conf.so.d/ with the path of your libs before calling 'sudo ldconfig'.
The best way is that you find where is this libproj.so; may be you just need a symlink to get postgres to find it.
-
Thanks a lot!!! It worked like a charm.KrVa– KrVa2019年06月21日 08:35:42 +00:00Commented Jun 21, 2019 at 8:35