I am running PostgreSQL 9.1 with Postgis 2.0 on Fedora 15.

When trying to install the raster support,

psql -d mydb -f rtpostgis.sql -v ON_ERROR_STOP=1

I get the following error

psql:rtpostgis.sql:46: ERROR:  
     could not load library "/usr/pgsql-9.1/lib/rtpostgis-2.0.so": libhdf5.so.6: 
     cannot open shared object file: No such file or directory

A locate libhdf5.so.6 gives the following paths.


Reinstalling the GDAL from the repositories did not solve the problem. The version of the installed GDAL.

gdal.x86_64                                1.7.3-14.fc15                @updates

2 Answers 2


You'll want to check that /etc/ld.so.conf has a referencence to the path /usr/lib64/mpich2/lib. If you add the path to ldo.so.conf, make sure to run ldconfig. You can then see what is in the ld cache using "ldconfig -p".

  • /etc/ld.so.conf had include ld.so.conf.d/*.conf one of the file was /etc/ld.so.conf.d/atlas-x8664.conf which contained /usr/lib64/atlas. A ldconfig -p | grep libhdf5 did not return anything. So I created a file gdal.conf and added the path /usr/lib64/mpich2/lib. Ran ldconfig. Now, ldconfig -p | grep libhdf5 had the paths to llibhdf5 files. After doing this, postgis raster suppot installation went smoothly. Thanks you for the input. Commented Aug 9, 2012 at 19:27

From my article: https://fmdojo.wordpress.com/2017/01/10/postgis-create-extension-error-cannot-find-libhdf5-so-6/

# find the lib if exist in OS filesystem
# returns: /usr/lib64/openmpi/lib/libhdf5.so.6
find / -name libhdf5.so.6

cd /etc/ld.so.conf.d/
nano postgis-fix.conf

# add to file:

# Reload libs configs:

# check the lib:
ldconfig -p | grep libhdf5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.